Pay3 Javascript SDK
Callback URL
4min
introduction 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 const checkoutobj = { "requestid" requestid, "user" { "email" "user\@email address" }, "payment" \[ { "amount" "20 25", "name" "brl bz", } ], "mode" "redirect", "callbackurl" "https //your whitelisted url com/xyz" }; pay3pay opencheckout(checkoutobj); payment results 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 // after completing transaction, pay3 payment modal will redirect // to callbackurl for example // https //your whitelisted url com/xyz?data=eyjkyxrhijp7inn0yxr1cyi6ilnvq0nfu1milcjtzxnzywdlijoivhjhbnnhy3rpb24gy29tcgxldgvkihn1y2nlc3nmdwxsesisim9yzgvyswqioiiwowq4mzc1zi04mduxltqyntctywi0nc1hnty1ogizntbizdmilcjyzxf1zxn0swqiojq2odg3nywicmvjzwlwdci6inr4bljly2vpchqifx0= data='eyjkyxrhijp7inn0yxr1cyi6ilnvq0nfu1milcjtzxnzywdlijoivhjhbnnhy3rpb24gy29tcgxldgvkihn1y2nlc3nmdwxsesisim9yzgvyswqioiiwowq4mzc1zi04mduxltqyntctywi0nc1hnty1ogizntbizdmilcjyzxf1zxn0swqiojq2odg3nywicmvjzwlwdci6inr4bljly2vpchqifx0='; resultobj = json parse(atob(data)); / { "data" { "status" "success", "message" "transaction completed successfully", "orderid" "09d8375f 8051 4257 ab44 a5658b350bd3", "requestid" 468877, "receipt" "txnreceipt" } } / 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 whitelisting of callback url 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