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
Rupay.onEvent(event, callback)
Example
Rupay.onEvent("EVENT_BEFORE_INITIATE_AUTHENTICATION", function (data) { //The data argument of the callback will provide the Rupay 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 Rupay API:
- EVENT_BEFORE_INITIATE_AUTHENTICATION
- EVENT_AFTER_INITIATE_AUTHENTICATION
- EVENT_BEFORE_AUTHENTICATE_PAYER
- EVENT_AFTER_AUTHENTICATE_PAYER
Return Value
None