Interpret the Transaction Response
When you send a transaction request to the ANZ eGate payment gateway, you receive a response within a short interval. To determine the success of your transaction, as well as obtain other important data from the transaction response, you need to decode and parse the transaction response.
Best practices
When reviewing the transaction response fields, you should adhere to the following best practices:
- Spend some time examining the transaction response fields for each relevant operation in the API Reference. All the fields provide valuable information, and you should store some of them locally for accounting, reconciliation, and traceability reasons. You can also use them to display a receipt number or something similar for the payer. 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.
- Validate whether the data that you supply for the transaction is the same as the data used to process the transaction. For example, check that the amount that the gateway returns in the transaction response matches the value you sent in the request.
- Write your integration to support unexpected new response fields. The fields returned in response may increase after you have completed your integration. Fields that were not previously populated may start returning a value and new fields may appear.
Sample transaction response
This topic includes various sample code snippets. Select the protocol and language that you want to use and select Update Code Snippets to change all the snippets in this topic.
Decode the response
(, ) ChangeThe response you receive on your transaction is encoded or formatted in the same format as the transaction request. To make this data more accessible, decode it and store it in an array or a similar object.
The following code snippet shows how to decode the response received from the ANZ eGate payment gateway.
Select Protocol and Language to view Code Snippet.
From: Sample Code Download
Parse the response
(, ) ChangeOnce you decode the transaction response and store it in an easily accessible object, you can parse the data to retrieve any fields that you need.
The following code snippet shows how to parse a field from the decoded transaction response.
Select Protocol and Language to view Code Snippet.
From: Sample Code Download
Frequently asked questions
What should I do if I do not receive a response?
When you do not receive a response, wait for 60 seconds, and try to resubmit an identical request. If the gateway has received the original request and the new one is a duplicate, in that case the bank transaction is not repeated, and no duplicate funds are transferred. You will receive the same response as you would have received for the first request.
How do I know if a transaction is approved from the ANZ eGate payment gateway?
All approved transactions are represented with a Transaction Response Code value of APPROVED
from the ANZ eGate payment gateway. To verify, you can view the value of the response.gatewayCode
field in your transaction response.