safaricom / mpesa-php-sdk

A PHP sdk for the new Mpesa RESTful APIs
187 stars 209 forks source link

OnlinePayment Error #5

Open njerucyrus opened 6 years ago

njerucyrus commented 6 years ago

What is the possible bussiness shortcode for sandbox

denomon commented 6 years ago

Possibly try the 6 digit M-Pesa Till Number or PayBill Number

dkiptugen commented 6 years ago

it is not returning the AccountReference . {"Body":{"stkCallback":{"MerchantRequestID":"6618-964352-1","CheckoutRequestID":"ws_CO_24012018144725647","ResultCode":0,"ResultDesc":"The service request is processed successfully.","CallbackMetadata":{"Item":[{"Name":"Amount","Value":1.00},{"Name":"MpesaReceiptNumber","Value":"MAO0DO9BYO"},{"Name":"Balance"},{"Name":"TransactionDate","Value":20180124144754},{"Name":"PhoneNumber","Value":254713154085}]}}}}

mossey commented 6 years ago

Hi @caydee please note that the AccountReference is not sent in the callback. Here is a sample callback for a successful request. { "Body":{ "stkCallback":{ "MerchantRequestID":"19465-780693-1", "CheckoutRequestID":"ws_CO_27072017154747416", "ResultCode":0, "ResultDesc":"The service request is processed successfully.", "CallbackMetadata":{ "Item":[ { "Name":"Amount", "Value":1 }, { "Name":"MpesaReceiptNumber", "Value":"LGR7OWQX0R" }, { "Name":"Balance" }, { "Name":"TransactionDate", "Value":20170727154800 }, { "Name":"PhoneNumber", "Value":254721566839 } ] } } } }

KipchirchirIan commented 5 years ago

@mossey How do I achieve displaying/getting the above callback? I emailed you about this but did not get a response.