Integration Types
Other Features
Card Payments
Mobile Wallets
Alternative Payment Methods
Resources
When you send a transaction request to the Mastercard 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.
When reviewing the transaction response fields, you should adhere to the following best practices:
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.
The 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 Mastercard Gateway.
Select Protocol and Language to view Code Snippet.
From: Sample Code Download
Once 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
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 Mastercard Gateway?
All approved transactions are represented with a Transaction Response Code value of APPROVED
from the Mastercard Gateway. To verify, you can view the value of the response.gatewayCode
field in your transaction response.