
Production-ready Python/Django starter kit for integrating M-Pesa Tanzania (Vodacom M-Pesa Open API). Skip weeks of trial-and-error with sparse documentation, session key encryption, and sandbox quirks — get payments working in hours, not weeks.
Extracted from a live SaaS product processing real M-Pesa callbacks — not a demo, not a tutorial repo.
What's inside:
✓ Framework-agnostic MpesaClient + ready-made Django app — model, callback view, signals, and migrations included, with no foreign-key coupling to your models. The core client also works with Flask, FastAPI, or plain Python scripts.
✓ Idempotent async callback handler — safe against M-Pesa's callback retries, with a success signal/hook so your business logic runs exactly once per payment.
✓ 62 passing tests, zero third-party SDK code — everything is readable, auditable Python you own. No black-box dependencies.
✓ 8 runnable examples — one-time payment, recurring billing, status polling, a Flask webhook server, and Celery tasks with retry.
✓ Docs that fill the gaps — portal credentials walkthrough, full configuration reference, live-verified error-code table, top-10 troubleshooting guide, and a deployment guide (Ubuntu VPS + Railway).
✓ Full Kiswahili quickstart — QUICKSTART_SW.md, the complete getting-started guide in Kiswahili.
Includes: 6 months of email support (Mon–Fri, 24–48h response) · 14-day money-back guarantee · Commercial license — use in unlimited client projects, redistribution not permitted.
Note: This kit is for M-Pesa Tanzania (Vodacom Open API). It is not for Safaricom Kenya / Daraja.