3. Initiate Pay
After validating the merchant request, This API is used to process payment requests securely by encrypting card data using AES and RSA encryption.
API Endpoints
Direct Pay Production Base URL /InitiatePay
Sample Request & Response
The request body should include the following fields:
"Initiate pay request{
"ReferenceId" : "xxxxxxxxx",//15-digit reference id received in the validate requet response
"MerchantId": xxxxxx, //merchant code
"ECardData" = "encryptedCard", //card data encrypted using AES Encryption
"ECardKey" = "encryptedKey", // Encrypt the 32 digit AES key using the public key
"ACS_CallbackURL"= "call back url for 3DS"+ReferenceId //optional
}
};
ReferenceId
string
15-digit reference id received in the validate requet response
MerchantId
string
Merchant code
ECardData
string
The encrypted card data encrypted using AES encryption with a 32-bit key. Explained below
ECardKey
string
ACS_CallbackURL
string
Explanation of the ECardData
Encryption Object
ECardData
Encryption ObjectThe ECardData
field in the request is an encrypted representation of the sensitive card details. The following explains the object that is encrypted using AES encryption before being included in the API request:
{
"CardNumber": "xxxxxxxxxxxxxxxx",//16-digit card number
"CardName": "John Doe", //Name mentioned on card
"CardExpiry": "mm/yy", //month/year format
"CardCVV": "xxx" //3 decimal number
}
ACS_CallbackURL
If empty, the 3D Secure callback will be handled by the provider, and the user will be redirected to call back url provided in the step 1. For more info about redirection refer here.
If provided, the 3D Secure callback will be sent to the merchant's specified URL, and the merchant must call the API at here for further processing.
Response Explaination
Upon receiving the response from the InitiatePay API, the merchant must verify the errorCode to determine the next steps. If the errorCode is 0, indicating a successful initiation, the merchant should parse the result object and render the HTML content provided in result.redirect.html to proceed with the 3DS authentication process.
Last updated
Was this helpful?