When 3D Secure v2 is enabled, each REST API real-time transaction call can run through the 3D Secure process before it processes the payment depending on the selected setting. There are 3 settings that are available for you to choose when processing eCommerce transactions.
Info |
---|
*Please note – every transaction through HPP will always run through the 3D Secure process no matter the setting. |
The real-time transaction API (POST Make a live card transaction) remains the same, except there are now extra fields that become mandatory depending on which 3DS setting you select. There are 3 settings for you to choose from:
Optional
Required
Required (eCommerce)
3DS “Optional” Setting
When “Optional” setting is selected, three new fields are required to support 3DS. The three fields are “CallbackUrl”, “BrowserInfo” and “use3ds”. You can decide per transaction if you want to use 3DS or not by making use of the “use3ds” field.
See For example below:
If value of “use3ds” = “true” – 3DS actioned
If value of “use3ds” = “false” – no 3DS action
If “use3ds” not in body = no 3DS action
If no extra fields are supplied = no 3DS action
Sample:
POST
Code Block |
---|
|
{{url}}/businesses/{{business-id}}/transactions/card-payments/token |
BODY
Code Block |
---|
|
{
"ProcessType": "COMPLETE",
"Reference": "3DS Testing |
Test1212",
"Description": "This is an example real-time transaction",
"Amount": 100.25,
"CurrencyCode": "AUD",
" |
CardToken null,
Card": {
"CardNumber": "4111111111111111"https://www.payrix.com.au",
|
CardholderNameTEST Card",
"ExpiryYear": 2023,
"ExpiryMonth": 10,
"Ccv": "123"
},
"Payer": null,
"CallbackUrl" : "https://www.integrapay.com/3ds
"UserAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.106 Safari/537.36",
|
"AcceptHeader": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", |
US
"0" "ColorDepth": 24,
"ScreenHeight": 1080,
" |
ScreenHeight7681920,
},
"CardToken": "c698ed0d8ac943188c69d88a439bdce3",
" |
ScreenWidth1024"2022-03-01T10:00:00+10:00",
"Payer": {
" |
JavaEnabledtrue"test@test.com",
},
"Audit": {
"Username": "Example-User",
"UserIP": "1.2.3.4"
}
} |
When this function is called, we run AReq and one of the following responses will be returned based on what response we get back:
1. If AReq returns Frictionless Successful it will proceed to process the transaction and a result as normal.
Code Block |
---|
|
{
"transactionId": "RT869918",
"reference": "3DS Testing 20",
"statusCode": "S",
"subStatusCode": null,
"statusDescription": null,
"processedAmount": 150.00,
"cardType": "Visa",
"redirectId": null,
"redirectUrl": null,
"cardAuthorizationReference": null
} |
2. If AReq returns Frictionless Rejection the transaction will not be submitted to the bank/gateway for processing and a new transaction will be immediately generated with the rejected status and the result will be as follows:
Code Block |
---|
|
{
"transactionId": "2648881",
"reference": "3DS Testing 21",
"statusCode": "R",
"subStatusCode": "R20",
"statusDescription": "DO NOT PROCESS - 3-D Secure rejected the transaction due to suspected fraud",
"processedAmount": null,
"cardType": null,
"redirectId": null,
"redirectUrl": null,
"cardAuthorizationReference": null
} |
3. If AReq returns Challenge Required, we will return a response with a new StatusCode of “V” (no transaction is generated yet). Sample below:
Code Block |
---|
|
{
"transactionId": null,
"reference": "3DS Testing 22",
"statusCode": "V",
"subStatusCode": "VCR",
"statusDescription": "3-D Secure Required - send your customer to the 'RedirectUrl'",
"processedAmount": null,
"cardType": null,
"redirectId": "710aebb4092e4e3cbfe37f5f5f3d6dc2",
"redirectUrl": "https://sandbox.rest.paymentsapi.io/businesses/8C81D848-1E9D-45B3-8382-0C108FDB9C9C/services/tokenize-card/3dsecure/redirect2/710aebb4092e4e3cbfe37f5f5f3d6dc2",
"cardAuthorizationReference": null
} |
Note the two new fields “redirectUrl” and “redirectId” which are returned only for this status “V” response.
If challenge required was returned, it will be up to the merchant to redirect their customer to the URL we provided in the response. For testing, you can simply copy and paste the “redirectUrl” into your browser to get to the challenge page.
Once you have completed the challenge, you should be redirected to the URL provided in the “CallbackUrl” from the previous API call. To determine the result of the challenge and complete the transaction, you will need to call this API - (3-D Secure Finalize Transaction) by using the “redirectId”.
This function checks the result of the challenge and if it was successful, it will continue to process the transaction with all the information originally provided in the card transaction API call. This function returns the same result model as the real-time transaction function, so can be handled in the same way.