safaricom / LNMOnlineAndroidSample

Lipa Na MPESA Online (STK Push) Android Sample Application. This app demonstrates an e-commerce purchase and checkout process via Mpesa and Daraja :smile:
https://developer.safaricom.co.ke/
Apache License 2.0
128 stars 129 forks source link

Mpesa Express STK Push Error #38

Open basiljereh opened 4 years ago

basiljereh commented 4 years ago

Hi Guys, Please assist try resolve the below issue and error am facing on my Android App when implementing the STK Push onto it. Getting below error see logs:

D/OkHttp: --> POST https://sandbox.safaricom.co.ke/mpesa/stkpush/v1/processrequest D/OkHttp: Content-Type: application/json; charset=UTF-8 D/OkHttp: Content-Length: 432 D/OkHttp: {"AccountReference":"test","Amount":"100","BusinessShortCode":"174379","CallBackURL":"https://peternjeru.co.ke/safdaraja/api/callback.php","PartyA":"254718908314","PartyB":"174379","Password":"MTc0Mzc5YmZiMjc5ZjlhYTliZGJjZjE1OGU5N2RkNzFhNDY3Y2QyZTBjODkzMDU5YjEwZjc4ZTZiNzJhZGExZWQyYzkxOTIwMjAwMTEzMTcwMzA1","PhoneNumber":"254718908314","Timestamp":"20200113170305","TransactionDesc":"test","TransactionType":"CustomerPayBillOnline"} D/OkHttp: --> END POST (432-byte body) D/OkHttp: <-- 400 Bad Request https://sandbox.safaricom.co.ke/mpesa/stkpush/v1/processrequest (1047ms)

basiljereh commented 4 years ago

Am able to get the Access Token but when initiating the STKPush method on the app it throws back BAD REQUEST