Links
Comment on page

Sample Integrations

Sample Integrations

Just paste the code below inside the body tag and enter your valid data to start using Popup Payment Method
1
<script type="text/javascript" src="https://www.foloosi.com/js/foloosipay.v2.js"></script>
2
<script>
3
// post data for create order id
4
data = {
5
transaction_amount : YOUR_TRANSACTION_AMOUNT,
6
currency : YOUR_CURRENCY_CODE,
7
customer_name : OPTIONAL ,/*note : auto render in payment popup*/
8
customer_email : OPTIONAL, /*note : auto render in payment popup*/
9
customer_mobile : OPTIONAL ,/*note : auto render in payment popup*/
10
customer_address : OPTIONAL ,/*note : minimize form fields in card detail page*/
11
customer_city : OPTIONAL /*note : minimize form fields in card detail page*/
12
}
13
let fetchRes = fetch(
14
"https://api.foloosi.com/aggregatorapi/web/initialize-setup",{
15
method: 'POST',
16
headers: {
17
'Content-Type': 'application/json',
18
'merchant_key': 'YOUR_MERCHANT_KEY' /** get the merchant key from foloosi panel*/
19
},
20
body: JSON.stringify(data)
21
});
22
23
fetchRes.then(res =>
24
res.json()).then(d => {
25
console.log(d.data);
26
var options = {
27
"reference_token" : d.data.reference_token, //which is get from step2
28
"merchant_key" : "YOUR_MERCHANT_KEY",/** get the merchant key from foloosi panel*/
29
}
30
var fp1 = new Foloosipay(options);
31
fp1.open();
32
})
33
foloosiHandler(response, function (e) {
34
if(e.data.status == 'success'){
35
//responde success code
36
//console.log(e.data.status);
37
//console.log(e.data.data.transaction_no);
38
}
39
if(e.data.status == 'error'){
40
//responde success code
41
//console.log(e.data.status);
42
//console.log(e.data.data.payment_status);
43
}
44
if(e.data.status == 'closed'){
45
//Payment Popup Closed
46
//console.log(e.data);
47
}
48
});
49
</script>

Hosting payment method sample code

Just paste the code below inside the body tag and enter your valid data to start using Redirect Payment Method
1
<script type="text/javascript" src="https://www.foloosi.com/js/foloosipay.v2.js"></script>
2
<script>
3
//post data for create order id
4
data = {
5
transaction_amount : YOUR_TRANSACTION_AMOUNT,
6
currency : YOUR_CURRENCY_CODE,
7
customer_name : OPTIONAL ,/*note : auto render in payment popup*/
8
customer_email : OPTIONAL ,/*note : auto render in payment popup*/
9
customer_mobile : OPTIONAL ,/*note : auto render in payment popup*/
10
customer_address : OPTIONAL ,/*note : minimize form fields in card detail page*/
11
customer_city : OPTIONAL ,/*note : minimize form fields in card detail page*/
12
site_return_url: YOUR_REDIRECTION_URL /*note : you need to pass your redirect url */
13
optional1: ADDITIONAL FIELD/*note : you can pass additional fields in it.*/
14
optional2: ADDITIONAL FIELD/*note : you can pass additional fields in it.*/
15
}
16
let fetchRes = fetch(
17
"https://api.foloosi.com/aggregatorapi/web/initialize-setup",{
18
method: 'POST',
19
headers: {
20
'Content-Type': 'application/json',
21
'merchant_key': 'YOUR_MERCHANT_KEY' /** get the merchant key from foloosi panel*/
22
},
23
body: JSON.stringify(data)
24
});
25
26
fetchRes.then(res =>
27
res.json()).then(d => {
28
console.log(d.data);
29
var options = {
30
"reference_token" : d.data.reference_token, //which is get from step2
31
"merchant_key" : "YOUR_MERCHANT_KEY",/** get the merchant key from foloosi panel*/
32
"redirect" : true
33
}
34
var fp1 = new Foloosipay(options);
35
fp1.open();
36
})
37
</script>
Note,
Apple Pay and Samsung pay options are available only for Hosting Payment Method.
Site must be https with proper SSL certificate.

Support

Visit https://www.foloosi.com for support requests or email to [email protected].

Developed by

Foloosi Technologies Pvt Ltd.

License

Copyrights (c) 2022 Foloosi