Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 8 Next »

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.

 *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.

 For example:

  •  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

{{url}}/businesses/{{business-id}}/transactions/card-payments/token

BODY

{
  "ProcessType": "COMPLETE",
  "Reference": "3DS Testing 212",
  "Description": "This is an example real-time transaction",
  "Amount": 100.25,
  "CurrencyCode": "AUD",
  "CallbackUrl": "https://www.payrix.com.au",
  "use3ds": "true",
  "BrowserInfo": {
    "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",
    "Language": "en-GB",
    "TimeZone": -660,
    "ColorDepth": 24,
    "ScreenHeight": 1080,
    "ScreenWidth": 1920,
  },
  "CardToken": "c698ed0d8ac943188c69d88a439bdce3",
  "ServiceDate": "2022-03-01T10:00:00+10:00",
  "Payer": {
    "email": "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.

{
    "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:

{
    "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:

{
    "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.

Sample if challenge successful:

{
    "transactionId": "RT869919",
    "reference": "3DS Testing 22",
    "statusCode": "S",
    "subStatusCode": null,
    "statusDescription": null,
    "processedAmount": 150.00,
    "cardType": "Visa",
    "redirectId": null,
    "redirectUrl": null,
    "cardAuthorizationReference": null
}

If challenge failed, a rejected transaction record is generated and a rejected result is returned.

{
    "transactionId": "2648883",
    "reference": "3DS Testing 23",
    "statusCode": "R",
    "subStatusCode": "R20",
    "statusDescription": "NOT AUTHORISED - 3-D Secure challenge was not completed",
    "processedAmount": null,
    "cardType": null,
    "redirectId": null,
    "redirectUrl": null,
    "cardAuthorizationReference": null
}

  • No labels