- Print
- DarkLight
- PDF
Merchants using the API Payment or API PreAuth should utilize the Get Card 3DS Version API before submitting a request to SmartRoute. Follow these steps:
- After collecting the card details (card number, expiry date, and cardholder's name), and prior to calling the API Payment or API PreAuth API, the merchant must invoke the Get Card 3DS Version API.
- Check the
Response.StatusCode
field in the response. Based on the status code:- If the status code is an error (not
00000
), the payment process cannot continue (using API Payment or API PreAuth). In this case, the merchant must resubmit a new request to the Get Card 3DS Version API. - If the status code is successful (
00000
) and theResponse.MethodPOSTData
is either empty or missing, proceed with the payment by calling the API Payment or API PreAuth. - If the status code is successful (
00000
) and theResponse.MethodPostData
is provided, the merchant needs to open an iframe to POST theResponse.MethodPostData
toResponse.MethodDataURL
. Ensure that the iframe is not open for more than 10 seconds. If this time limit is exceeded, continue by calling the subsequent APIs. Below is a sample JavaScript code snippet to use:
- If the status code is an error (not
var url = response["methodDataURL"]; // this is from the response of Get Card 3DS Version API call
var threeDSMethodData = response["methodPostData"];// this is from the response of Get Card 3DS Version API call
var ifrm = document.createElement('iframe');
ifrm.setAttribute('id', 'threeDSMethodDataIframe'); // assign an id
ifrm.setAttribute('name', 'threeDSMethodDataIframe'); // assign a name
ifrm.style.width = '0px';
ifrm.style.height = '0px';
ifrm.setAttribute('frameborder', '0');
ifrm.setAttribute('style', 'visibility: hidden; position: absolute; left: 0; top: 0; height:0; width:0; border: none;');
document.body.appendChild(ifrm); // to place at end of document
var html = "<form action = 'MethodDataURL' method='POST' id = 'threeDSMethodDataForm' name = 'threeDSMethodDataForm' target = 'threeDSMethodDataIframe'>";
html += "<input type = 'hidden' name = 'threeDSMethodData' value = '" + threeDSMethodData + "'/>";
html += "<input type = 'hidden' name = 'JWT' value = '" + threeDSMethodData + "'/>";
html += "</form>";
html += "<script>document.getElementById('threeDSMethodDataForm').submit();<\/script>";
Request Parameters
Parameter | Description |
---|---|
AuthenticationToken required | AuthenticationToken Value send in request Header.
|
MessageID required | Alphanumeric value representing the action to be called. 27 for Get 3DS Version
|
MerchantID required | Alphanumeric value representing the unique ID of the merchant at SmartRoute, this value is provided by SmartRoute operation team upon merchant enrollment.
|
TransactionID Conditional | The Transaction ID generated by the Merchant, it represents a unique identifier for the transaction, and it is alphanumeric. It can’t include special characters neither spaces. This Transaction ID should be equal to Transaction ID used in API Payment/API PreAuth Condition: It is required in case of channel is 0, 1 and 2 and optional in case of channel is 3 (Mobile SDK)
|
Channel required | The Channel to be used by SmartRoute System. It could be one of the following:
|
Version optional | A numeric value with (.) separator represents the command's version to be used. If this value is not provided, SmartRoute will consider its default value which is 1.0.
|
CurrencyISOCode required | The numeric ISO Code for the currency and not the character value.
Sample ISO Codes values:
|
CardNumber required | The customer’s card number that will be used in the payment. This parameter is required if the sent PaymentMethod parameter is 1 (Card).
|
Token required | The token is used in this request; to represent previously used card information. This parameter is a part of the tokenization parameters. For more information, see Tokenization
|
ExpiryDateMonth required | The customer’s card expiry date month digits that will be used in the payment. The format of this parameter should be in the form (MM). This parameter is required if the sent PaymentMethodparameter is 1 (Card).
|
ExpiryDateYear required | The customer’s card expiry date year digits that will be used in the payment. The format of this parameter should be in the form (YY). This parameter is required if the sent PaymentMethod parameter is 1 (Card)
|
PaymentMethod optional | A numeric value to indicate which payment method will be used. Supported values are: 1 means a payment using Card. 9 means a payment using GooglePay If not sent then the default value is 1 (Card)
|
googlePayResponse conditional | The googlePayResponse is used in the payment. This value should be URL encoded when it is entered into the secure hash generation process. If the sent PaymentMethod parameter is 9 (Google Pay), this parameter is required
|
ItemID optional | The custom item ID for the merchant
|
BrowserLanguage conditional | An alphabetic value representing the browser language preference present in the http header It is required in case of channel is 0, 1 and 2
|
BrowserScreenHeight conditional | Total height of the Cardholder's screen in pixels. Value is returned from the screen.height property. It is required in case of channel is 0, 1 and 2
|
BrowserScreenWidth conditional | Total width of the Cardholder's screen in pixels. Value is returned from the screen.width property. It is required in case of channel is 0, 1 and 2
|
BrowserScreenColorDepth conditional | Value representing the bit depth of the color palette for displaying images, in bits per pixel. Obtained from Cardholder browser using the screen.colorDepth property. The field values are:
|
BrowserTimeZone conditional | Time difference between UTC time and the Cardholder browser local time, in minutes. The value is returned from the getTimezoneOffset() method. It is required in case of channel is 0, 1 and 2
|
BrowserUserAgent conditional | Exact content of the HTTP user-agent header. It is required in case of channel is 0, 1 and 2
|
BrowserJavaScriptEnabled conditional | Boolean that represents the ability of the cardholder browser to execute Java script. It is required in case of channel is 0, 1 and 2
|
BrowserJavaEnabled conditional | Boolean that represents the ability of the cardholder browser to execute Java. Value is returned from the navigator.javaEnabled property It is required in case of channel is 0, 1 and 2
|
BrowserAcceptHeader conditional | Exact content of the HTTP accept headers as sent to the 3DS Requestor from the Cardholder's browser. It is required in case of channel is 0, 1 and 2
|
ClientIPaddress conditional | An alphanumeric value that represents the client’s public IP Address. It is required in case of channel is 0, 1 and 2
|
Response Parameters
Parameter | Description |
---|---|
Response.StatusCode required | An alphanumeric value that represents the response code that covers errors generated by the SmartRoute. Check API Payment Response Codes Appendix for descriptive details about Response Codes
|
Response.StatusDescription required | An alphanumeric value that represents a message describing the response status received from SmartRoute. This parameter is filled only after a complete execution process using the language specified in the request.
|
Response.MerchantID required | An alphanumeric value that represents the unique ID of the merchant at SmartRoute. The SmartRoute operation team provides this value upon merchant enrollment.
|
Response.MessageID required | An alphanumeric value that represents the action for defined unique number: 27 for Get card 3ds version
|
Response.ThreeDSVersion required | An alphanumeric value that represents the 3DS Version, the available values are:
|
AuthenticationToken required | AuthenticationToken Value send in response Header
|
Response.MethodDataURL conditional | ACS URL that should be used to POST MethodData. The value is URLEncoded It is optional in case of channel is 0, 1 and 2
|
Response.MethodPostData conditional | Method Data they should be posted to MethodDataURL. The value is URLEncoded It is optional in case of channel is 0, 1 and 2
|