RDP Redirect API

Push Notification Result

Push Notification Description

After the first phase, RDP payment gateway will process the payment or transaction. The result of the payment or transaction will then be communicated to merchant system through two ways or methods. One of the methods is called ‘Push Notification’. As the name suggest, RDP push the payment-result to the Merchant’s system as is indicated by the URL that is sent within the request under the field of notify_url. The following are the important points of this push notification:

  • It is a POST request toward notify_url.
  • The payment result is in a JSON formatted information
  • The payment result is put inside the BODY of the request
  • Merchant is required to response with status of 200 (OK) by default when no errors is happened, majority of web framework returns status 200.
  • In the case where Merchant is not returning status 200, RDP system will be trying for 3 times consecutively.

Push Notification Result Parameters

Field Name Status Value Type Description
response_code Mandatory VARCHAR(10)

Flag which defines whether the transaction is accepted, or has an error in request, or rejected by Acquirer (e.g. Bank). Possible values:

  • 0 : success – accepted transaction
  • -1 : bank/acquirer rejection
  • others : request-error
response_msg Mandatory TEXT

Description on the response-code

mid Conditional [No-Error] VARCHAR(20)

The merchant id generated by RDP for merchant, which is used to handle the transaction (can be different from mid used for requesting payment, especially when merchant has multiple payment-mode with RDP gateway).

request_mid Conditional [No-Error] VARCHAR(20)

The merchant id generated by RDP for merchant, which is used when requesting the payment.

order_id Conditional [No-Error] VARCHAR(16)

An echo back to Merchant’s order-id for the transaction as the identifier of the transaction.

transaction_id Conditional [No-Error] VARCHAR(32)

The RDP generated unique transaction-id, which is used heavily for identifying the resulted transaction in RDP system.

request_amount Conditional [No-Error] NUMERIC

Echo back the amount as is sent in the request.

request_ccy Conditional [No-Error] In 3 digits ISO-4217 Alphabetical Currency Code format.

Echo back the currency requested.

Example: SGD, IDR, USD

request_timestamp Conditional [No-Error] YYYY-MM-DD hh:mm:ss

The date-time when the request is received or created. In a 24 hour format. Time zone is using (UTC+08:00) Kuala Lumpur, Singapore. Example: 2015-11-14 12:33:27

authorized_amount Conditional [No-Error] Numeric

Amount after applying all of others RDP features. E.g. InstanPromo, Currency-Converter, etc.

authorized_ccy Conditional [No-Error] In 3 digits ISO-4217 Alphabetical

The final currency that is going to be communicated to Bank/Acquirer.

Example: due to Currency-Converter features.

transaction_type Conditional [No-Error] S, A

S : Sale transaction

A : Authorization transaction

created_timestamp Conditional [No-Error] YYYY-MM-DD hh:mm:ii

The datetime when the response is created. In a 24 hour format. Timezone is using (UTC+08:00) Kuala Lumpur, Singapore.

Example: 2015-11-14 12:33:27

acquirer_response_code Conditional [No-Error] TEXT

Response code from acquirer. Format is specific to each acquirer.

acquirer_response_msg Conditional [No-Error] TEXT

Description of the response code

signature Conditional VARCHAR(128)

The SHA-512 response’s signature. For signature generation and validation, please refer to chapter 4. Please also see the note in chapter 4.3.

acquirer_authorized_amount Conditional [on success only] Numeric

The amount authorized by acquirer

Note: Can be different if Acquirer provides DCC feature.

acquirer_authorized_ccy Conditional [on success only] In 3 digits ISO-4217 Alphabetical Currency Code format.

The currency authorized by Acquirer.

Note: Can be different if Acquirer provides DCC feature.

merchant_reference Conditional [no-error] VARCHAR(100)

The echo back of merchant_reference in the request message.

acquirer_created_timestamp Optional [Acquirer Dependent] YYYY-MM-DD hh:mm:ii

The datetime when the response is created. In a 24 hour format. Timezone vary depends on Acquirer. Example: 2015-11-14 12:33:27

acquirer_transaction_id Optional [Acquirer Dependent] TEXT

