I have created an express mobile money payment, for which I want it to wait for the user to enter their PIN and then update my database accordingly. Unfortunately, it is failing to wait for the user to enter their PIN and just returning a response. i have used
{
“status”: “ok”,
“success”: true,
“hasRedirect”: false,
“isInnbucks”: false,
“pollUrl”: “https://www.paynow.co.zw/Interface/CheckPayment/?guid=ab2a0c8e-8590-4da5-8477-da6f3f83d9ce”,
“instructions”: “Dial 1512*4# and enter your EcoCash PIN. Once you have authorized the payment via your handset, please click Check For Payment below to conclude this transaction”
}
Please note that the response you are getting is Initiate Transaction response. What you wait for is the Payment result update which will be sent to your resultUrl
Here is Paynow Overview Process
How Paynow Works - Request flow
This is the communication that goes on between Paynow and merchant during a transaction.
1. You Send a Request to Paynow
You send a request to Paynow to initiate a transaction.
The request contains payment information like amount and validation details.
2. Paynow Responds:
Upon receiving the request, if the details are correct, Paynow responds with status=ok, hash=generated_hash,browserurl, pollurll
3. You process the response
You need to verify the hash using the method as shown below, Once you verify the hash, you need to store the pollurl and then redirect your user to browserurl , where they will attempt to make payment.
4. On Paynow secure payment page:
The user completes the payment on Paynow’s secure website.
Once they have paid or cancelled, they are redirected to your site’s returnurl you sent on the initiate transaction body.
Paynow sends a payment status details to your site’s resulturl which is an endpoint you set in your server that waits for a status from Paynow.
5. On Result URL (Your server):
You receive data from Paynow as shown on status Update Page .
Validate the hash and store/ update the data in your database.
You also use pollurl to verify the data before updating your database.
6. On Return URL (Your server):
User is taken to this url after they have completed the transaction on Paynow.
On this page you have to check for Payment status show relevant information to the user.