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
129 stars 128 forks source link

Callback URL Error #40

Closed ochom closed 4 years ago

ochom commented 4 years ago

Hi everyone, So am trying to make an STK push in adnroid app using java and I get the following error:

{
"requestId":"19072-295731-1",
 "errorCode": "400.002.02",
 "errorMessage": "Bad Request - Invalid CallBackURL"
}

when I call

LNMExpress lnmExpress = new LNMExpress(...credentials including callbackurl)

my callback url looks like: https:my_app.herokuapp.com/api/mpesa_response/

this url works fine and I've tested it with Postman. It accepts both POST and GET

I'll appreciate If anyone can help me.

ochom commented 4 years ago

I figured out that there were some funny spaces in my callback url and everything works perfect now