I am trying to integrate MPESA API into my android app using the procedures given by Daraja. On launching my application, the following error is displayed in my Logcat
D/OkHttp: {
"requestId": "16583-1090909-1",
"errorCode": "400.008.02",
D/OkHttp: "errorMessage": "Invalid grant type passed" }
and after entering a Phone number and amount to be sent, the Sim Toolkit is not being brought to the front. The following error is displayed in my Logcat
D/OkHttp: {
"requestId":"29178-5342114-1",
D/OkHttp: "errorCode": "404.001.04", "errorMessage": "Invalid Authentication Header" }
This was my expectation: On pressing the "Pay" button, I should be prompted to the sim toolkit requesting for my Mpesa pin to continue with the payment.
I will appreciate any assistance that will be offered.
I had the same problem. I realized I was performing the STK push before the auth token was received. You can use a global variable to check before performing STK push