Checking transaction outcome
There are three ways to check the result of the payment request triggered by the form. All of them are available at a different point and contain varying degrees of information:
1. API Response
First, the Revup payment gateway will return a response from the API indicating the associated transaction ID and whether the payment has already succeeded/failed or is still in process.
2. Callback to Redirect URL
Then a callback is made to the indicated redirectUrl
. This object can be specified either statically (in the merchant configuration) or dynamically (in the body of the request to create the order) and contains two URLs:
- When the payment is successful or still in process, the callback goes to the success URL.
- If the payment fails, the callback goes to the fail URL.
This callback contains a list with one or two transactions, depending on whether the first attempt failed and a fallback MID was used. (If that is the case, do not forget to keep track of both reported transactions in your system.)
These transactions will include additional information about the payment process and a more updated status. Find some callback examples on the Callback to Redirect URL documentation.
3. Notifications and Transaction Information
Finally, depending on whether the payment is:
- Synchronous
- Asynchronous
- Or requires 3DS
...the payment status reported might not be final.
For such cases:
- You might request the transaction information from the API at any time.
- It is actually more convenient to listen to the notifications that Revup will send regarding any state change
Same as for the callback, the notification will be sent to a notificationUrl that you can provide either statically (in the merchant configuration) or dynamically (in the body of the request to create the order).
For reference, the following table contains a relation of the different statuses.
HTTP CODE | FINAL | DESCRIPTION |
---|---|---|
success | Yes | The payment has been processed successfully. |
failed | Yes | The payment has not been processed successfully. |
in_process | No | The payment is asynchronous and is being processed or the payment is synchronous but the acquirer has not given an answer yet. |
waiting_user_interaction | No | The payment is being managed by the 3DS process and requires the user interaction. |