Transaction ID generated by Acquirer. Existence depends on availability of the fields from acquirer

acquirer_authorization_code Conditional [Acquirer Dependent] VARCHAR

The authorization code from the Bank. Only when it is available from the Bank response.

first_6 Optional [Acquirer Dependent] VARCHAR(6)

The first 6 digits of card_no

last_4 Optional [Acquirer Dependent] VARCHAR(4)

The last 4 digits of card_no

exp_date Optional [Acquirer Dependent] VARCHAR(6)

The expiry date of the card used for transaction.

payment_mode Conditional [no-error] NUMERIC

The payment mode or card type that customer used for the transaction. Please refer to Appendix B (Payment Mode List).

payer_id Conditional VARCHAR(100)

RDP payment gateway will return this field, with these following conditions:

  • Tokenization feature is turned on for the merchant.
  • Merchant send ‘token_mod’ parameter with value equal to 1 (enabled) in first phase request message.
  • The value will be similar to the value of ‘token_mod_id’ in first phase request parameter, if merchant previously sent a value under this parameter; else it will be a random generated value.
  • Successful transaction.

Please takes note that for merchant with multiple payment modes (multiple payment tabs inside the payment page), the returned ‘payer_id’ parameter value is tied to ‘mid’ parameter value, and it is not tied to the ‘request_mid’ parameter value).

payer_name Optional [Acquirer Dependent] VARCHAR(45)

The name of cardholder.

acquirer_mpi_eci Conditional [Acquirer Dependent] NUMERIC

The ECI (Electronic Commerce Indicator) value that’s returned by acquirer’s MPI and the existence of this field is subjected to the acquirer being chosen by merchant.
Please refer to ‘Appendix H‘ for possible ECI values.

uatp Conditional TEXT

This parameter is used for ‘Universal Air Travel Plan (UATP)’ feature and will be only available for those merchants where this feature is enabled for them. The data is in JSON formatted text. Please refer to ‘Appendix E‘ section for further info about ‘uatp’ parameter in push notification message.

merchant_data1 Conditional [Acquirer Dependent and No-Error] VARCHAR(32)

An echo message based on the same parameter name that’s sent in the request message; and will be only applicable for the payment transaction through China PNR.

Push notification result example:

{"mid":"1000089029","transaction_id":"pruefer_9is_9901523031657784985","order_id":"pruefer_9is","acquirer_transaction_id":"311815","request_amount":"0.01","request_ccy":"SGD","authorized_amount":"0.01","authorized_ccy":"SGD","acquirer_authorized_amount":"0.01","acquirer_authorized_ccy":"SGD","response_code":"0","response_msg":"successful","acquirer_response_code":"0","acquirer_response_msg":"APPROVED OR COMPLETED","acquirer_authorization_code":"657300","created_timestamp":"2017-05-05 09:49:24","acquirer_created_timestamp":"2017-05-05 09:49:15","first_6":"411111","last_4":"1111","request_timestamp":"2017-05-05 09:49:08","request_mid":"1000089029","transaction_type":"S","payment_mode":"1","signature":"cf966933ef6b23ab45b95e9a0d8d4d51bd024f9ed3aaa0b0ff66132e317f8b0fa077dcd5b50dd2dcc6808d8b00b90b4cc53a9cfa04278118f8a848f86782eb2a"}

Push Notification Handling Example

Below is the sample code for push notification handling in PHP programming language.

This sample code is retrieving the result from the BODY of an RDP push notification, and parse the JSON into array, traverse and print it out to the screen.
By default a successful PHP script returns status 200

$content = '';
$querystring = @file_get_contents('php://input');

$arrParam = array();
$prefix = '';
try {
   $arrParam = json_decode($querystring, true);
   $content .= $querystring;
   foreach($arrParam as $key => $val) {
      $content .=$key.'='.$val."\n";

   $prefix = "";
   if(isset($arrParam["mid"])) $prefix .= $arrParam["mid"];
   $prefix .= "_";
     $prefix .= $arrParam["transaction_id"];

     'res'.'.txt', $content);
catch (Exception $e) {