Open alexanderwanyoike opened 5 years ago
You saved the day! Thank you so much @alexanderwanyoike
@alexanderwanyoike Noted. This will be changed to a post install, hence always get the latest after an install. in the mean while, you can always load your own cert during instantiation.
{
consumerSecret: '<your consumer secret>',
environment: 'sandbox',
shortCode: '600111',
initiatorName: 'Test Initiator',
lipaNaMpesaShortCode: 123456,
lipaNaMpesaShortPass: '<some key here>',
securityCredential: '<credential here>',
certPath: path.resolve('keys/myKey.cert') //<------------------------- here
}
Hi @geofmureithi any idea if the production has the same mismatch cert issues?
I am trying production cert and it has the same initiator issue as sandbox.
I am communicating with Api feedback team but day of launch has come and they didn't replied back yet
Hi @alexanderwanyoike
i have tried both certificates in
https://github.com/safaricom/mpesa-node-library/blob/master/keys/sandbox-cert.cer
and
https://developer.safaricom.co.ke/sites/default/files/cert/cert_sandbox/cert.cer
but am still getting the below callback error in B2C API
{
"Result": {
"ResultType": 0,
"ResultCode": 2001,
"ResultDesc": "The initiator information is invalid.",
"OriginatorConversationID": "13400-2728457-1",
"ConversationID": "AG_20200319_0000554b8a1231b91955",
"TransactionID": "OCJ41HBH8U",
"ReferenceData": {
"ReferenceItem": {
"Key": "QueueTimeoutURL",
"Value": "https://internalsandbox.safaricom.co.ke/mpesa/b2cresults/v1/submit"
}
}
}
}
@alexanderwanyoike You may need to look into Daraja itself. Several things might be happening.
certPath: path.resolve('keys/myKey.cert') //<------------------------- here
Can we add the certificate in vault for ease of management? And have something like docker on top of it.
Description
Not really a bug actually the sandbox certificate specified in this repo is correct and I managed to get successful transactions using this key. This is not the case for https://developer.safaricom.co.ke/sites/default/files/cert/cert_sandbox/cert.cer that is different from the certificate that the library uses. The certificate posted on the docs didn't work
Reproduction
Steps to reproduce the behaviour:
Expectation
A successful transaction
Actual
Transaction with the error
Initiator Information is invalid
Specification