```
--------------------------------
### Instantiate ThreeDS SDK (HTML)
Source: https://docs.3dsintegrator.com/docs/performance-marketing-advertisers
Instantiates the ThreeDS SDK class, configuring its endpoint and verbosity. This setup is crucial for initializing the SDK with your form ID and API key.
```html
```
--------------------------------
### Data Share Transaction Integration
Source: https://docs.3dsintegrator.com/docs/3ds-for-data-share
This section details how to initiate a Data Share transaction by setting the `challengeIndicator` and provides examples of successful responses for different networks.
```APIDOC
## POST /transactions (Example Endpoint)
### Description
Initiate a Data Share transaction by setting the `challengeIndicator` to `06` when using PAAYs JS SDK or API. This helps lift authorization approval rates and mitigate fraud.
### Method
POST
### Endpoint
/transactions
### Parameters
#### Query Parameters
- **challengeIndicator** (string) - Required - Set to `06` to indicate a Data Share transaction.
### Request Example
```json
{
"challengeIndicator": "06"
}
```
### Response
#### Success Response (200)
- **authenticationValue** (string) - The authentication value returned by the 3DS system.
- **eci** (string) - The Electronic Commerce Indicator. `07` for Visa, `06` for MasterCard.
- **status** (string) - Transaction status. `I` indicates success.
- **protocolVersion** (string) - The EMV 3DS protocol version used.
- **dsTransId** (string) - Unique identifier for the 3DS transaction on the Directory Server.
- **acsTransId** (string) - Unique identifier for the 3DS transaction on the Access Control Server.
- **scaIndicator** (boolean) - Indicates if Strong Customer Authentication was performed.
- **whiteListStatus** (string) - Optional. Indicates whitelist status. `Y` if whitelisted.
#### Response Example (EMV 3DS Success)
```json
{
"authenticationValue": "XYi1pplo2XITHfJdT21SweFz1us=",
"eci": "07",
"status": "I",
"protocolVersion": "2.2.0",
"dsTransId": "d65e93c3-35ab-41ba-b307-767bfc19eae3",
"acsTransId": "ca5f9649-b865-47ce-be6f-54422a0fce47",
"scaIndicator": false
}
```
#### Response Example (All Other Networks Successful)
```json
{
"authenticationValue": "XYi1pplo2XITHfJdT21SweFz1us=",
"eci": "07",
"status": "I",
"protocolVersion": "2.2.0",
"dsTransId": "d65e93c3-35ab-41ba-b307-767bfc19eae3",
"acsTransId": "ca5f9649-b865-47ce-be6f-54422a0fce47",
"scaIndicator": false,
"whiteListStatus": "Y"
}
```
#### Response Example (MasterCard Successful)
```json
{
"authenticationValue": "XYi1pplo2XITHfJdT21SweFz1us=",
"eci": "06",
"status": "I",
"protocolVersion": "2.2.0",
"dsTransId": "d65e93c3-35ab-41ba-b307-767bfc19eae3",
"acsTransId": "ca5f9649-b865-47ce-be6f-54422a0fce47",
"scaIndicator": false,
"whiteListStatus": "Y"
}
```
```
--------------------------------
### SDK Initialization for Live Environment
Source: https://docs.3dsintegrator.com/docs/-switching-from-sandbox-to-live
When using the SDK, it communicates with the Live API by default. Ensure you do not override the default endpoint.
```APIDOC
## SDK Live Environment Initialization
### Description
By default, the SDK communicates with the Live API. Do not override the endpoint option of the SDK to ensure it points to the production environment.
### Method
Initialization
### Endpoint
Default Live Endpoint (do not override)
### Parameters
#### Path Parameters
None
#### Query Parameters
None
#### Request Body
None
### Request Example
```javascript
var tds = new ThreeDS("
", "", null, {
verbose: true,
// endpoint: 'https://api.3dsintegrator.com/v2.2' - Make sure that you do not override this parameter and it has the default value
});
```
### Response
SDK initialization does not typically return a response in the traditional sense, but successful initialization prepares the SDK for live API communication.
```
--------------------------------
### Get Browser Screen Height JavaScript
Source: https://docs.3dsintegrator.com/reference/post_v2-2-authenticate-browser
This code example shows how to retrieve the total height of the user's screen in pixels via JavaScript. This value is essential for the browser information collected during 3D Secure processes.
```javascript
window.screen.height.toString()
```
--------------------------------
### HTML Form with 3DS Integrator SDK Configuration
Source: https://docs.3dsintegrator.com/docs/showchallenge-example
This HTML snippet sets up a payment form and integrates the 3DS Integrator JavaScript SDK. It configures the SDK with `autoSubmit`, `showChallenge`, and `forceTimeout` options to manage the 3D Secure authentication process, including displaying challenges and handling timeouts.
```html
AutoSubmit Example
```
--------------------------------
### 3RI Authenticate Request (cURL)
Source: https://docs.3dsintegrator.com/docs/3ri-authenticate-request
Example using cURL to send an authenticate request for 3RI Option A, utilizing `priorTransactionDSTransID`. This method is recommended for its simplicity and robustness, especially for specific `threeRIIndicator` values like recurring or installment payments.
```curl
curl --location 'https://api-sandbox.3dsintegrator.com/v2.2/authenticate/3ri/async/bulk' \
--header '(JWT-Token)' \
--header 'Content-Type: application/json' \
--data-raw '{
{
"authentications": [
{
"protocolVersion": "2.2.0",
"messageCategory": "01",
"threeRIIndicator": "01",
"clientTransactionId": "c9fc0df7-27ce-4370-b5e5-b222ab0a19f9",
"amount": 9.99,
"pan": "4917300800000000",
"recurringExpiry": "20240807",
"recurringFrequency": "1",
"month": "08",
"year": "45",
"cardHolderName": "Jane Doe",
"email": "Jane@example.com",
"threeDSRequestorURL": "https://example.com",
"priorTransactionDSTransID":"a10a2dc4-dbd3-4fb2-b211-4cc2ba6c29c5"
}
]
}
'
```
--------------------------------
### Handle 'No Results Found' Error Response
Source: https://docs.3dsintegrator.com/docs/get-results
This example shows the JSON response received when no results are found for a transaction, typically due to the request being made too soon after authentication or fingerprinting. A 404 error indicates that results are still pending.
```json
GET https://api-sandbox.3dsintegrator.com/v2.2/transaction/43d40dbc-5675-4639-8eac-3970c2eb523d/updates 404
{"error":"No result found for transaction as yet. Please subscribe again","transactionId":"43d40dbc-5675-4639-8eac-3970c2eb523d","correlationId":"2c75543c-34d1-4424-9e98-b303252f51c0"}
```
--------------------------------
### Wait for Both Callbacks on Trial/Straight Sale Continuity with JS SDK
Source: https://docs.3dsintegrator.com/docs/performance-marketing-advertisers
This example shows how to use a count function to ensure both initial and rebill authentication callbacks have returned before proceeding. It's useful for trial and straight sale continuities where you need to wait for both responses. A challenge can be displayed while waiting, and order submission can be triggered once both callbacks are complete.
```javascript
var gateway = {}
var count = 0
var tds = new ThreeDS(
"
",
"",
null,
{
endpoint:"https://api-sandbox.3dsintegrator.com/v2.2",
verbose:true,
autoSubmit:false
});
document.addEventListener("submit", () => {
tds.verify(function(response){ //initial
console.log(response)
console.log("initial success!")
initial_and_rebill_complete() //first counter call
},function(response){
console.log("initial failure!")
},{
amount:9.99
});
tds.verify(function(response){ //rebill
console.log(response)
console.log("rebill success!")
initial_and_rebill_complete() //second counter call
},function(response){
console.log("rebill failure!")
},{
amount:89.99
});
event.preventDefault();
//this function waits for both callbacks to complete before being satisfied
function initial_and_rebill_complete() {
count++
//this function only displays once both callbacks have returned
if (count === 2) {
//once this function is called twice
//once for initial and once for rebill
console.log("hit 2 times")
var myJSON = JSON.stringify(gateway);
document.getElementById("display").innerHTML = `
` +myJSON +`
Both callbacks have returned, you can now submit order
`;
});
```
--------------------------------
### Initialize SDK for Live Environment (JavaScript)
Source: https://docs.3dsintegrator.com/docs/-switching-from-sandbox-to-live
Initializes the 3DS Integrator SDK to communicate with the Live API. Ensure the endpoint is not overridden to maintain default live connection. The 'verbose' option can be kept true for debugging purposes in the live environment.
```javascript
var tds = new ThreeDS("", "", null, {
verbose: true,
//endpoint: 'https://api.3dsintegrator.com/v2.2' - Make sure that you do not override this parameter and it has the default value
});
```
--------------------------------
### Live API Endpoint Configuration
Source: https://docs.3dsintegrator.com/docs/-switching-from-sandbox-to-live
To use the Live service, ensure your API requests are directed to the correct production endpoint.
```APIDOC
## Live API Endpoint
### Description
When communicating directly with the API, for the Live environment ensure all requests go to the production endpoint.
### Method
GET, POST, PUT, DELETE, etc. (Applies to all API requests)
### Endpoint
`https://api.3dsintegrator.com/v2.2`
### Parameters
No specific parameters are defined for endpoint configuration itself, but all requests to this endpoint will require appropriate authentication and request bodies/query parameters as defined by individual API operations.
### Request Example
(Example depends on the specific API operation being called)
### Response
(Response depends on the specific API operation being called)
```
--------------------------------
### Instantiate JS SDK for Straight Sale Model (HTML)
Source: https://docs.3dsintegrator.com/docs/performance-marketing-advertisers
This snippet demonstrates how to include and instantiate the 3DS JS SDK library on a payment page. It requires your form ID and API key, and can be configured with options like the API endpoint and verbose logging for debugging. Ensure the form element with the specified ID exists on your page.
```html
```
--------------------------------
### Get Browser Screen Width JavaScript
Source: https://docs.3dsintegrator.com/reference/post_v2-2-authenticate-browser
This snippet illustrates how to get the total width of the user's screen in pixels using JavaScript. This measurement is included in the browser details for 3D Secure authentication.
```javascript
window.screen.width.toString()
```
--------------------------------
### GET /v2.2/transaction/3ri/async/{batchId}/updates
Source: https://docs.3dsintegrator.com/docs/get-results-1
Retrieves the authentication results for a given batch ID. This endpoint uses long polling and may keep the request open for up to 15 seconds.
```APIDOC
## GET /v2.2/transaction/3ri/async/{batchId}/updates
### Description
Retrieves the final authentication results after issuers have made a risk assessment. This endpoint uses a long polling technique, keeping the request open for up to 15 seconds. It is advised not to repeatedly poll if no response is received within this timeframe, as a polling rate limit is in place.
### Method
GET
### Endpoint
`/v2.2/transaction/3ri/async/{batchId}/updates`
### Parameters
#### Path Parameters
- **batchId** (string) - Required - The unique identifier for the batch of transactions.
#### Query Parameters
None
#### Request Body
None
### Request Example
```curl
curl --location 'https://api-sandbox.3dsintegrator.com/v2.2/transaction/3ri/async/INSERT-BATCHID/updates' \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "X-3DS-API-KEY: insert-api-key-here" \
-H "Authorization: insert-jwt-here" \
```
### Response
#### Success Response (200)
- **results** (array) - Contains a list of transaction results, each with details like `threeDSStatus`, `authenticationValue`, `threeDSServerTransId`, `eci`, `dsTransId`, `acsTransId`, `protocolVersion`, `status`, and `clientTransactionId`.
- **summary** (object) - Provides a summary of the processing status, including `totalProcessing`, `totalCompleted`, and `totalError`.
#### Response Example
```json
{
"results": [
{
"threeDSStatus": "Y",
"authenticationValue": "XYi1pplo2XITHfJdT21SweFz1us",
"threeDSServerTransId": "ba321194-7949-4cac-b9dd-a6f087b03fef",
"eci": "05",
"dsTransId": "d65e93c3-35ab-41ba-b307-767bfc19eae3",
"acsTransId": "ca5f9649-b865-47ce-be6f-54422a0fce47",
"protocolVersion": "2.2.0",
"status": "Y",
"clientTransactionId": "c9fc0df7-27ce-4370-b5e5-b222ab0a19f9"
}
],
"summary": {
"totalProcessing": 0,
"totalCompleted": 1,
"totalError": 0
}
}
```
#### Error Response
- **errors** (array) - Contains a list of errors, each with `errorDetail`, `threeDSServerTransId`, and `clientTransactionId`.
- **summary** (object) - Provides a summary of the processing status, including `totalProcessing`, `totalCompleted`, and `totalError`.
#### Error Response Example
```json
{
"errors": [
{
"errorDetail": "error processing 3RI authenticate request data: ValidationError: ProtocolVersion field should be between 5 and 8 characters in length",
"threeDSServerTransId": "ba321194-7949-4cac-b9dd-a6f087b03fef",
"clientTransactionId": "c9fc0df7-27ce-4370-b5e5-b222ab0a19f9"
}
],
"summary": {
"totalProcessing": 0,
"totalCompleted": 0,
"totalError": 1
}
}
```
```
--------------------------------
### 3RI Authorize Request (cURL)
Source: https://docs.3dsintegrator.com/docs/get-results-1
This cURL command demonstrates how to make a GET request to the 3RI API to initiate an authentication check. It includes necessary headers for content type, API key, and authorization.
```curl
curl --location 'https://api-sandbox.3dsintegrator.com/v2.2/transaction/3ri/async/INSERT-BATCHID/updates' \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "X-3DS-API-KEY: insert-api-key-here" \
-H "Authorization: insert-jwt-here" \
```
--------------------------------
### JS SDK Initialization
Source: https://docs.3dsintegrator.com/docs/performance-marketing-advertisers
Include and instantiate the JS SDK library on your checkout page. You need to provide your Form ID and API key.
```APIDOC
## Include and Instantiate the JS SDK Library
Include JS SDK into a page and instantiate the library.
Fill in your *form ID* and your *API key* inside the instantiating method.
1. Form ID: It's the `id="billing-form"` of your `` |
| |
| Only if Options are placed |
| `{autoSubmit: true, forcedTimout: 7, verbose: false, etc.}` |
```
--------------------------------
### Get Results
Source: https://docs.3dsintegrator.com/docs/get-results
Retrieves the final transaction results after risk assessment. This endpoint uses long polling and has a timeout of 15 seconds. It's advised to avoid repeated polling if no immediate response is received.
```APIDOC
## GET /v2.2/transaction/{transactionId}/updates
### Description
Retrieves the final transaction results after risk assessment by the issuers. This endpoint employs a long polling technique, keeping the request open for up to 15 seconds to wait for updates.
### Method
GET
### Endpoint
`/v2.2/transaction/{transactionId}/updates`
### Parameters
#### Path Parameters
- **transactionId** (string) - Required - The ID of the transaction obtained from a previous authentication response.
#### Query Parameters
None
#### Request Body
None
### Request Example
```shell
curl -X GET "https://api-sandbox.3dsintegrator.com/v2.2/transaction/insert-Transaction-ID-From-Authenticate-Response/updates" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "X-3DS-API-KEY: insert-API-Key" \
-H "Authorization: Bearer insert-JWT-From-Authenticate-Response" \
```
### Response
#### Success Response (200)
- **authenticationValue** (string) - The authentication value if the transaction is authenticated.
- **eci** (string) - Electronic Commerce Indicator.
- **status** (string) - The status of the transaction ('Y' for success, 'N' for failure, 'C' for challenge).
- **protocolVersion** (string) - The EMV 3DS protocol version used.
- **dsTransId** (string) - The unique identifier for the transaction at the Directory Server.
- **acsTransId** (string) - The unique identifier for the transaction at the Access Control Server.
- **scaIndicator** (boolean) - Indicates if Strong Customer Authentication was required.
- **acsURL** (string) - The URL for the ACS to handle the challenge flow (if status is 'C').
- **authenticationType** (string) - The type of authentication used (if status is 'C').
- **creq** (string) - The Challenge Request data (if status is 'C').
- **cardToken** (string) - A token representing the card details (if status is 'C').
#### Response Example (Success)
```json
{
"authenticationValue": "XYi1pplo2XITHfJdT21SweFz1us=",
"eci": "05",
"status": "Y",
"protocolVersion": "2.2.0",
"dsTransId": "d65e93c3-35ab-41ba-b307-767bfc19eae3",
"acsTransId": "ca5f9649-b865-47ce-be6f-54422a0fce47",
"scaIndicator": false
}
```
#### Response Example (Failed)
```json
{
"eci":"07",
"status":"N",
"protocolVersion":"2.2.0",
"dsTransId":"d65e93c3-35ab-41ba-b307-767bfc19eae3",
"acsTransId":"65973509-34be-401c-8534-9712c089a938",
"scaIndicator": false
}
```
#### Response Example (Challenge)
```json
{
"acsURL":"https://acs-server-sandbox.dev.3dsintegrator.com/v2/challenge/ui",
"authenticationType":"01",
"eci":"",
"status":"C",
"protocolVersion":"2.2.0",
"scaIndicator": false,
"creq":"eyJtZXNzYWdlVHlwZSI6IkNSZXEiLCJtZXNzYWdlVmVyc2lvbiI6IjIuMS4wIiwidGhyZWVEU1NlcnZlclRyYW5zSUQiOiIyNzljZjUwYy1lZjM2LTQzMTMtYjA0ZC05NGNlZGZhZWRmZDQiLCJhY3NUcmFuc0lEIjoiZDZmMTVhYWUtMmM5ZC00MzMzLWE5MjAtOTU0YmUwN2MwYzc2IiwiY2hhbGxlbmdlV2luZG93U2l6ZSI6IjA0In0=",
"dsTransId":"d65e93c3-35ab-41ba-b307-767bfc19eae3",
"acsTransId":"d6f15aae-2c9d-4333-a920-954be07c0c76",
"cardToken":"9346833062200088"
}
```
#### Error Response (404 Not Found)
This error occurs if the request is made too soon after authentication/fingerprinting or challenge display, before 3DS has completed processing. It is not a system error, and re-polling is advised.
#### Response Example (404 Not Found)
```json
GET https://api-sandbox.3dsintegrator.com/v2.2/transaction/43d40dbc-5675-4639-8eac-3970c2eb523d/updates 404
{
"error": "No result found for transaction as yet. Please subscribe again",
"transactionId": "43d40dbc-5675-4639-8eac-3970c2eb523d",
"correlationId": "2c75543c-34d1-4424-9e98-b303252f51c0"
}
```
```