← Back
Interactive demoNo money involved

The M-Pesa checkout, step by step

This is the flow I build into client apps: the customer enters an amount, the prompt lands on the phone, the PIN is entered, the server confirms with the gateway, and the receipt is generated. Try it below. Nothing is charged.

What is happening

The demo copies the real sequence, including the part most developers skip: the money is only credited after the gateway confirms, never when the button is pressed.

  1. The app creates a pending record with the amount and the phone number.
  2. The server asks the payment gateway for a push. The gateway answers with a checkout id.
  3. The customer's phone shows the prompt and they enter their PIN.
  4. The server checks the gateway for that checkout id. Only a confirmed payment credits the wallet.
  5. A receipt is written with a reference, and it can go straight to WhatsApp.
Built for

Shops, saccos, riders and platforms that collect money on a phone. The same pattern covers payouts and refunds, with an approval step.

Want this in your product?

I wire it up on your own shortcode or gateway account.

Message me on WhatsApp
CHECKOUTDuka Ledger
KES 200
Paying into your wallet