WooCommerce integration
Accept M-Pesa and USDT on WooCommerce
The E-Sarif Checkout plugin adds a second and third way to pay to your WooCommerce store: an M-Pesa prompt on the buyer phone, and USDT or USDC on Tron, Solana, Base and 6 more networks. Orders are marked paid by a signed webhook, and you can refund from the WooCommerce admin like any other gateway.
- Early access
- WordPress stores running WooCommerce
- No code required
Why it matters
The Kenyan WooCommerce checkout problem
A WooCommerce store selling into Kenya usually ends up with two bad options. The first is a card gateway, which excludes the large share of buyers who do not use a card online. The second is a paybill or till number pasted into the order notes, which works right up until you are matching M-Pesa SMS messages against orders by hand at eleven at night, guessing which of two customers sent the 2,400 shillings.
The manual route also breaks the parts of WooCommerce you rely on. Orders sit in Pending, stock is not released, the customer never gets a processing email, and your reports are wrong. Nothing downstream can be automated because the store does not know the payment happened.
E-Sarif Checkout closes that loop. The buyer approves the payment on their phone, E-Sarif confirms it, and a signed webhook tells WooCommerce the order is paid, so stock, emails and reports behave exactly as they would with a card gateway. The stablecoin method sits on the same page for buyers paying from outside Kenya or holding USDT.
Setup
Install and configure in eight steps
None of this requires code. Budget about twenty minutes, most of it spent on the test order you should not skip.
- 01
Create your E-Sarif merchant account
Sign up on the merchant portal and generate an API key pair. You get a secret key beginning esk_ and a publishable key beginning epk_. Start with the test pair; the live pair can wait until the flow works.
- 02
Install the E-Sarif Checkout plugin
Upload the plugin zip under Plugins, Add New, Upload Plugin, then activate it. It registers itself as a WooCommerce payment gateway and adds its own webhook endpoint.
- 03
Open WooCommerce, Settings, Payments
E-Sarif Checkout appears in the list of gateways alongside your existing methods. Toggle it on and click Manage to open its settings.
- 04
Paste your keys and leave test mode on
Enter the secret and publishable keys. The secret key is stored server-side and is never rendered into the page your buyer loads. Keep the test-mode toggle enabled for now.
- 05
Choose the payment methods and settlement currency
Decide whether the gateway offers M-Pesa, stablecoins or both, and set the settlement currency to USDT or KES. You can also restrict which networks are shown to buyers.
- 06
Register the webhook endpoint
Copy the webhook URL the plugin displays into your merchant portal. This is what marks orders paid, so do not skip it. Order status is never changed on the return redirect alone.
- 07
Place a test order end to end
Buy something cheap from your own storefront with the test keys active. A test payment settles after a few seconds without a real STK push, so you can watch the order move to Processing.
- 08
Swap in the live keys
Turn test mode off, paste the esk_live_ and epk_live_ pair, and place one small real order. Confirm the webhook arrived and that the order status changed before you announce the new payment method.
- Enable E-Sarif Checkout
- Secret key (esk_test_...)
- Publishable key (epk_test_...)
- Payment methods: M-Pesa, stablecoins
- Settlement currency: USDT or KES
- Test mode: on
- Webhook URL to copy into the merchant portal
Supported features
What the WooCommerce plugin does and does not do
The bottom two rows matter as much as the rest. A payment method that quietly fails at renewal time is worse than one you knew about in advance.
| Feature | Status on WooCommerce |
|---|---|
| M-Pesa STK push | Supported. The buyer enters a phone number on the E-Sarif checkout page and approves the prompt. |
| USDT and USDC | Supported on Tron, Solana, Base, BNB Chain, Ethereum, Polygon, Arbitrum, Optimism and Avalanche. |
| Redirect checkout | Supported. The buyer leaves for the E-Sarif hosted page and returns to your order-received page. |
| Embedded checkout | Supported. The session can be opened in an iframe on your own checkout page instead. |
| Order status automation | Orders move to Processing on a verified checkout.session.completed webhook, and to Failed or Cancelled when the session expires. |
| Refunds from the WooCommerce admin | Supported, full and partial. The refund is created against the original session and returned over M-Pesa B2C or on-chain. |
| Idempotent retries | The plugin derives its idempotency key from the order id and attempt number, so a buyer double-clicking Pay cannot create two charges. |
| Test mode | Supported, with a separate key pair. Test payments confirm automatically after a few seconds. |
| Multi-currency pricing | Sell in KES, USD, USDT or USDC. The buyer sees the stablecoin equivalent calculated at session creation. |
| WooCommerce Subscriptions and recurring billing | Not supported. Every payment is an individual checkout session that the buyer approves. |
| Saved cards or stored payment methods | Not applicable. There is nothing to store: M-Pesa is approved on the handset and stablecoin payments come from the buyer wallet. |
Going live
Four things worth checking on a real store
These are the issues that cost merchants their first live weekend. All four take minutes to verify and are invisible until they bite.
How the underlying API behaves- Confirm the webhook actually reaches your store. Aggressive security plugins, a staging password wall and some CDN rules will silently block it.
- Check your order-received page loads for a logged-out buyer, since that is the page the shopper is returned to after paying.
- Set the settlement currency deliberately. It defaults to USDT, which is not what you want if you are expecting shillings in an M-Pesa account.
- Test a cancelled payment as well as a successful one, so you know what the buyer sees when they change their mind at the prompt.
FAQ
WooCommerce and E-Sarif, answered
Does the E-Sarif WooCommerce plugin support M-Pesa?
Yes. M-Pesa is one of the two payment methods the gateway offers. The buyer enters their phone number on the E-Sarif checkout page, approves the STK push prompt on their handset, and the order is marked paid in WooCommerce when the confirmation webhook arrives.
Do my customers need a crypto wallet?
Only if they choose to pay in stablecoin. A buyer paying by M-Pesa never sees a wallet, an address or a network name. The two methods sit side by side on the same checkout page and the buyer picks one.
Can I keep my existing WooCommerce payment gateways?
Yes. E-Sarif Checkout registers as an additional gateway. Your current methods stay exactly where they are and the buyer chooses at checkout.
Will my WooCommerce orders be marked paid automatically?
Yes, through a signed webhook. The plugin verifies the HMAC signature, rejects deliveries older than five minutes, and deduplicates on the event id, so a retried delivery cannot mark the same order paid twice. The buyer returning to your site is treated as a UX convenience, never as proof of payment.
How do refunds work?
Refund from the WooCommerce order screen as you would with any gateway. The plugin creates the refund against the original checkout session, in full or in part, and E-Sarif returns the money the way it arrived. Refunds above your account threshold are held for approval before they move.
My store prices in KES. Can I still settle in USDT?
Yes. Pricing currency and settlement currency are set independently. A KES price list can settle to a USDT balance, and E-Sarif does the conversion at session creation so the buyer sees an exact amount.
Does it work with WooCommerce Subscriptions?
No. Recurring billing is not supported today. Each payment is a single checkout session the buyer approves, which rules out unattended renewals. If you need recurring billing, use a payment link per invoice cycle or talk to the team first.
Is my secret API key exposed in the page source?
No. The plugin creates every checkout session from your server using the secret key. Only the publishable key can appear in the browser, and it can do nothing except open a session and read its own status.
What happens if a customer abandons the payment?
The session expires, by default after thirty minutes, and the order is left unpaid rather than being marked complete. The buyer can retry from the same order; the plugin creates a fresh session with a new idempotency key.
Other integrations
Not on WooCommerce? Start here instead
Shopify
Take M-Pesa and stablecoin payments on a Shopify store without leaving your theme.
Read the Shopify guideEarly accessWHMCS
Collect hosting and domain invoices in M-Pesa or USDT, with automatic invoice marking.
Read the WHMCS guideIn developmentWordPress
Payment buttons and blocks for any WordPress site, with or without a shopping cart.
Read the WordPress guideEarly accessREST API and SDKs
One HTTP call returns a checkout URL. PHP, Node and browser SDKs on top of it.
Read the REST API and SDKs guideIn developmentPayment links
Get paid with a shareable link. No website, no plugin, no code.
Read the Payment links guideAdd M-Pesa to WooCommerce
this afternoon.
Create a merchant account, grab your test keys, and run a full order through the plugin before you take a real payment.