Skip to main content

Documentation Index

Fetch the complete documentation index at: https://bancofcalifornia-preview.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

ThreeDSecureUI.on(string eventName, func callback): undefined

Description

Attaches an event listener that is invoked when the given event occurs.

Parameters

event One of the following:
  • failure
  • challenge
  • complete
  • error
callback A function that accepts an event object as a parameter.

Events:

Failure

This event indicates that the cardholder could not be authenticated.
const gateway = Gateway.create('collect_checkout_0000000000000000000000000');
const threeDsService = gateway.get3DSecure();
const threeDSecureUI = threeDsService.createUI({ ... })
threeDSecureUI.on('failure', (e) => { console.log(e) })

/*
 *  {
 *     code: 'TRANSACTION_STATUS_N',
 *     message: 'Not Authenticated/Account Not Verified; Transaction denied',
 *  }
 * /

Challenge

This event indicates that step up authentication has started and the user will need to complete a challenge. When this occurs, the UI will automatically resize.
const gateway = Gateway.create('collect_checkout_0000000000000000000000000');
const threeDsService = gateway.get3DSecure();
const threeDSecureUI = threeDsService.createUI({ ... })
threeDSecureUI.on('challenge', (e) => { console.log(e) })

/*
 *  {}
 * /

Complete

This indicates successful 3DS authentication has occurred.
const gateway = Gateway.create('collect_checkout_0000000000000000000000000');
const threeDsService = gateway.get3DSecure();
const threeDSecureUI = threeDsService.createUI({ ... })
threeDSecureUI.on('complete', (e) => { console.error(e) })

/*
 * {
 *  xid: null,
 *  cavv: "Y2FyZGluYWxjb21tZXJjZWF1dGg=",
 *  eci: "05",
 *  cardHolderAuth: "verified",
 *  threeDsVersion: "2.2.0",
 *  directoryServerId: "3f6fb1f8-f719-46c9-905b-bab446f4de30"
  *  cardHolderInfo: null,
 * }
 * /
VariableDescriptionWhen Received
cavvCardholder Authentication Verification Value The value that signifies that a customer was successfully authenticated.On all successful authentications
xidA transaction identifier from authentication processingOccasionally provided for some card brands
directoryServerIdA transaction identifier assigned by the directory server.On all successful 3DS2 authentications
eciA number that indicates the result of the attempt to authenticate the cardholder. Values are dependent on the card brand.On successful authentications
cardHolderAuthA string describing if a customer was successfully verified or attempted. “verified” indicates that a cardholder’s bank successfully verified the user. “attempted” indicates that a cardholder is enrolled in 3DS, but their bank does not support 3DS. Examples: verified, attemptedOn successful authentications
threeDsVersionDetermines which version of 3DS was used. Examples: 1.0.2, 2.1.0, 2.2.0On all successful authentications

Error

const gateway = Gateway.create('collect_checkout_0000000000000000000000000');
const threeDsService = gateway.get3DSecure();
const threeDSecureUI = threeDsService.createUI({ ... })
threeDSecureUI.on('error', (e) => { console.error(e) })

/*
 *  {
 *     refId: '1234',
 *     message: 'Invalid Formatted Message Invalid Formatted Message',
 *     type: 'gatewayError',
 *     error: new Error('Invalid Formatted Message Invalid Formatted Message')
 *  }
 * /