Interpreting the Response
Once the payer has completed their Hosted Payment Page interaction, you need to redirect them back to your web site, determine the payment result, and present them with a receipt.
Step 1: Redirect the payer to your website
Once the payer finishes their Hosted Payment Page interaction, they are returned to your web site. To accomplish this, you need to provide the URL to which they are redirected to in one of the following ways:
- Provide the interaction.returnUrl field in the Initiate Checkout operation.
- Define the complete callback for the Hosted Payment Page. For details, see Implementing Callbacks.
Step 2: Determine the payment result
The gateway sends the result of the payment in a resultIndicator field in one of two ways, depending on how the payer was redirected back to your site:
- Appended to the URL (interaction.returnUrl) used for returning the payer to your web site.
- Provided as an input parameter to the function provided in the complete callback or appended to the URL provided in the complete callback.
You can determine the success of the payment by comparing the resultIndicator parameter to the successIndicator parameter returned in the INITIATE CHECKOUT response. A match indicates that the payment is successful.
Step 3: Display a payment receipt
If the operation was successful, display a payment receipt to the payer on your web site, and update your system with the payment details. You can retrieve the payment details in various ways:
- With an API request - Use the Retrieve Order operation.
- From Merchant Administration - The payment details are recorded in the Merchant Administration in the Order and Transaction Details page. You can search for the payment and perform subsequent operations.
- Using Reporting API - If your merchant profile has the Reporting API feature enabled, you can download payment data in a formatted report from the gateway.
- From email or Webhook notifications - If you subscribe to notifications in the Merchant Administration, you receive an email or Webhook notification for every successful payment.
Spend some time examining the transaction response fields for each relevant operation in the API Reference. All the fields provide valuable information, you can store some of them locally for accounting, reconciliation, and traceability reasons. The more complex your integration is, the more useful it can be to study specific response codes to identify all aspects of the transaction status.