Closed malcolmmaima closed 5 years ago
Hi @malcolmmaima
Are you testing it on Sandbox or Production?
Sandbox
Safaricom have massive issues with their sandbox servers, which is also happening frequently on production. Test using these credentials
I am now getting this error on any network request : javax.net.ssl.SSLHandshakeException: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found
This is coming from okhttp
I wonder if its the same problem?
It's actually the same issue. Am no expert but this is what I have come across
This is the cert from Safaricom
I guess its an issue with the Sandbox SSL cert setup on Safaricom side.
Reference here : https://stackoverflow.com/questions/6825226/trust-anchor-not-found-for-android-ssl-connection
Yeah, it just stopped working all of a sudden, and I knew I hadn't touched any of the network classes. I am on break for the rest of the week, so I can take a look at it tomorrow.
EDIT Could we just raise this issue with Safaricom?
See this PR #27
Yeah, it just stopped working all of a sudden, and I knew I hadn't touched any of the network classes. I am on break for the rest of the week, so I can take a look at it tomorrow.
EDIT Could we just raise this issue with Safaricom?
I can talk to someone about this, and advice. Meanwhile, let me review and merge the PR #27
This has been sorted by PR #27
It's already merged into master. The next release should fix this issue. Good work @gilokimu. We might need to do a small patch to fix issues currently being experienced as we continue working on other issues.
To test current state on master and do a release
I setup all the credentials as per the details provided on my daraja API account. I keep on getting the above named error in the console log. I am farely new to Daraja API so any assistance would be highly appreciated. Did I miss something? nothing happens when after I input the phone number and press 'Request MpesaExpress'
`//TODO :: REPLACE WITH YOUR OWN CREDENTIALS :: THIS IS SANDBOX DEMO daraja = Daraja.with("[I set my own from daraja api]", "[same here", new DarajaListener() {
@Override
public void onResult(@NonNull AccessToken accessToken) {
Log.i(MPESAExpressActivity.this.getClass().getSimpleName(), accessToken.getAccess_token());
Toast.makeText(MPESAExpressActivity.this, "TOKEN : " + accessToken.getAccess_token(), Toast.LENGTH_SHORT).show();
}
Set as well:
//TODO :: REPLACE WITH YOUR OWN CREDENTIALS :: THIS IS SANDBOX DEMO LNMExpress lnmExpress = new LNMExpress( "600616", "[set]", //https://developer.safaricom.co.ke/test_credentials TransactionType.CustomerBuyGoodsOnline, // TransactionType.CustomerPayBillOnline <- Apply any of these two "10", "254708374149", "174379", phoneNumber, "http://mycallbackurl.com/checkout.php", "001ABC", "Goods Payment" );