Ansai Technologies - M-Pesa integration test harness (sandbox)
/api/push?phone=254798435456&amount=1
Sends a sandbox STK push prompt to the phone. Open as a link or call it from your test app: /api/push?phone=254798435456&amount=1
/api/status?checkoutId=...
Queries the result of a push (ResultCode 0 means success). Pass the CheckoutRequestID returned by the push as checkoutId.
/api/callback
The callback URL Safaricom calls with the outcome. Configure this URL in your Daraja app or STK push request to receive sandbox results.
DARAJA_CONSUMER_KEY, DARAJA_CONSUMER_SECRET and DARAJA_PASSKEY from that app./api/push to receive a test prompt on the phone.'not configured' JSON message. Add the three variables above and redeploy to activate live sandbox calls.