Event Listeners
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 one of these values - SUCCESS or ERROR or INITIATED.
- 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.
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.
For React native with Javascript SDK, the Pay3 Payment publishes the events using window.ReactNativeWebView.postMessage(string payload). These events are available via onMessage handler of the WebView