Choose payment methods around your customers and operations, then choose an integration that supports them. A Kenyan product serving mainly M-Pesa users has a different starting point from a service that also needs card payments from customers abroad. In both cases, the important delivery is a verified, recoverable payment journey connected to the correct order.
I integrated M-Pesa Daraja and Pesapal in my TheCatfish work, alongside a Node.js backend and Flutter client. This guide is for clients planning a new checkout or donation feature. It covers the buying decisions and acceptance examples; the linked implementation guides explain the technical details. The sample booking scenario is illustrative rather than an actual client's transaction history.
Separate the payment method from the integration provider
M-Pesa is a payment method. Safaricom's Daraja developer platform provides APIs for integrating M-Pesa with web and mobile applications. A payment gateway is a different layer: it can make several methods available through its own integration and merchant relationship.
Pesapal's online payment offering describes support for M-Pesa and cards. That means the decision is not simply “M-Pesa or Pesapal.” You may be comparing direct M-Pesa integration with a gateway that can also offer M-Pesa, or considering separate integrations for different customer needs.
Confirm the methods, currencies and account capabilities available to your particular business with the provider. A method appearing in marketing material does not establish that it is enabled for your merchant account or suitable for every transaction your product wants to support.
Answer the customer questions first
Before comparing APIs, describe who is paying and what they are paying for. Are you collecting a donation, selling a service, taking a booking deposit or unlocking a digital feature? Does the customer need to finish immediately, or can staff confirm availability before payment?
Ask which methods customers already expect, whether they pay from Kenya or elsewhere, and what happens after payment. An app with a mostly local audience may start with a narrower method set. A service with overseas customers may need card acceptance, but you still need to verify the provider's merchant and currency arrangements before committing to the scope.
Also name the payer and recipient. Collecting money for your own business differs from moving money on behalf of several independent sellers. Marketplace settlement and payouts need a separate provider and operational discussion; ordinary checkout integration should not silently promise that capability.
Compare the delivery scope
This table is a planning framework, not a provider pricing comparison or a guarantee about a particular merchant account.
| Question | Direct Daraja integration | Gateway integration such as Pesapal |
|---|---|---|
| Main starting point | A specific M-Pesa workflow your merchant setup supports | The supported methods enabled through your gateway account |
| Backend responsibility | Implement the relevant provider requests, confirmation and recovery path | Implement order creation, notification handling and provider status checks |
| Customer interface | Your app guides the supported prompt or payment journey | Your app connects the provider-supported checkout and return journey |
| Operational review | Merchant references, payment evidence and reconciliation | Gateway references, method details, payment evidence and reconciliation |
| Commercial questions | Confirm current account requirements and charges with the provider | Confirm current methods, settlement arrangements and charges with the provider |
One integration is not automatically cheaper to build or operate. Existing backend work, account readiness, recovery requirements and the supported methods affect the comparison. Ask for an estimate against the same acceptance journey so you can see what each option includes.
Confirm account readiness before scheduling the release
Identify the person who owns the merchant account and can complete provider onboarding. Establish whether the credentials and enabled services are for a test environment or live processing. Record the required callback hosting and who can configure it.
Keep provider approval separate from implementation progress. A developer can prepare an integration and demonstrate agreed test cases while a merchant setup is still incomplete. That does not make the live service available. Name the remaining dependency and who is responsible for resolving it.
Ask the provider directly about current transaction charges, settlement timing, refund handling and method availability. Those details can vary by account and change over time. The development proposal should distinguish implementation cost from recurring provider and hosting costs without inventing a universal rate.
A worked booking example
Imagine a workshop that wants customers to pay a deposit after staff confirm a booking slot. The first decision is when payment becomes available. Taking money before confirming availability creates a different cancellation and support workflow from requesting payment after approval.
An illustrative first journey could be:
- A customer submits a booking request and receives its reference.
- Staff confirm the slot and the amount the customer should pay.
- The customer opens the payment action for that specific booking.
- The backend creates or reuses the appropriate payment attempt.
- The provider processes the chosen method and the backend verifies the result.
- The app displays the current booking and payment state, including an uncertain result.
- Staff can investigate the attempt using references without asking for private credentials.
Separate the booking's business status from the payment attempt's status. A confirmed slot can still have an unpaid deposit. A paid deposit does not necessarily mean the service has been completed. Avoid forcing every product decision into a single “success” field.
Make verification part of the scope
Opening a checkout, receiving an initiation response or returning to a success page is not enough to grant value. The backend needs to establish the provider result, connect it to the correct order and check the expected amount and currency where applicable before applying the agreed transition.
For Pesapal API 3.0, the IPN registration documentation describes server notifications, including cases where a customer closes the browser or loses their connection. Its transaction status documentation explains checking the payment using the provider's tracking reference. The return screen and server notification therefore have related but distinct responsibilities.
For a direct Daraja implementation, confirm the appropriate confirmation and verification workflow for the API and merchant setup in use. My Node.js M-Pesa guide walks through STK Push integration, while the Pesapal implementation guide covers that provider's flow. A client brief should require the verification behaviour without prescribing an unreviewed code snippet.
Decide what happens when the result is uncertain
The customer can lose their connection after the provider accepts a request. A confirmation can arrive later than the interface expects. A notification can be repeated. These cases should produce a defined recovery path rather than an automatic second payment attempt.
For the workshop example, the app might show that the deposit is still being checked, retain the existing reference and allow the customer to reopen its status. The backend should handle repeated provider notifications without applying the booking transition twice. An interrupted result needs investigation or reconciliation according to the provider-supported workflow.
Agree what the support team sees and what they may do. A useful dashboard can show the order, relevant payment references and verified state. Giving all staff an unrestricted “mark paid” action is not a substitute for resolving missing provider evidence. See planning an admin dashboard for role and workflow requirements.
Scope the mobile client and backend separately
If a backend team already owns initiation and verification, a Flutter engagement can focus on checkout screens, status display and returning to an existing attempt. It still needs a documented API, test accounts and clear error responses.
If there is no payment backend, include order data, server-side provider access, notification handling and operational checks explicitly in the proposal. Provider secrets belong in the appropriate server environment, not in a distributable mobile app or a public repository.
The Flutter API integration brief helps record that boundary. My payment integration service can cover a mobile connection to an existing backend or a separately agreed backend implementation. The estimate should state which responsibility it covers.
Use acceptance examples that include recovery
Before the release, agree on suitable test cases for the chosen provider and environment. Include the important business outcomes, not just a successful prompt.
- A valid attempt completes and updates only its intended order.
- A cancelled or unsuccessful attempt leaves the order in the correct state.
- A delayed confirmation can be recovered after the customer reopens the app.
- Repeated notifications do not grant the purchased value more than once.
- A mismatch between the expected and verified payment is held for the agreed review.
- A customer cannot inspect another customer's order by changing a reference.
- Staff can trace a disputed attempt through appropriate references and logs.
- Refund or reversal handling follows the agreed provider and product process.
Test-environment success does not establish that live credentials, network configuration or merchant methods are ready. Plan a controlled live verification with the authorised account owner and record its scope separately from the sandbox checks. Do not use real customer transactions as casual test fixtures.
A sample integration brief
We operate a booking service in Kenya and need deposits connected to confirmed bookings. We want to evaluate M-Pesa first and card payments if our merchant account supports the required customer and currency needs. Our existing Node.js backend owns bookings, but payment initiation and verification still need work. Please propose a milestone covering one booking from payment attempt to a verified result, including cancellation, delayed confirmation and reopening an uncertain attempt. List merchant-account dependencies, provider costs we must confirm, support responsibilities and exclusions. Seller payouts and subscriptions are outside this release.
This gives you a basis for discussing both implementation and operation. If you need help defining or building that journey, share your payment brief. We can scope the backend, mobile integration and review evidence before treating checkout as complete.



