Foloosi
Search…
Angular JS
The Foloosi Payments plugin allows you to accept credit card and debit card payments via Foloosi payment gateway in your Angular JS.

foloosi-angular

Foloosi Payment Gateway for your Online Business.

Install

with npm
1
npm install --save foloosi-angular
Copied!

Usage

Foloosi Payment Gateway uses sensible defaults, so only minimal configuration via props is necessary.

Basic configuration

How to do configuration in your Angular Project?

Step 1

Add the below script in angular-cli.json.
1
"scripts": [
2
"./node_modules/foloosi-angular/index.js"
3
]
Copied!

Step 2

In your Typescript file. follow the instructions.
To initialize the 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
window.addEventListener('message', foloosiHandler);
18
19
//To Initialize the Foloosi Payment
20
21
constructor(){
22
Foloosipay.init();
23
}
Copied!
To Open the Foloosi Payment Popup. Get the Reference Token(REFERENCE_TOKEN) from Step 3.
1
Foloosipay.open('REFERENCE_TOKEN','MERCHANT_KEY');
Copied!
To Close the Foloosi Payment Popup
1
Foloosipay.close();
Copied!

Step 3

Post the following data's in below API link to requesting reference token for accessing the payment gateway.
1
POST API LINK :
2
https://foloosi.com/api/v1/api/initialize-setup
3
4
HEADERS:
5
merchant_key : YOUR_MERCHANT_KEY
6
7
BODY:
8
redirect_url : YOUR_REDIRECT_URL
9
transaction_amount : YOUR_TRANSACTION_AMOUNT
10
currency : YOUR_CURRENCY_CODE
11
customer_name : OPTIONAL /*note : auto render in payment popup*/
12
customer_email : OPTIONAL /*note : auto render in payment popup*/
13
customer_mobile : OPTIONAL /*note : auto render in payment popup*/
14
customer_address : OPTIONAL /*note : minimize form fields in card detail page*/
15
customer_city : OPTIONAL /*note : minimize form fields in card detail page*/
Copied!
Supported Currencies areas follows : AED, USD, EUR, INR If you need optional parameters, you can add it your own data option name and values in Body. The above POST request returns the Response like below. In that response, you will get Reference Token. After that you need to assign this Reference token variable globally as mentioned in Step 1.
1
Response
2
{
3
"message": "Application setup successfully",
4
"data": {
5
"reference_token" : "YOUR_REFERENCE_TOKEN",
6
"payment_qr_data" : "YOUR_PAYMENT_QR_DATA",
7
"payment_qr_url" : "YOUR_PAYMENT_QR_URL"
8
}
9
}
Copied!

Step 4

When you click place order button our popup will be loaded so you can use below test card credentials to complete the order.
1
Card Number 4111 1111 1111 1111
2
Expiry 05/23
3
CVV 123
4
5
Card Number 4000 0000 0000 0002
6
Expiry 05/23
7
CVV 123
Copied!

Step 5 (Optional)

For Transaction List details, you can use the below Get request to get the transaction based on your merchant key.
1
GET API LINK:
2
https://foloosi.com/api/v1/api/transaction-list
3
4
HEADERS:
5
secret_key : YOUR_SECRET_KEY
Copied!
For Transaction Details, you can use the below Get request to get the transaction detail.
1
GET API LINK:
2
http://foloosi.com/api/v1/api/transaction-detail/YOUR_TRANSACTION_ID
3
4
HEADERS:
5
secret_key : YOUR_SECRET_KEY
Copied!
Last modified 9mo ago