To test mobile money payments in Uganda: (1) set up sandbox credentials on the MoMo Developer Portal and Airtel Money developer program, (2) test the happy path (successful payment), (3) test failure scenarios (insufficient balance, timeout, wrong PIN), (4) test your callback handler with delayed and duplicate callbacks, (5) verify your error handling and user-facing messages for each scenario. Never skip sandbox testing. The sandbox is free, simulates the full payment flow, and prevents embarrassing (and expensive) bugs in production.
Both MTN MoMo and Airtel Money provide sandbox environments for developers. These sandboxes simulate the real payment flow without processing actual transactions or moving real money.
Airtel Money's developer program provides sandbox credentials through their own portal. The process varies and may require contacting their developer support team.
For both providers, you need a publicly accessible URL to receive callbacks during development:
npm install -g ngrok or download from ngrok.comngrok http 3000Note: the free ngrok URL changes every time you restart ngrok. If you are using a callback URL registered on the developer portal (not per-request), update it each time.
Most developers test the happy path and call it done. In production, the unhappy paths are where all the bugs hide. Here is the complete list of scenarios to test:
Get weekly developer tips
Join 25,000+ developers. Practical guides, job tips, and new content — straight to your inbox.
No spam. Unsubscribe anytime.
The MoMo sandbox is designed primarily for testing the happy path. Simulating failures requires some creativity:
Send a payment request but do not poll for the result immediately. Wait beyond your timeout period and verify your timeout logic triggers. Since the sandbox auto-approves, the callback will arrive as SUCCESSFUL, but your timeout logic should still work correctly (the frontend should have already shown the timeout message before the callback arrives).
Stop your callback server after sending a payment request. The callback will fail to deliver. Verify that your polling mechanism picks up the payment result from the status endpoint.
Manually send a duplicate callback to your callback endpoint (using curl or Postman with the same payload as a real callback). Verify that your handler processes it idempotently.
Send a payment request with a malformed phone number. Verify that the API returns an appropriate error and your app displays a useful message.
If you are using Flutterwave, EasyPay, or another aggregator, their sandboxes may offer richer failure simulation. Some aggregators provide test phone numbers that trigger specific failure scenarios (insufficient balance, declined, timeout). Check your aggregator's documentation for test numbers.
The sandbox is not identical to production. Be aware of these differences:
Plan for a "soft launch" phase where you test in production with a small group of real users and small transaction amounts before opening to your full audience.
The transition checklist:
For a detailed production deployment guide, McTaba's Deployment and Going Live course (KES 4,999, approximately UGX 140,000) covers the full production checklist including environment management, monitoring, and rollback strategies.
Create a free McTaba Academy account. Access starter lessons, join the community, and explore at your own pace.
Create Free Account