← All projects
(01)Personal2025–2026

M-Pesa Gateway

Payment infrastructure Kenya's developers actually deserve.

Year

2025–2026

Role

Lead developer

Status

Personal

The Challenge

Safaricom's Daraja API introduces friction through inconsistent documentation, unreliable callbacks, and limited developer tooling. Integrating M-Pesa often requires rebuilding the same infrastructure for every project.

The Solution

Designed a clean abstraction layer with consistent APIs, strong TypeScript support, and a reliable webhook system. Added a production-like test mode and a billing layer, turning a difficult integration into a reusable, developer-friendly platform.

Technical Highlights

01

STK Push, B2C payouts, and C2B collections unified under a single consistent API.

02

Dynamic and static QR code generation with configurable parameters.

03

Webhook delivery with HMAC-SHA256 signing and exponential backoff retry logic.

04

Subscription billing engine with plan management and usage tracking.

05

Admin dashboard for transaction monitoring and system configuration.

06

Multi-tenant architecture with a test mode that mirrors production behavior.

07

Idempotency handling and full audit logging across all transactions.