Comment on page
Make Payment
This Section briefs about how to initiate a payment !
Foloosi's React Native SDK provides easy payment collections.
You can use it on the front-end to open payment page or use the actual flow to create Payment Token
$ npm install react-native-foloosi --save
1
import Foloosi from 'react-native-foloosi';
2
3
var initData = {
4
merchantKey: 'YOUR_KEY', // public key
5
customColor: '#AB34FD', // make payment page loading color as app color. // optional
6
};
7
8
Foloosi.initSDK(JSON.stringify(initData))
You need to give the order id, title, description, currency code, order amount and customer details like name, email and mobile number.
1
// Customer field is optional.
2
var orderData = {
3
orderAmount: 1.0, // in double format ##,###.##
4
orderId: 'orderId', // unique order id
5
orderDescription: 'order description', // any description. // optional
6
currencyCode: 'AED',
7
customerUniqueReference: 'customer reference id', // optional
8
country: 'ARE', // mandatory for ios
9
postalCode: '000000', //optional
10
state: 'Dubai', //optional
11
customer: {
12
name: 'Test',
13
email: '[email protected]',
14
mobile: '9876543210',
15
address: 'Test Adddddress', // optional
16
city: 'Test City', // optional
17
},
18
};
Use the line of code below to make payment with the order data
1
Foloosi.makePayment(JSON.stringify(orderData), (response) => {
2
let { success, message, transaction_id } = JSON.parse(response);
3
//success - type boolean
4
//message - type string
5
//transaction_id - type string if success is true otherwise it's null
6
});
post
https://api.foloosi.com/aggregatorapi/web/initialize-setup
Get Reference Token
Use the line of code below to make payment with the reference token
1
Foloosi.makePaymentWithReferenceToken('REFERENCE_TOKEN', (response) => {
2
let { success, message, transaction_id } = JSON.parse(response);
3
//success - type boolean
4
//message - type string
5
//transaction_id - type string if success is true otherwise it's null
6
});
- Request call must be on POST.
- This Api will be used to confirm the feature you are about to Use.
- For Saved Card Payment Method, You need to pass your customer unique details like email,etc. to customer_unique_identifier.
Post Request Body
Name | Description |
---|---|
customer_unique_identifier |
|
Foloosi Technologies Pvt Ltd.
Copyrights (c) 2022 Foloosi