Comment on page
Payment Response Handling
Let's see how to handle payment response !
Foloosi payments has two types of responses,
- Foloosi handler for Popup Payment method.
- Request post object for Hosting Payment method.
React gives you the handlers for Payment status and details.
After the Payment is done, the line below sends Payment Details and Payment Status to foloosiHandler function.
window.addEventListener('message', this.foloosiHandler);
/* Foloosi handler for payment response handling
* Add the below code inside the script tag to handle payment response
*/
foloosiHandler(e){
if(e.data.status == 'success'){
//responde success code
//console.log(e.data.status);
//console.log(e.data.data.transaction_no);
}
if(e.data.status == 'error'){
//responde success code
//console.log(e.data.status);
//console.log(e.data.data.payment_status);
}
if(e.data.status == 'closed'){
//Payment Popup Closed
//console.log(e.data);
}
};
//sample post response
{
"status": "success",
"data": {
"amount": 12.00,
"currency": "AED",
"transaction_no": "FLSXXXXXXXXXXABC",
"optional1": "additional_field",
"optional2": "additional_field",
"optional3": "additional_field",
}
}
NOTE
Supports 170 World Currencies
Foloosi Technologies Pvt Ltd.
Copyrights (c) 2022 Foloosi
Last modified 1yr ago