</>CodeWithKarani
All topics
Topic

Payments & Fintech

M-Pesa/Daraja, cards and reconciliation - the callbacks that never arrive, the error codes nobody documents, and handling money correctly.

Sub-topics

32 articles · showing 1-9 (page 1 of 4)

Mobile Engineering14 min read

Your spare Android phone is a payment gateway: an offline-first SMS relay for M-Pesa

M-Pesa till confirmations arrive as an SMS, and Daraja is not open to every merchant. So we turned a spare Android phone into a self-hosted SMS-to-HTTP gateway: encrypted on-device, HMAC-signed on the wire, and built so that it never loses a message.

Read
Software Design11 min read

A payment source, not a payment parser: what keeping the pipe dumb actually buys

The SMS gateway could have extracted the M-Pesa transaction code on the phone. It deliberately does not. Here is what that bought, what it cost, and the boundary question every integration eventually has to answer: where does meaning belong?

Read
Payments & Fintech7 min read

Daraja API in Production: STK Push, C2B and B2C With Callbacks That Actually Work

A build-order guide to Safaricom's Daraja API with real payloads: OAuth token caching, STK Push, C2B v2 registration, B2C v3 with RSA security credentials, and the callback URL rules nobody documents.

Read
Upeosoft7 min read

POS System Kenya: Why UpeoRetail Fits How Shops Really Sell

Looking for a POS system in Kenya that survives real trade? UpeoRetail gives shops, minimarts and distributors fast checkout, honest stock, multi-branch visibility and M-Pesa payments on a hardened ERPNext backbone.

Read
Payments & Fintech7 min read

Your M-Pesa Callback Will Fire Twice: Idempotency, Retries and the 1037 Problem

Daraja callbacks are unreliable notifications, not a source of truth. Seven production failure modes, with the database constraints, pollers and parsers that make double charges structurally impossible.

Read
Upeosoft6 min read

Property Management Software Kenya: ISHI for Landlords

ISHI is a rent management system for Kenyan landlords, agents and property managers: automated invoicing, M-Pesa allocation, water billing with a field agent portal, tenant self-service and arrears dashboards.

Read
Payments & Fintech6 min read

M-Pesa Reconciliation That Scales: From Paybill Statement to Trial Balance

Stop reconciling in spreadsheets. A three-way match between the Safaricom statement, your callback events and a double-entry ledger, with named break categories and a daily close job in Python and SQL.

Read
Upeosoft6 min read

Enterprise Integrations: Connecting M-Pesa and APIs to Your ERP

M-Pesa callbacks, payment matching, e-commerce sync and eTIMS. The patterns that survive production - idempotency, queues, raw payload logs and reconciliation - and the ones that create duplicate receipts.

Read
Payments & Fintech7 min read

Build a Payments Port, Not a Daraja Wrapper: Provider-Agnostic Money Movement in Africa

The right payments abstraction is a normalised state machine plus a normalised event, not a charge() function. Ports, adapters, webhook signature handling, minor-unit traps and config-driven routing.

Read
Payments & Fintech - Guides, Sub-topics & Fixes · Code With Karani