Overview

The RohoPay WooCommerce plugin adds mobile money and card payment methods to any WooCommerce store. Customers can pay via MTN MoMo, Airtel Money, M-Pesa, or Visa/Mastercard — no developer required after initial setup.

Prerequisites

  • WordPress 6.0+
  • WooCommerce 8.0+
  • An active RohoPay account with a live API key
  • HTTPS enabled on your WordPress site

Installation

1

Download the Plugin

Download the RohoPay WooCommerce plugin ZIP from your RohoPay dashboard under WordPress → Plugin Download.
2

Upload to WordPress

In your WordPress admin:
  1. Go to Plugins → Add New → Upload Plugin
  2. Upload the rohopay-woocommerce.zip file
  3. Click Install Now, then Activate
3

Connect Your RohoPay Account

In your RohoPay dashboard:
  1. Go to WordPress → Connections → New Connection
  2. Enter your WordPress site URL
  3. Copy the generated Site Token
In your WordPress admin:
  1. Go to WooCommerce → Settings → Payments → RohoPay
  2. Paste the Site Token
  3. Click Save & Verify
4

Configure Payment Methods

In WordPress WooCommerce → Settings → Payments:
  • Enable RohoPay Mobile Money and/or RohoPay Card
  • Set display names and descriptions
  • Choose test or live mode

Dashboard Connection API

Manage connections programmatically:

Create a Connection

POST /api/v2/plugins/connections
Cookie: session={dashboard_session}
Content-Type: application/json

{
  "site_url": "https://your-woocommerce-site.com",
  "site_name": "My WooCommerce Store"
}
{
  "success": true,
  "data": {
    "id": "conn_01j2k3",
    "site_url": "https://your-woocommerce-site.com",
    "site_name": "My WooCommerce Store",
    "site_token": "rph_site_xxxxxxxxxxxx",
    "is_active": true,
    "created_at": "2024-07-15T10:00:00Z"
  }
}
The site_token is shown once in the response. Copy it immediately and configure it in your WordPress plugin settings. If you lose it, regenerate it from the dashboard.

List Connections

GET /api/v2/plugins/connections

Regenerate Site Token

If your token is compromised:
POST /api/v2/plugins/connections/{id}/regenerate-token

Provider Routing Rules

The plugin supports weighted routing between providers:
PUT /api/v2/plugins/routing
Content-Type: application/json

[
  {"provider": "primary", "weight": 70},
  {"provider": "secondary", "weight": 30}
]
Get current routing:
GET /api/v2/plugins/routing

Viewing Plugin Transactions

Transactions originating from the WooCommerce plugin are tagged with source_module: "plugin" and can be viewed:
  • Dashboard → Transactions (filter by source)
  • WordPress dashboard → WooCommerce → Orders (linked to RohoPay references)
  • API: GET /api/v2/plugins/transactions

Plugin Settings

Update plugin settings per connection:
PUT /api/v2/plugins/connections/{id}/settings
Content-Type: application/json

{
  "test_mode": false,
  "mobile_money_enabled": true,
  "card_enabled": true,
  "preferred_provider": "primary"
}

Troubleshooting

  1. Verify the site URL in your dashboard matches exactly (including https:// and trailing slash behavior)
  2. Ensure your WordPress site is publicly accessible over HTTPS
  3. Check that the site token was copied correctly without extra spaces
  4. Try regenerating the token and reconnecting
  1. Check your RohoPay webhook configuration — the plugin registers its own callback URL during setup
  2. Ensure your WordPress site can receive POST requests from your RohoPay API URL
  3. Check the WordPress error log (wp-content/debug.log) for RohoPay-related errors
  1. Verify the phone number format — ensure customers enter numbers in local format (e.g., 0700 123 456 for Uganda)
  2. Check that you’re using a live API key for production
  3. Test with the test phone number 256700000000 in test mode

WooCommerce Checkout Flow

When a customer selects RohoPay Mobile Money:
  1. Customer enters their phone number on the WooCommerce checkout page
  2. Plugin calls RohoPay to initiate collection
  3. Customer receives USSD prompt on their phone
  4. After approval, WooCommerce order status changes to Processing
  5. Merchant fulfills the order and marks it Complete
When a customer selects RohoPay Card:
  1. Customer enters card details on the WooCommerce checkout page
  2. Plugin calls RohoPay checkout API
  3. Customer is redirected to 3DS authentication page
  4. After authentication, customer returns to WooCommerce success page
  5. Webhook confirms payment; order status changes to Processing