Endpoint and USSD Push
NateNjuguna opened this issue · 2 comments
Great work Gene. I deployed mulla and tested successfully. However a curl request will succeed (200) but no USSD push is invoked as specified by the g2 specification and my endpoint as specifed in the app.yaml file is not respected as well. It seems to work but it actually doesn't.
Yaml file
env_variables:
PAYBILL_NUMBER: 'XXXXXX'
PASSKEY: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
MERCHANT_ENDPOINT: 'https://my-domain/pay/test/callback'
RAW CURL:
$ curl -i -X POST \
> --url https://my-domain/api/v1/payment/request \
> --data 'phoneNumber=2547xxxxxxxx' \
> --data 'totalAmount=10.00' \
> --data 'clientName="Foo Bar"' \
> --data 'clientLocation=Lorem Ipsum' \
RESPONSE:
{
"response": {
"return_code":"00",
"status_code":200,
"message":"Transaction carried successfully",
"trx_id":"9deff9552f55547c8d541c04c9efc9dd",
"cust_msg":"to complete this transaction, enter your pin on your handset. if you don't have a pin, press 0 and follow the instructions.",
"description":"success",
"reference_id":"37e5f9c3-5c87-4615-855b-f6392e2c2d5c",
"merchant_transaction_id":"44ebfd80-6667-11e6-be4e-5d93dc3b794e",
"amount_in_double_float":"10.00",
"client_phone_number":"2547xxxxxxxx",
"extra_payload": {
"clientName":"\"Foo Bar\"",
"clientLocation":"Lorem Ipsum"
},
"time_stamp":"20160820024720",
"callback_url":"http://my-domain/api/v1/payment/success"
}
}
As you can see, not even the https protocol I access mulla from is respected in the callback.
Hi You have to confirm the transaction by sending a get request to mulla in order for the ussd push to occur. send GET to https://my-domain/api/v1/payment/confirm/{trx_id}
{trx_id} is the one returned from initial request
@NateNjuguna as @urandu has stated. There are 3 steps involved. Initialising the payment request. Then actually requesting it to be transacted. And lastly waiting for Safaricom to respond to your callback endpoint.
Please refer to the documentation steps: http://kn9ts.github.io/project-mulla/docs/payment-request.html