mpesa-android-sdk icon indicating copy to clipboard operation
mpesa-android-sdk copied to clipboard

I cant click on pay button its grayed out like something is wrong or missing

Open adetheprince opened this issue 5 years ago • 8 comments

Please let me know if this code still works, looks like something I missed or i need to edit the credential for mpesa or sandbox?

adetheprince avatar Sep 24 '20 08:09 adetheprince

Well, simply enable it manually by going to activit_main.xml and make android:enabled="true" or just delete that line altogether. Now your button should be always enabled. Happy coding.😊😊😊

kgideon781 avatar Oct 19 '20 18:10 kgideon781

and what about invalid access token? I guess I need to add real account for mpesa now?

adetheprince avatar Nov 26 '20 17:11 adetheprince

@adetheprince no. I faced the same issue too I didn't do anything to fix it but somehow it fixed itself 😅

kgideon781 avatar Nov 26 '20 18:11 kgideon781

Well I am not sure how will this fix itself, lol. I have not changed any details and the link inside this project is a dead link ( very old ) eg: private String callBackURL = "https://mpesa.bdhobare.com/mpesa So I am sure something needs to be changed and I dont have any api account with M-Pesa. Do I have to register with any third party like sfari com etc to get this api? Can you please help how to get this credential for testing purpose? Many thanks for your help.

adetheprince avatar Nov 27 '20 08:11 adetheprince

Try this https://boiling-stream-31182.herokuapp.com. And consider cloning the repo by the author and deploy it on your server. Hope it helps

kgideon781 avatar Nov 27 '20 10:11 kgideon781

Many thanks for your help, the problem is I have not edited anywhere else so I am sure something is missing or I have not edited. Where do I need to edit or where can I get the needed keys or token?. Sorry, I am new to mpesa and android. Thanks.

adetheprince avatar Nov 30 '20 10:11 adetheprince

Hi again. The problem is I am in UK , I am not sure how can I test this from UK as we dont have M-Pesa. The test that comes with these codes didn't work for me due to wrong info like MPESA SDK, API, sanbox or Daraja etc needs to be filed with some info.eg

Mpesa mpesa = Mpesa( clientKey: "YOUR_CONSUMER_KEY_HERE", clientSecret: "YOUR_CONSUMER_SECRET_HERE", passKey: "YOUR_LNM_PASS_KEY_HERE", initiatorPassword: "YOUR_SECURITY_CREDENTIAL_HERE", environment: "sandbox", );

adetheprince avatar Dec 01 '20 13:12 adetheprince

Hi again. The problem is I am in UK , I am not sure how can I test this from UK as we dont have M-Pesa. The test that comes with these codes didn't work for me due to wrong info like MPESA SDK, API, sanbox or Daraja etc needs to be filed with some info.eg

Mpesa mpesa = Mpesa( clientKey: "YOUR_CONSUMER_KEY_HERE", clientSecret: "YOUR_CONSUMER_SECRET_HERE", passKey: "YOUR_LNM_PASS_KEY_HERE", initiatorPassword: "YOUR_SECURITY_CREDENTIAL_HERE", environment: "sandbox", );

Please get your keys from here: https://developer.safaricom.co.ke/ as stated in the README :)

bdhobare avatar Jul 09 '21 18:07 bdhobare