Overview
Lifecycle
When you trigger the 3DS2 authentication on an account or transaction, the OpenTransact SDK starts a multistep workflow for performing the authentication according to the specification. Javascript events will be fired at the following steps of the lifecycle of that workflow which can help you to implement messaging to your customer and error handling within your application.
Read more about the specific events in the Javascript SDK API Docs
Use Cases
For all of these examples, the assumption is that you have instantiated the OpenTransact client and fetched the object that will trigger the authentication(account
or transaction
) in some way
Adding an Account within a Payment Flow
let threeDSecureOptions = {
"channel": 'browser',
"session": {
"accept-header": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
"authentication": {
"method": 'credentials',
"timestamp": "2020-11-01T12:00:00.000Z"
}
},
"payment": {
"type": 'goods-services',
"amount": 1000,
"precision": 2,
"currency": "EUR"
},
"account": {
"status": 'new',
"last-updated": "2020-11-01T12:00:00Z",
"created": "2020-11-01T12:00:00Z",
"password-last-updated": "2020-11-01T12:00:00Z"
},
"delivery": {
"method": 'same-day',
"destination": 'billing-address',
"email-address-id": "e9781557-ed78-46f1-aa6d-ac8e0212b139",
}
}
let response = await client.triggerThreeDSecure(account, threeDSecureOptions)
Creating a One-Time Transaction for a previously vaulted account
let threeDSecureOptions = {
"channel": 'browser',
"session": {
"accept-header": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
"authentication": {
"method": 'credentials',
"timestamp": "2020-11-01T12:00:00Z"
}
},
"payment": {
"type": 'goods-services',
"amount": 1000,
"precision": 2,
"currency": "EUR"
},
"account": {
"status": 'new',
"last-updated": "2020-11-01T12:00:00Z",
"created": "2020-11-01T12:00:00Z",
"password-last-updated": "2020-11-01T12:00:00Z"
},
"delivery": {
"method": 'same-day',
"destination": 'billing-address',
"email-address-id": "e9781557-ed78-46f1-aa6d-ac8e0212b139",
}
}
let response = await client.triggerThreeDSecure(transaction, threeDSecureOptions)
Adding an Account
let threeDSecureOptions = {
"channel": 'browser',
"session": {
"accept-header": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
"authentication": {
"method": 'credentials',
"timestamp": "2020-11-01T12:00:00Z"
}
},
"account": {
"status": 'new',
"last-updated": "2020-11-01T12:00:00Z",
"created": "2020-11-01T12:00:00Z",
"password-last-updated": "2020-11-01T12:00:00Z"
}
let response = await client.triggerThreeDSecure(account, threeDSecureOptions)
Updating an Account
let threeDSecureOptions = {
"channel": 'browser',
"session": {
"accept-header": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
"authentication": {
"method": 'credentials',
"timestamp": "2020-11-01T12:00:00Z"
}
},
"payment": {
"type": 'goods-services',
"amount": 1000,
"precision": 2,
"currency": "EUR"
},
"account": {
"status": 'new',
"last-updated": "2020-11-01T12:00:00Z",
"created": "2020-11-01T12:00:00Z",
"password-last-updated": "2020-11-01T12:00:00Z"
},
"delivery": {
"method": 'same-day',
"destination": 'billing-address',
"email-address-id": "e9781557-ed78-46f1-aa6d-ac8e0212b139",
}
}
let response = await client.triggerThreeDSecure(account, threeDSecureOptions)
Adding an Account within a Subscription Enrollment Flow
let threeDSecureOptions = {
"channel": 'browser',
"session": {
"accept-header": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
"authentication": {
"method": 'credentials',
"timestamp": "2020-11-01T12:00:00Z"
}
},
"payment": {
"type": 'gods-services',
"amount": 1000,
"precision": 2,
"currency": "EUR",
"subscription": {
"identifier": "abcdef",
"expiration": "2021-12-01",
"minimum-frequency": 28
}
},
"account": {
"status": 'new',
"last-updated": "2020-11-01T12:00:00Z",
"created": "2020-11-01T12:00:00Z",
"password-last-updated": "2020-11-01T12:00:00Z"
},
"delivery": {
"method": 'same-day',
"destination": 'billing-address',
"email-address-id": "e9781557-ed78-46f1-aa6d-ac8e0212b139"
}
}
let response = await client.triggerThreeDSecure(account, threeDSecureOptions)
Starting a Subscription with a previously stored account
let threeDSecureOptions = {
"channel": 'browser',
"session": {
"accept-header": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
"authentication": {
"method": 'credentials',
"timestamp": "2020-11-01T12:00:00Z"
}
},
"payment": {
"type": 'goods-services',
"amount": 1000,
"precision": 2,
"currency": "EUR",
"subscription": {
"identifier": "abcdef",
"expiration": "2021-12-01",
"minimum-frequency": 28
}
},
"account": {
"status": 'new',
"last-updated": "2020-11-01T12:00:00Z",
"created": "2020-11-01T12:00:00Z",
"password-last-updated": "2020-11-01T12:00:00Z"
},
"delivery": {
"method": 'same-day',
"destination": 'billing-address',
"email-address-id": "e9781557-ed78-46f1-aa6d-ac8e0212b139"
}
}
let response = await client.triggerThreeDSecure(transaction, threeDSecureOptions)