Event Listeners
7min
After completing transactions in Pay3 SDK UI, the Pay3 SDK publishes events to App.
This event is fired by Pay3 SDK in following scenario:
- On completion of Checkout transaction triggered by pay3.openCheckout()
Payload
- data (Type Object): Following keys are present in this object
- status (Type string): The status can have values SUCCESS or ERROR.
- message (Type string): User-friendly message returned after completion of the transaction.
- orderId (Type string): Pay3 Order ID.
- requestId (Type string): Unique id passed by App.
- error (Type Object, Optional): Following keys will be present if there is an error. Please refer to SDK Errors for reference.
- code (Type number): Error code.
- message (Type string): Error message.
This function registers a callback, which is invoked when the given event type is received from Pay3.
Parameter
- eventName (Type string): Name of the event for which we want to register the callback
- callbackFn (Type function): Callback function accepting a parameter payload.
This function returns true if the event already has a registered callback.
Parameter
- eventName (Type string): Name of the event for which we want to test if the callback is registered.
Return (Type boolean)
This function removes a function that is already registered as a callback. Input of this function needs to be the same as that was provided in pay3Pay.on function call.
Parameter
- eventName (Type string): Name of the event for which we want to register the callback
- callbackFn (Type function): Callback function accepting a parameter payload.
Updated 12 Feb 2024
Did this page help you?