onEvent()

Method to subscribe for event changes. Subscribing to the events will enable the integration code to listen for state changes during the payment flows. The data argument of the callback will provide the ThreeDS method that was used to initiate the payment.

Usage

ThreeDS.onEvent(event, callback)

Example

ThreeDS.onEvent("EVENT_BEFORE_INITIATE_AUTHENTICATION", function (data) {
    //The data argument of the callback will provide the ThreeDS method that was used to initiate the payment
});
  

Arguments

event Enumeration COMPULSORY

Event to subscribe to. See supported events list below.

callback Function COMPULSORY

The callback function

Events Names Constants

Here is the list of events currently supported by the ThreeDS API:

  • EVENT_BEFORE_INITIATE_AUTHENTICATION
  • EVENT_AFTER_INITIATE_AUTHENTICATION
  • EVENT_BEFORE_AUTHENTICATE_PAYER
  • EVENT_AFTER_AUTHENTICATE_PAYER

Return Value

None

Copyright © 2023 MasterCard