payments
M-PESA, live.
Push → PIN → receipt.
This is the real thing — a production Safaricom Daraja till wired exactly the way I build it for clients: STK push to your phone, instant callback confirmation, and a WhatsApp receipt when it lands. Use it to support the site, or just to see the flow work end-to-end.
send_payment()
Enter your number. Get the prompt.
- 1STK pushserver → Safaricom Daraja API
- 2PIN entryprompt lands on your phone — enter M-PESA PIN
- 3CallbackSafaricom confirms → receipt issued
- 4Donereceipt shown here + WhatsApp confirmation
// every result is a real Daraja ResultCode —
success, cancelled, wrong PIN, insufficient funds, timeout — handled, labeled, and logged to the admin dashboard.
under the hood
What just happened, in 4 hops.
STK Push
Your number and amount hit Safaricom's Daraja API over a signed request — the phone buzzes with a payment prompt.
PIN on-device
You enter your M-PESA PIN on your own phone. It never touches this server — that's the whole security model.
Callback
Safaricom posts the result to a webhook here — idempotent, deduplicated, matched to your transaction id.
Receipt + WhatsApp
The receipt number lands on screen and a formatted WhatsApp confirmation lands on your phone via my WotSap API.
edge_cases
Every M-PESA outcome, handled.
The same result-code map I ship to clients — no mystery failures, no silent drops. If the callback stalls, the system queries Daraja directly.
// want this on your own platform? see the integration service →
Payments are infrastructure.
Build them properly.
STK Push, C2B, B2C, reconciliation and every failure mode — shipped the same way you just used it.