⚡ Built by an African developer

Stop Losing 3 Days to Mobile Money Integration

A production MTN Mobile Money integration for Next.js and Expo. Retry, idempotency, webhooks and error handling already solved. Your first payment in 30 minutes.

Verified against the live MTN API. 80 tests included.

momo.ts
// One call. Async. Typed.
const payment = await momo.requestPayment({
amount: 5000,
currency: 'RWF',
externalId: orderId,
payer: { partyId: phoneNumber },
});
 
const status = await momo.checkStatus(
payment.referenceId
);
 
// status.status === "SUCCESSFUL"
TypeScript · strict30 min setup

THE REALITY

You know this feeling.

  1. 1
    Day 1😤

    You read the MoMo docs

    Sandbox credentials, OAuth tokens, callback URLs... the documentation is 200 pages of pain.

  2. 2
    Day 2🤯

    You fight the API

    400 errors, signature mismatches, timeout handling, webhook validation. Stack Overflow has no answers.

  3. 3
    Day 3😤

    You finally get it working

    But now you have to do it again for the next project. And the next. And the one after that.

There's a better way.

What You Get

Everything wired. Nothing to figure out.

momo-payment.ts
// Initialize payment
const payment = await momoClient.requestPayment({
amount: 5000,
currency: 'RWF',
externalId: orderId,
payerMessage: 'Order payment',
payeeNote: 'AfriStack order',
payer: {
partyIdType: 'MSISDN',
partyId: phoneNumber
}
});
 
// Check status
const status = await momoClient.getPaymentStatus(
payment.referenceId
);
  • MTN MoMo: request payment, read status, verified webhooks
  • Idempotency keys — a retry never charges twice
  • Exponential backoff with jitter on transient failures
  • Timeouts on every call, because gateways hang rather than refuse
  • 15 normalized error codes, with MTN’s own code preserved
  • Phone normalization for every format a payer might type
  • Webhooks re-read the real status — a forged callback is worthless
  • Runs with or without a database
  • Vercel-ready. 80 tests included.

PRICING

One purchase. No subscription.

Pay once, own the source forever.

MTN MoMo Starter Kit

$29

One-time payment

Get the kit →
  • MTN MoMo: request payment, read status, verified webhooks
  • Runnable Next.js app — npm install, npm run dev, take a payment
  • React Native / Expo payment screen
  • Retry with backoff, timeouts, and idempotency keys done right
  • 15 normalized error codes, with MTN’s own code preserved
  • Phone normalization for every format a payer might type
  • Optional Supabase ledger + dashboard, or run with no database
  • Credential setup and end-to-end verification scripts
  • 80 automated tests included

Full source code. No package to install, no black box, no lock-in.

Not included: Airtel Money, multi-country routing, and Flutterwave. Those are in development — this kit is MTN Mobile Money, done properly.

Verifiable, not claimed

No testimonials yet — this just shipped. Here is what you can check yourself in three minutes.

80

Automated tests

Phone normalization, retry behaviour, error mapping, idempotency.

4

Live API checks

One command proves your credentials, a real payment and its status.

0

Runtime dependencies

The core imports nothing. It runs unchanged in Next.js and Expo.

npm run verify:momo
PASS  Environment variables present and well formed
PASS  Authenticated (token valid 3600s)
PASS  Payment accepted — 1 EUR to 46733123450
PASS  Status readable
PASS  Reference reconciles with what MTN recorded

FAQ

Common questions

It ships configured for sandbox and is verified against the live MTN sandbox API, so you can take a test payment in minutes. Production needs two things: three environment variables, and production credentials that MTN Rwanda issues after approving your application — that approval is between you and MTN, and it takes time, so start it early. The code path is identical; only the base URL, environment and currency change. Be aware the MTN sandbox sometimes returns INTERNAL_PROCESSING_ERROR on an otherwise correct call. That is a known portal defect, and the included verify script says so explicitly instead of letting you hunt for a bug you do not have.

MTN Mobile Money only, and that is deliberate — it is the one I can prove works end to end. The phone normalization and operator detection already cover Rwandan Airtel prefixes, and an Airtel adapter is written but not yet verified against a live account, so it is not in this kit. Buyers get it free when it ships.

Yes — you need to register on the MTN MoMo Developer Portal and create a sandbox/production app. The README has a step-by-step guide with screenshots. It takes about 20 minutes.

You get updates for 12 months, including any breaking change MTN introduces. Run the included verify script after an update and it tells you in four checks whether anything moved.

Yes. The integration is modular — copy the /packages folder and the .env variables into your existing project, then add two tsconfig path aliases. The README explains the manual setup path.

Yes. Single-developer license: use on unlimited projects you build. You cannot resell or redistribute the template itself.

Email included with purchase. If something is broken in the template code (not your custom code), I fix it.

Gumroad accepts all major credit/debit cards, PayPal, and select regional payment methods.

Stop rewriting this.

The MoMo integration you were about to build, already built and already tested.

Get the kit — $29 →

One-time payment · Instant download · Full source code