Developer Documents 8 Undisclosed M-Pesa STK Push Behaviors That Can Break Payment Systems
A developer building an open-source mobile money gateway conducted systematic tests on Safaricom's Daraja STK Push API between September 18–23, 2025, using the sandbox environment. A critical finding reveals that the API password is merely Base64-encoded — not hashed — meaning anyone who accesses a request body, debug log, or APM trace can recover the passkey, and no documented revocation endpoint exists. Error code 500.001.1001, widely interpreted as 'transaction does not exist,' was observed returning unreliably even for confirmed live transactions, making it an unsafe basis for payment status decisions. The AccountReference field chosen by the caller is neither idempotency-safe nor echoed back in the response, meaning duplicate submissions can generate two separate payment prompts for a single order. The developer recommends treating request bodies as secret-bearing, building idempotency into the caller's own system, and treating ambiguous error codes as 'unknown — retry later' rather than definitive failures.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in