The customer has paid, the phone shows a confirmation message, and your website still says the order is pending. Your sales team checks a screenshot, the developer checks a log, and dispatch waits for someone to decide whether the money arrived. That is the payment problem your integration needs to solve.
For a Kenyan business, adding M-PESA to a website should connect checkout, confirmed payment, order processing and the accounts team. A payment button is only the visible part. Before choosing direct Daraja integration or a payment gateway, decide who will keep those parts working when a customer loses connectivity or a notification arrives late.
This guide offers a practical selection framework for business owners and project teams. The recommendations are an implementation checklist, not a claim that one provider suits every merchant. Confirm your account eligibility, supported products and commercial terms directly with the chosen provider before signing off the build.
Start with the payment journey your business needs
Write down what the customer is buying and when you need payment. A retailer collecting the full price before dispatch has different requirements from a consultancy taking deposits against quotations. A training provider may need to connect several payments to a single enrolment. A wholesaler may need finance approval before releasing an order.
Map one ordinary purchase from the product page to the receipt. Then map a payment that needs help. Include the people who handle customer enquiries, fulfil orders and reconcile receipts. If the only person who understands the second journey is the developer, your requirements are incomplete.
Use these questions in the first project meeting:
- What identifies the order, invoice or booking before the payment starts?
- Can someone pay using a different phone from the one used to place the order?
- Is payment collected in full, in instalments or as a deposit?
- When should stock be reserved, and when should that reservation expire?
- Which employee can investigate a disputed payment without accessing developer credentials?
- What should customers see while the payment outcome is still unknown?
Record the answers in the same brief as your e-commerce website requirements. Payment handling affects order states, customer messages and administration screens, so it should be designed before the checkout is approved.
What direct Daraja integration means
Safaricom describes Daraja 3.0 as its platform for accessing Safaricom and M-PESA APIs for web and mobile integrations. A direct integration connects your application to the relevant APIs, with your team responsible for the surrounding website logic.
That responsibility includes creating payment attempts, matching responses to orders, showing accurate status messages and maintaining the integration. Access to an API does not automatically supply a complete shop, customer support process or reconciliation screen.
Direct integration is worth evaluating when your payment journey needs behaviour that a standard checkout cannot support cleanly. Examples might include a custom booking workflow, separate approval steps or integration with an existing internal order system. These are reasons to investigate the option, not proof that custom development will be cheaper.
Ask the developer to demonstrate how the business will operate the integration after handover. Can a staff member locate an order using its reference? Can finance distinguish a successful payment from a request that was merely submitted? Can another developer maintain the code if the original supplier becomes unavailable?
What a payment gateway changes
A gateway can provide a payment collection layer between your website and payment methods. The exact arrangement varies by provider and merchant account. Establish which parts are hosted, which are installed on your site and which remain your responsibility.
For example, Pesapal’s order-request documentation describes a flow that returns a payment URL and later directs the customer to a callback URL. Your website still needs to connect the payment outcome to the correct order. A successful request to start checkout is not evidence that the customer has completed payment.
A gateway can be a sensible starting point when your requirements fit its supported flow and your team wants to avoid maintaining every payment interaction itself. However, confirm the available payment methods, merchant onboarding, settlement arrangements and support boundaries for your particular account.
Request a demonstration using your actual platform and order model. A polished demonstration on a provider’s own test page does not show whether your shipping rules, deposits, customer notifications or refunds will work as required.
Compare ownership before comparing features
Use this table as a discussion guide when reviewing proposals. The questions deliberately focus on operational ownership rather than assuming that either route includes every feature.
| Decision area | Direct integration question | Gateway question |
|---|---|---|
| Checkout control | Which custom steps will the developer build and maintain? | Which steps can the supported checkout actually accommodate? |
| Payment status | How will the application confirm and reconcile outcomes? | How will provider notifications update your own orders? |
| Merchant account | Which approved account and API products are required? | Who contracts with the merchant and controls settlement? |
| Ongoing support | Who investigates application and API failures? | Where does provider support end and website support begin? |
| Exit plan | Can another developer operate the integration? | Can order and payment records be exported in useful form? |
Give each requirement an owner and ask suppliers to mark it as included, excluded or dependent on approval. This makes a proposal easier to compare than a long feature list in which every item is described as seamless.
Confirm the merchant setup before development
Ask Safaricom or the gateway which merchant arrangement supports the intended flow. Do not assume that having a Till or PayBill means that every API product is already enabled for it. Have the provider confirm account ownership, required approvals and how production access is obtained.
The business should retain control of its merchant relationship. Agree who administers the account, receives operational notices and authorises changes. A developer may need delegated technical access, but the owner should be able to recover control and change suppliers without rebuilding the business’s payment identity.
Keep a short onboarding register: business owner, merchant identifier, approved products, technical contact, settlement contact and outstanding requirements. Store secrets separately in an appropriate credential system. The register should say where access is managed without exposing passwords or API keys.
Also confirm how receipts, transaction references and settlement reports will appear. Ask your accounts team to review a sample export before accepting the design. A payment flow that looks excellent to customers can still create repetitive manual work if its reports cannot be matched to invoices.
Design STK Push as an asynchronous payment
In an STK Push flow, the customer responds to a payment prompt on their phone. Design your website around separate stages: a request being accepted for processing and a transaction reaching a confirmed outcome. Review the selected product’s current request and callback requirements in Safaricom’s Daraja documentation before implementation. Your application should preserve those distinct states and retain the identifiers needed to investigate each payment attempt.
Create an internal payment-attempt record before contacting the provider. Link it to the order and record the expected amount and currency. Keep the provider’s identifiers alongside your own reference so that a later response can be matched without relying on a customer’s browser session.
Use clear customer language while waiting: “We are checking your payment. Keep this order reference if you need help.” If the outcome is uncertain, avoid a message that tells the customer the payment definitely failed. That message can encourage another payment before the first has been reconciled.
Define what happens when the customer closes the page, the prompt is cancelled or the response is delayed. Keep fulfilment dependent on a verified payment state. Your support team should see the same state as the order system, together with enough context to investigate an exception.
Verify payment on the server before releasing value
Do not approve an order merely because a browser reaches a thank-you page or a customer provides a screenshot. Build the release decision around the provider’s supported verification process and the expected order details.
Pesapal’s transaction-status documentation provides a concrete example: the server retrieves the payment outcome using the order tracking identifier. Its response distinguishes completed, failed, invalid and reversed transactions. Your application must interpret the payment status, not just whether the HTTP request succeeded.
For whichever route you choose, ask the developer to show where the application checks the reference, amount, currency and final outcome. A successful payment should satisfy the order’s rules. Partial payments, excess payments and unexpected references need an explicit handling path rather than a catch-all “paid” label.
Make processing repeat-safe. If the same payment notification is handled twice, it should not dispatch two parcels or issue two tickets. Keep a record of the transaction already applied, and make fulfilment changes conditional on the current order state. Test this behaviour before the site takes live orders.
Plan for notifications that arrive without the customer
The customer-facing return page and a server notification serve different purposes. The former explains what happened to a person; the latter helps your system learn about a payment even when that person has left.
Pesapal’s IPN guidance explicitly covers cases such as disconnection or closing the application. It requires the notification endpoint to be registered and reachable. For other providers, follow their own notification, authentication and acknowledgement requirements rather than copying another service’s configuration.
Ask your hosting team to test the production notification route through the actual firewall and security configuration. A route that works on a developer’s laptop may be blocked, redirected or cached on the live site. Monitoring should make a delivery problem visible before customers start calling.
Maintain an exception list for payment attempts whose outcome remains unresolved. Assign a staff member to review it at an agreed interval and give that person a documented escalation route. The system needs a recovery process even if most payments complete without attention.
Choose a platform implementation you can maintain
For a WooCommerce project, assess the particular payment extension against the site’s checkout configuration, order handling and update process. Ask who maintains it, what its documentation covers and how problems are reproduced in a staging environment. A plugin being installable does not establish that it meets your acceptance criteria.
For Shopify or another hosted commerce platform, confirm the payment options available to your Kenyan merchant account through the platform and provider. Get written confirmation of support for your required flow before paying for custom work. Do not assume an integration described for a standalone website can be inserted into every hosted checkout.
For a custom application, require documentation of payment states, identifiers, verification steps and recovery procedures. Keep the integration behind a clear internal interface so that payment-specific code is not scattered across product pages, delivery scripts and customer emails.
If your checkout needs a broader rebuild, discuss the payment workflow alongside custom website development. Scope the administration tools as carefully as the customer-facing screens.
Protect access and keep payment data out of marketing tools
Keep secret credentials on the server and limit access to the people and services that need them. Separate test and production configuration, and document how credentials are replaced when a team member or supplier changes. Never ask customers to type an M-PESA PIN into an ordinary website form.
Review logs before launch. They should help diagnose a failed payment without unnecessarily exposing customer details or authentication data. Set access and retention rules for transaction records, and include privacy responsibilities in the implementation brief.
Keep analytics separate from operational proof of payment. Marketing tools can measure checkout steps, but finance and fulfilment should use the authoritative order and transaction records. Do not send phone numbers, raw payment messages or sensitive references to advertising platforms as event labels.
Test the situations your support team will face
Create a shared acceptance checklist and record the expected result before running each case. Include at least these scenarios:
- A successful payment updates one order and triggers the correct confirmation.
- The customer cancels the prompt and receives a clear next step.
- The browser closes before confirmation, but the order can still be reconciled.
- A delayed response leaves the order pending rather than falsely failed.
- A repeated notification does not repeat fulfilment.
- An unexpected amount or reference reaches an exception queue.
- A refund or reversal follows the agreed business process.
- Support can find the payment using the customer’s order reference.
Test on the devices and connections your customers actually use. Include a small-screen Android phone and a slower connection, and ask someone outside the development team to complete the journey. Check whether they understand which phone receives the prompt and what to do if it does not arrive.
Compare the total operating cost
Request current written terms rather than relying on a developer’s remembered fee or an old comparison article. Separate provider charges from implementation, hosting, monitoring, maintenance and support. Ask what happens commercially when a transaction is refunded, reversed or disputed.
Then estimate the staff effort each option requires. Who checks exceptions each morning? Who reconciles settlements? How often will a developer be needed to retrieve information? A lower headline charge can be outweighed by an integration that demands frequent manual investigation.
Use the same transaction assumptions when comparing proposals, and label them as your planning assumptions. Avoid treating a speculative sales forecast as a guaranteed saving from direct integration.
Make the decision with a working demonstration
Choose the route that meets your payment journey and has credible ownership after launch. Direct Daraja integration deserves consideration when control and custom workflows justify the maintenance commitment. A gateway deserves consideration when its supported flow meets your needs and its operating terms suit the business.
Before approval, request a demonstration covering a successful payment, an interrupted payment and an exception that finance can investigate. Ask for the handover documents, account responsibilities and support arrangements at the same time.
Dot Digital Agency can help translate those requirements into an e-commerce website implementation plan. Bring your platform details, proposed merchant setup and a sample order journey so the discussion starts with how your business collects and confirms payment.







