1. Generate Merchant Keys
A merchant should have an RSA public key in order to integrate direct pay. The RSA key will be generated using this endpoint.
API Endpoints
Production Base URL /api/GenToken/GenerateMerchantKeySandbox Base URL /api/GenToken/GenerateMerchantKeySample Request & Response
Use the below parameters to get merchant keys.
{
"merchantCode":"xxxxx",
"authKey":"xxxxxxxxxx"
}{
"errorCode": 0,
"errorMessgae": "string",
"result": {
"publicKey": "string"
}
}To obtain the public key, access the publicKey property directly from the API response object as follows:
var publicKey = response.result.publicKey;In the event that an error occurs while retrieving or using response.result.publicKey (e.g., the property is malformed, or inaccessible), implement the following fallback mechanism: Use an RSA public key in the XML format specified below:
<RSAKeyValue>
<Modulus>[Binary value]</Modulus>
<Exponent>AQAB</Exponent>
</RSAKeyValue>Replace [Binary value] with the base64-encoded modulus of the RSA public key. This is the primary component of the key.
sample code to post data
Note: Merchant keys are valid for 24 hours and the same key to be use for decryption for 24 hours. Users are expected to generate a new merchant key every 24 hours. If the merchant utilizes an invalid RSA public key, the following error will show up in subsequent calls. { "ErrorMessage" : "Exception while decrypting the Card Details" }
Last updated