agentleFS
BuilderCedBuilderCed/agent-skills/skills/africa/africa-mobile-money/SKILL.md

africa-mobile-money

Skill2 starsChanged 8 months agoMITView on GitHub

Integrate M-Pesa, Orange Money, Wave, and MTN MoMo payment APIs with proper error handling, reconciliation, and multi-operator patterns.

The file

We split this skill into the rules it gives an agent

7 rules. About 0 are common, 6 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use a unique transaction ID per request

    line 73
  2. Distinctive:

    Check if transaction already processed before updating state

    line 74
  3. Distinctive:

    Never assume failure on timeout — always check status API

    line 82
  4. Distinctive:

    Does not handle operator onboarding/KYC (business process)

    line 111
  5. Distinctive:

    Does not manage currency conversion (use forex APIs)

    line 112
  6. Very specific:

    Does not implement USSD menus (see africa-ussd-development)

    line 113
  7. Distinctive:

    Does not handle regulatory compliance per country (varies widely)

    line 114

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Africa Mobile Money Integration

DISCLAIMER: This skill provides integration patterns only. It does not constitute financial advice. Payment processing is regulated — verify compliance with local financial authorities in each market.

When to Use

  • Accepting payments from African mobile money users
  • Building multi-operator payment flows
  • Implementing reconciliation for mobile money transactions
  • Designing payment UX for feature phones (USSD) and smartphones

Supported Operators

OperatorMarketsAPIAuth
M-Pesa (Safaricom)Kenya, Tanzania, DRC, MozambiqueDaraja 2.0OAuth2
Orange MoneySenegal, Mali, Cote d'Ivoire, Cameroon, 10+OMAPIAPI Key
WaveSenegal, Cote d'Ivoire, Mali, UgandaRESTAPI Key
MTN MoMoGhana, Uganda, Rwanda, Cameroon, 10+Open APIOAuth2 + Subscription Key

Common Payment Flow

1. Customer initiates payment (app, USSD, or web)
2. Your server calls operator API (STK Push / Payment Request)
3. Customer receives prompt on phone → enters PIN
4. Operator processes → sends callback to your server
5. Your server verifies callback signature
6. Update order status + send confirmation

Key Patterns

Multi-Operator Detection

Detect operator from phone number prefix:

Kenya:
  07XX, 01XX → Safaricom (M-Pesa)
  0720-0729  → Safaricom
  0733-0739  → Safaricom

Senegal:
  77X → Orange Money
  78X → Wave
  76X → Free Money

Idempotency

Mobile money callbacks can arrive multiple times. Always:

  • Use a unique transaction ID per request
  • Check if transaction already processed before updating state
  • Store callback raw payload for reconciliation

Timeout Handling

Mobile money transactions have long confirmation times:

  • M-Pesa STK Push: up to 60s for customer PIN entry
  • Orange Money: up to 120s
  • Design for: pending → success/failed/expired states
  • Never assume failure on timeout — always check status API

Reconciliation

Daily reconciliation is critical:

  1. Fetch transaction report from operator API (daily)
  2. Compare with your local records
  3. Flag mismatches: received but not recorded, recorded but not received
  4. Investigate and resolve within 24h

Error Handling

ErrorCauseAction
Insufficient balanceCustomer lacks fundsShow clear message, suggest lower amount
Wrong PINCustomer entered wrong PINAllow retry (max 3)
TimeoutCustomer didn't respondCheck status API, don't retry automatically
DuplicateSame transaction sent twiceReturn existing result (idempotent)
System unavailableOperator maintenanceQueue and retry with exponential backoff

Security

  • Never log full phone numbers (PII) — mask middle digits
  • Verify callback source — check IP whitelist or signature
  • Use HTTPS for all API calls
  • Store API keys in environment variables, never in code
  • Amount validation — server-side, never trust client

What This Skill Does NOT Do

  • Does not handle operator onboarding/KYC (business process)
  • Does not manage currency conversion (use forex APIs)
  • Does not implement USSD menus (see africa-ussd-development)
  • Does not handle regulatory compliance per country (varies widely)

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.