Callback URL
The application can call transaction functions using an optional parameter called callbackUrl. Once this parameter is set Pay3 payment modal will redirect the user to this URL with in couple of seconds after transaction is complete. Pay3 payment modal also added an additional parameter data as a query parameter so that your user can be shown the transaction result within this page.
This works well with the mode=redirect or mode=returnUrl where Pay3 will not be able to send Javascript events to the starting page.
Example
Payment results are added to the callbackUrl using a parameter data. The value of the parameter is a base64 encoded, JSON string of the result.
Sample code to decode the data payload
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 Application
The domain of the callback URL needs to be whitelisted for the clientId. Please reach out to support if you see following error. The domain needs to be whitelisted. According to the above example https://your-whitelisted-url.com needs to be whitelisted.
![Image of domain not whitelisted error Image of domain not whitelisted error](https://images.archbee.com/9JcgbaqQe2mz216pCFoHU/TAFeEm-pVk18eerzEFtTV_screenshot-2024-06-26-at-40348-pm.png?format=webp)