Closed abhi9419 closed 1 year ago
Hello @abhi9419 this is an immediate response saying that M-Pesa has received your request. The status os the transaction is determined by the response that is posted to your callback route.
When sending a request initiate the C2B transaction there is no paramter to send the callback route. It has only below paramters:
{
"ShortCode": "601426",
"CommandID": "CustomerPayBillOnline",
"Amount": "1",
"Msisdn": "254708374149",
"BillRefNumber": "10000",
}
I also tried sending callbackurl in the Safaricom Simulation Environment but I am unable to get any response on the callback page.
I am trying to simulate this process on Safaricom Website. But I am stuck at this point. Any help would be appreciated
Hi @abhi9419 lemme clarify how the C2B transaction works. The C2B transaction is a simulation of a usual payment to a paybill or till number from an MSISDN. When payment is made to a shortcode /till, two callbacks (callback and validation) are sent to the callback URLs that were configured/registered. Registation of the callbackURLS can be done on the portal. Upon receiving the two callbacks, one must respond with this JSON {"ResultCode": 0, "ResultDesc": "The service was accepted successfully", "ThirdPartyTransID": "1234567890"}
. This tells M-Pesa to allow the transaction to proceed.
Please help me understand how to implement both callbacks
Hey @josekenya, upon testing you can use postman to register the callback routes. This is the syntax of the post request: { "ShortCode": $shortcode, "ResponseType": "Completed", "CommandID": "RegisterURL", "ConfirmationURL": $your_confirmation_url, "ValidationURL": $your_validation_url }
Of course, you need to have the access token in your headers. The response you should expect is a success message from the mpesa API.
Hi, I am using mpsea-php-sdk which is great but I am not able to understand what does the c2b transaction returns in response. I am getting below response.
"{ "ConversationID": "AG_20180402_00004a92452ef78e864d", "OriginatorCoversationID": "12362-3240472-1", "ResponseDescription": "Accept the service request successfully." } "
What does this mean?? I am not able to fetch success code or something like that. Am i missing something ?