Comment on page
Payment Widget Initialization
Payment is always handled on foloosi's payment screen !
npm install --save foloosi-angular
Add the script below in angular-cli.json.
"scripts": [
"./node_modules/foloosi-angular/index.js"
]
Follow these instructions in your Typescript file to initialize Foloosi Payment.
1
//To Declare the Foloosi Payment
2
3
declare var Foloosipay: any;
4
5
// For Success and Error Handlers. You can get the Payment status in the below function, it may be success or error.
6
7
const foloosiHandler = ( function (e) {
8
if (e.data.status == 'success') {
9
console.log(e.data.status);
10
console.log(e.data);
11
}
12
if (e.data.status == 'error') {
13
console.log(e.data.status);
14
console.log(e.data);
15
}
16
});
17
18
window.addEventListener('message', foloosiHandler);
19
20
//To Initialize the Foloosi Payment
21
22
constructor(){
23
Foloosipay.init();
24
}
If you want to enable payment in <iframe> which only supports Credit/Debit cards, you need not pass the REDIRECT parameter.
Foloosipay.open('REFERENCE_TOKEN','MERCHANT_KEY');
If you want to enable hosting payment which supports ApplePay and SamsungPay, you need to pass REDIRECT as true.
Foloosipay.open('REFERENCE_TOKEN','MERCHANT_KEY','REDIRECT');
To Close the Foloosi Payment Popup Use,
Foloosipay.close();
Note - It is mandatory to set REDIRECT to true
- Add the additional field shown below in the post data of initialize Api
- // additional Post Datasite_return_url : "", //your site return url for get the payment response object
- Add the additional field shown below in the post data of initialize Api
// additional Post Data
customer_unique_identifier : "Unique value",/** MANDATORY FIELD -Customer Unique Reference value should be email/mobile no/uniqueCustomer id from your DB*/
Foloosi Technologies Pvt Ltd.
Copyrights (c) 2022 Foloosi
Last modified 1yr ago