Taking money online in Kenya is not one decision. It is four: which methods you accept, who processes them, how your site learns the payment succeeded, and what happens when it does not.
Get the first three right and payments become invisible. Get the fourth wrong and you spend your evenings matching M-Pesa messages to orders and arguing with customers about screenshots.
What Kenyan Customers Actually Pay With
M-Pesa first, by a distance. Safaricom reported 40.99 million one-month active M-Pesa customers in Kenya for the year ended 31 March 2026, and 1.04 million active Lipa Na M-Pesa merchants.
Cards matter for a smaller, higher-value group: the diaspora, visitors, and companies paying on a corporate card. Bank transfer still dominates large business-to-business invoices. The practical conclusion is that most Kenyan sites need M-Pesa properly integrated, and some need cards alongside it.
The Three Routes, Compared
| Route | Customer pays with | Money lands in | Best for |
|---|---|---|---|
| M-Pesa direct via Safaricom's Daraja API | M-Pesa, by a prompt on their phone, or your Paybill or Till | Your own Paybill or Till | Almost every Kenyan business selling to Kenyan customers |
| An aggregator such as Pesapal | M-Pesa and cards, on the gateway's payment page | Your merchant account with them | One integration covering mobile money and cards |
| A card gateway such as Pesapal, Flutterwave or PayPal | Visa, Mastercard, international cards | Your account with that provider | Diaspora, tourists, corporate buyers |
The structural difference is who holds the money first. With M-Pesa direct, the customer pays your Paybill and Safaricom is the only party charging a fee. With an aggregator, they collect and pass it on, charging for the service. You are buying convenience and card coverage.
Choosing Your Mix
- Local customers only: M-Pesa direct is enough. Do not pay gateway rates on payments that never needed a gateway.
- Some diaspora or corporate buyers: M-Pesa direct plus a card option at checkout.
- You want one dashboard and accept a fee on everything: an aggregator for both.
- Large invoices: keep bank transfer, and put the details on the invoice rather than the checkout.
What You Need Before You Start
- A registered business, with the documents the provider will ask for.
- A Paybill or Till number, or a Daraja merchant account from Safaricom, for the M-Pesa route.
- A website on HTTPS. Safaricom and every gateway send the result back to an address on your site, and that address must be reachable securely from the internet.
- A real checkout that creates an order before payment, so there is something to mark paid.
- A phone and a card you can test with, because the only real test is a real transaction.
The Integration, Step by Step
M-Pesa, from nothing to live
- Get the Paybill or Till. The money needs a destination before anything else happens.
- Create a Daraja account and app at developer.safaricom.co.ke, which issues the consumer key and secret your site authenticates with.
- Build in the sandbox. Your site requests an STK Push, the prompt goes out, and Safaricom calls your callback URL with the result: paid, cancelled, wrong PIN or timed out. Handle all four.
- Request go-live, which links your real shortcode to production credentials.
- Test with real money. Run KES 1 transactions through the live Paybill before any customer does. The sandbox does not behave exactly like production.
- Let the callback do the work. The order is marked paid when Safaricom confirms, triggering the receipt, the stock update and the alert to your team.
The technical detail, with a working code example, is in how to add M-Pesa payments to your website. For stores specifically, see the WooCommerce M-Pesa guide.
The Rules That Keep You Out of Trouble
Never trust a screenshot
Forged M-Pesa confirmation messages are a known trick. The only acceptable proof of payment is the provider confirming it to your system directly.
Never mark an order paid on the redirect
A customer landing back on your thank-you page proves nothing. Browsers close, networks drop, URLs get typed. Mark the order paid on the callback, verified against the provider's record.
Keep credentials out of your theme
A consumer secret pasted into a theme file, or committed to a public code repository, lets somebody else transact as you. Keep keys in configuration outside the web root, and rotate anything that has ever been exposed.
Reconcile automatically, then spot-check
Every payment should already be attached to its order. Your job becomes a weekly spot check, not a nightly reconciliation session.
What Goes Wrong, and How to Handle It
| Symptom | Usual cause | Fix |
|---|---|---|
| Money received, order still unpaid | The callback never reached your site: firewall, security plugin, maintenance mode, or plain HTTP | Test the callback URL from outside your network and allow the provider's requests |
| Customer says no prompt appeared | They are on a call, the line is not M-Pesa registered, or the request timed out | Offer a visible "try again" button and a Paybill fallback with the reference prefilled |
| Duplicate payments | The customer retried while the first request was still open | Make each attempt idempotent against your order reference, and refund promptly when it happens |
| Works in testing, fails on launch day | Only the sandbox was tested | Always run live transactions before go-live |
| Checkout randomly fails | A caching plugin caching the checkout or the callback endpoint | Exclude both from caching |
What It Costs
| Item | Who charges it | Amount |
|---|---|---|
| M-Pesa integration, done for you | WPfoss | KES 5,000 one-time, all-inclusive |
| Transaction charges on your Paybill or Till | Safaricom | Safaricom's current business tariff |
| Gateway or card processing | The gateway | Their merchant rate, quoted on application |
| A new shop with payments built in | WPfoss | From KES 50,000 |
Our fee covers STK Push, Paybill and Till confirmations, B2C payouts, reconciliation and reporting, the Daraja registration with Safaricom, live test transactions and support. It is a one-time fee, not a share of your transactions. Details on the M-Pesa integration page.
Frequently Asked Questions
What payment methods should a Kenyan website accept?
M-Pesa first, because that is how most Kenyan customers pay. Safaricom reported 40.99 million one-month active M-Pesa customers in Kenya for the year ended 31 March 2026. Add card payments if you sell to the diaspora, to visitors or to companies paying on a corporate card, and keep bank transfer for large invoices.
What do I need before integrating M-Pesa?
A registered business, a Paybill or Till number or a Daraja merchant account from Safaricom, a website on HTTPS so the payment result can reach it securely, a checkout that creates an order before payment, and a real phone to test with.
Why should I never mark an order paid when the customer returns to my site?
Because a page load proves nothing. Browsers close, networks drop and URLs get typed by hand. The only trustworthy signal is the callback from Safaricom or the gateway, verified against the provider's own record before the order is marked paid.
A customer paid but my site still shows unpaid. What went wrong?
Almost always the callback never reached your site. A security plugin, a firewall rule, maintenance mode or a plain HTTP address can block the provider's request. Test the callback URL from outside your own network and allow those requests through.
How much does payment integration cost?
Our M-Pesa integration is KES 5,000 one-time, all-inclusive, covering STK Push, Paybill and Till confirmations, B2C payouts, reconciliation, Daraja registration with Safaricom, live test transactions and support. Safaricom's own transaction charges and any gateway's merchant rate are separate and set by them.
Are M-Pesa confirmation screenshots acceptable proof of payment?
No. Forged confirmation messages are a known trick. An integrated checkout does not rely on anything the customer sends you: it waits for Safaricom to confirm the payment directly to your system.
Get paid without the evening reconciliation
Tell us what your site runs on and how customers pay you today. We will wire M-Pesa in properly for KES 5,000, add cards if you need them, and test with real money before a single customer sees it. Talk to us on WhatsApp at +254 722 334 188, email hello@wpfoss.ke, or call +254 709 384 200.
Add M-Pesa to Your SiteRelated: E-commerce Websites · Safaricom Daraja · Pesapal · Flutterwave