WooCommerce stores
Collect the full order total for physical products, virtual products, and downloadable files.
Daraja · Kopo Kopo · KCB Buni · Equity Jenga
Accept full M-Pesa payments on WordPress through Safaricom Daraja, Kopo Kopo, KCB Buni, or Equity Jenga, settled directly into your paybill, till, KCB account, or Equity account. Works for WooCommerce, services, downloads, invoices, booking fees, and custom payment forms.
Version 1.8.2. Free for the first 24 hours, then KES 2,000 per year.
Checkout
Order INV-1001
Pay with M-Pesa
Pay KES 4,500 to Your Store, account INV-1001.
Enter M-PESA PIN
Who it is for
The plugin works for shops and service businesses that want a direct M-Pesa flow through Daraja, Kopo Kopo, KCB Buni, or Equity Jenga, settling straight to their own paybill, till, or bank account, without sending customers to a separate checkout website.
Collect the full order total for physical products, virtual products, and downloadable files.
Create payment forms for consultations, bookings, repair work, retainers, or project milestones.
Share a payment page for a specific quote, invoice, school fee, subscription, or one-off bill.
What is included
Install the ZIP, choose Daraja, Kopo Kopo, KCB Buni, or Equity Jenga, test the 24-hour trial, then activate the annual license when the payment flow is confirmed.
Version 1.8.2
Providers
Every provider runs through the same plugin UI. Switch any time, no code changes. KCB Buni and Equity Jenga are direct-bank-settlement options for merchants who want M-Pesa payments landing straight in their bank account.
Setup path
The trial is meant for developers and business owners to confirm provider credentials, callbacks, IPN webhooks, order status updates, and live STK Push behavior across any of the four providers before paying.
Upload the plugin from WordPress Admin, activate it, and open the Mocky M-Pesa settings tab.
Use the free 24-hour trial to connect Daraja, Kopo Kopo, KCB Buni, or Equity Jenga credentials and test real payment flows.
Buy the annual license when the integration is working correctly for your site.
Documentation
Step-by-step credential walkthroughs for every provider, plus the shortcode, REST endpoints, and PHP helper you can drop into custom WordPress code.
You only need to set up one provider to take payments. Pick whichever matches where you want the money to land (paybill, till, KCB, or Equity) and follow the steps for that provider. The plugin handles the rest.
Before you start
Credentials and where to find them
Consumer Key
Where: Daraja portal → My Apps → click your app → Keys tab → copy the value shown for Consumer Key.
Looks like: A random 30–40 character alphanumeric string.
Consumer Secret
Where: Same Keys tab as the Consumer Key. It appears right below it. You can also click Generate to rotate it.
Looks like: A random 30–40 character alphanumeric string.
Business Shortcode
Where: For a paybill, your paybill number. For a till, the store number (head office number) your Daraja app and passkey were issued for, not the till number itself. Both are on your Lipa na M-Pesa welcome letter from Safaricom.
Looks like: 5- or 6-digit number, e.g. 174379 (sandbox) or your live shortcode.
Till Number (till only)
Where: Only for a till: the till number customers pay into. Enter it in plugin settings after choosing Till / Buy Goods, so payments land in the till and not the store number.
Looks like: 5- to 7-digit number. Leave empty for a paybill.
Lipa na M-Pesa Passkey
Where: Daraja portal → My Apps → click your app → APIs tab → expand Lipa Na M-Pesa Online → Test Credentials shows the sandbox passkey. Production passkeys are emailed by Safaricom once you go live.
Looks like: A long 64-character hexadecimal string.
Transaction Type
Where: Set in plugin settings: pick "CustomerPayBillOnline" for a paybill or "CustomerBuyGoodsOnline" for a till.
Looks like: Dropdown choice in plugin settings. No value to copy.
Callbacks: Daraja STK callback with optional Safaricom IP allowlist for production.
Going live
Before you start
Credentials and where to find them
Client ID
Where: Kopo Kopo Dashboard → Settings → API Keys → Create a new application → copy Client ID.
Looks like: A random 30+ character string.
Client Secret
Where: Same API Keys page as the Client ID. It is shown only once at app creation. Re-issue if you lose it.
Looks like: A random 50+ character string.
API Key
Where: Kopo Kopo Dashboard → Settings → API Keys → expand your app → generate or copy the API Key. Used as the webhook signing key.
Looks like: A random 30+ character string.
Till / Online Payment account
Where: Top-right of your Kopo Kopo dashboard, or on your Kopo Kopo welcome email. Format K######.
Looks like: Letter K followed by 6 digits, e.g. K123456.
Callbacks: X-KopoKopo-Signature HMAC verification with the API key (Client Secret accepted as fallback for SDK compatibility).
Going live
Before you start
Credentials and where to find them
Consumer Key
Where: Buni portal → Apps → Add new app (or open an existing app) → subscribe it to MpesaExpressAPIService → open the Subscriptions tab → copy Consumer Key.
Looks like: A random 30–40 character alphanumeric string.
Consumer Secret
Where: Same Subscriptions tab as the Consumer Key. Click the "show" icon to reveal it, then copy.
Looks like: A random 30–40 character alphanumeric string.
KCB Till or Account Number
Where: The KCB till or bank account that should receive payments. Enter it in plugin settings under KCB till or account number. The plugin sends it at the start of each payment reference (for example 1234567-WC1024), which is how KCB knows which account to credit.
Looks like: Your KCB till number or bank account number, digits only.
Callbacks: STK Push callback confirms each payment; IPN notifications are acknowledged only.
Going live
Before you start
Credentials and where to find them
Generate the RSA key pair
Where: In a terminal run: openssl genrsa -out privatekey.pem 2048 && openssl rsa -in privatekey.pem -pubout -out publickey.pem. This creates two files in the current folder.
Looks like: Two text files: privatekey.pem (keep private) and publickey.pem (upload to Jenga).
Upload the Public Key
Where: Jenga portal → Profile → My Profile → scroll to Public Key → click Upload → choose publickey.pem → Save.
Looks like: Confirmation that "Public key uploaded successfully".
API Key
Where: Jenga portal → Apps → My Apps → click your app (or create one and subscribe to M-Pesa STK USSD Push) → Keys tab → copy the API Key.
Looks like: A random 50+ character string.
Merchant Code
Where: Jenga portal → Profile → My Profile → top of the page next to your business name.
Looks like: 7- to 10-digit numeric merchant ID, e.g. 1234567890.
Consumer Secret
Where: Same Keys tab as the API Key, listed under "Test" (sandbox) or "Live" (production). Copy the value shown.
Looks like: A random 40+ character string.
Equity Account Number
Where: Your Equity Bank current account number, printed on your Equity statements or seen in Equitel/EquityOnline.
Looks like: 13-digit account number like 0170194290581.
Merchant Display Name
Where: Set in plugin settings and shown to the customer on the M-Pesa STK prompt. Defaults to your WordPress site title if left blank.
Looks like: A short business name, e.g. "Mocky Digital".
Private Key (PEM)
Where: Open privatekey.pem in a text editor and copy the whole file content including the BEGIN/END lines. Paste into the Private Key field in plugin settings.
Looks like: -----BEGIN PRIVATE KEY----- followed by ~25 lines of base64, ending with -----END PRIVATE KEY-----.
Callbacks: Jenga settlement callback keyed on transactionReference; no signature required.
Going live
The shortcode renders an M-Pesa checkout form anywhere in WordPress, perfect for service pages, invoices, downloads, and one-off payment links. The server stores the amount so visitors cannot tamper with it in the browser.
[mocky_mpesa_checkout amount="2000" reference="INV-1001" description="Invoice payment"]Optional attributes: button, redirect_url, show_name, show_email.
Use the REST endpoints to start an STK Push from any frontend, mobile app, or other WordPress code. Calls are rate-limited per phone number and per IP, and identical requests within 90 seconds reuse the same pending transaction.
// 1. Server-signed checkout context. Render the signature on your page
// with mocky_mpesa_context_signature($fixed, $amount, $reference, $description).
POST /wp-json/mocky-mpesa/v1/context
X-WP-Nonce: <nonce>
{
"reference": "INV-1001",
"description": "Invoice payment",
"fixed_amount": true,
"amount": 2000,
"signature": "<signature>"
}
// -> { "context_id": "..." }
// 2. Send the prompt. Amount, reference and description come from the context.
POST /wp-json/mocky-mpesa/v1/initiate
X-WP-Nonce: <nonce>
{
"context_id": "...",
"phone": "0712345678",
"amount": 2000,
"customer_name": "Jane Customer",
"email": "jane@example.com"
}POST /wp-json/mocky-mpesa/v1/context: creates a checkout context from server-signed values. Required before every prompt.POST /wp-json/mocky-mpesa/v1/initiate: sends the STK Push prompt for a context.POST /wp-json/mocky-mpesa/v1/status: polls for the final transaction outcome.POST /wp-json/mocky-mpesa/v1/callback: provider webhook endpoint (already set by the plugin).The PHP helper is the fastest way to send an STK Push from a theme, custom plugin, or scheduled job. It picks up whichever provider is active in settings and writes the transaction to the same table WooCommerce uses.
$result = mocky_mpesa_stk_push(array(
'phone' => '0712345678',
'amount' => 2000,
'reference' => 'INV-1001',
'description' => 'Invoice payment',
'customer_name' => 'Jane Customer',
));
// $result['transaction'] is the saved DB row.
// $result['response']['CheckoutRequestID'] links it to the provider.For custom storefronts, compute the trusted total on the server before calling mocky_mpesa_stk_push() so visitors cannot reduce the amount in the browser.
Every STK Push goes through the same hardened pipeline regardless of provider: per-phone cooldown, per-IP hourly cap, idempotent initiation, signed license responses, provider callback verification, amount-mismatch rejection, and WP-Cron recovery for stuck pending transactions.
Related M-Pesa resources
Plan a complete online store with a mobile-first catalogue, checkout, and M-Pesa payment workflow.
Read moreUse the step-by-step Kenya guide to plan products, fulfilment, checkout, and payment setup.
Read moreCompare website and business-system integration paths before choosing a WordPress plugin.
Read moreSomething not covered here? Ask us directly.
Yes. The plugin includes a WooCommerce payment gateway that sends an M-Pesa STK Push for the full WooCommerce order total using whichever provider you select: Safaricom Daraja, Kopo Kopo, KCB Buni, or Equity Jenga.
Four providers in one plugin: Safaricom Daraja (settles to your paybill or till), Kopo Kopo (settles to your Kopo Kopo till), KCB Buni (settles directly to your KCB bank account), and Equity Jenga (settles directly to your Equity bank account). You pick one in the settings and switch any time.
Yes, with KCB Buni and Equity Jenga. KCB Buni routes M-Pesa payments straight into your KCB till or bank account, using the till or account number you enter in the plugin. Equity Jenga settles into your Equity account using its M-Pesa STK USSD Push API with RSA-SHA256 signed requests. No third-party aggregator handles your money.
No. You only need the Consumer Key and Consumer Secret from the Buni portal, plus your KCB till or account number. Funds settle to that KCB till or account. KCB Buni does not issue a paybill passkey, and the plugin does not ask for one.
An app registered at developer.jengahq.io with the M-Pesa STK USSD Push product subscribed, your Equity account number, an API key, merchant code, consumer secret, and a public/private RSA key pair. Upload the public key on the Jenga portal and paste the private key (PEM) into the plugin settings. The plugin handles signing each request.
Yes. You can configure the plugin to use Kopo Kopo for supported M-Pesa payment flows, with webhook signature verification using your Kopo Kopo API key.
Yes. You can use shortcodes or the REST endpoints to collect M-Pesa payments for services, downloads, invoices, booking fees, or custom WordPress payment pages. The same four providers are available outside WooCommerce.
Yes. Developers can install the plugin and start a free 24-hour trial to test any provider (Daraja, Kopo Kopo, KCB Buni, or Equity Jenga), including credentials, callbacks, STK Push flow, and site setup.
The plugin is sold as a self-hosted commercial plugin at KES 2,000 per year per domain after the 24-hour trial. All four providers are included in the same license, with no upsells.
Install the plugin and use the 24-hour trial with your own provider credentials. Keep it for KES 2,000 per year per domain.