Foloosi
  • INTRODUCTION
  • FEATURES
  • Get Started
    • Create Api Credentials
    • Checkout Page Customization
  • Payment Methods
    • Popup Payment Method
    • Hosting Payment Method
    • Saved Card Payment Method
  • CLIENT SIDE INTEGRATIONS
    • Javascript Integration
      • Create Payment Token
      • Payment Widget Initialization
      • Payment Response Handling
      • Additional Setup
      • Sample Integrations
    • PHP Integration
      • Create Payment Token
      • Payment Widget Initialization
      • Payment Response Handling
      • Additional Setup
      • Sample integrations
    • React JS Integration
      • Create payment Token
      • Payment Widget Initialization
      • Payment Response Handling
      • Additional Setup
    • Angular JS Integration
      • Create payment Token
      • Payment Widget Initialization
      • Payment Response Handling
      • Additional Setup
  • ECOMMERCE INTEGRATIONS
    • WooCommerce
    • CS Cart
    • Ecwid
    • Opencart
    • Magento
    • Prestashop
  • MOBILE SDK INTEGRATIONS
    • Android SDK
      • Initiate Payment
      • Payment Response Handling
    • iOS SDK
      • Initiate Payment
      • Payment Response Handling
    • React Native SDK
      • Make Payment
    • Flutter SDK
      • Installation
      • Make Payment
      • Sample Dart Program
  • SUBSCRIPTIONS
    • Foloosi Subscription for WooCommerce
    • Api Subscription
      • Sample Integration
    • Subscription
  • WEBHOOKS
  • PARTNER PAYOUT
  • CARD DETAILS
    • Test Cards
Powered by GitBook
On this page
  • Step - 1 - Install dependency with npm package
  • Step - 2 - Usage
  • a. Make Payment with order object
  • b. Make Payment with reference token
  • Get Reference Token
  • Support
  • Developed by
  • License

Was this helpful?

  1. MOBILE SDK INTEGRATIONS
  2. React Native SDK

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

Step - 1 - Install dependency with npm package

$ npm install react-native-foloosi --save

Step - 2 - Usage

import Foloosi from 'react-native-foloosi';

var initData = {
  merchantKey: 'YOUR_KEY', // public key
  customColor: '#AB34FD', // make payment page loading color as app color. // optional
};

Foloosi.initSDK(JSON.stringify(initData))

a. Make Payment with order object

You need to give the order id, title, description, currency code, order amount and customer details like name, email and mobile number.

// Customer field is optional.
var orderData = {
  orderAmount: 1.0, // in double format ##,###.##
  orderId: 'orderId', // unique order id
  orderDescription: 'order description', // any description. // optional
  currencyCode: 'AED',
  customerUniqueReference: 'customer reference id', // optional
  country: 'ARE', // mandatory for ios
  postalCode: '000000', //optional
  state: 'Dubai', //optional
  customer: {
    name: 'Test',
    email: '[email protected]',
    mobile: '9876543210',
    address: 'Test Adddddress', // optional
    city: 'Test City', // optional
  },
};

Use the line of code below to make payment with the order data

Foloosi.makePayment(JSON.stringify(orderData), (response) => {
  let { success, message, transaction_id } = JSON.parse(response);
  //success - type boolean
  //message - type string
  //transaction_id - type string if success is true otherwise it's null
});

b. Make Payment with reference token

Initialize api

Get Reference Token

POST https://api.foloosi.com/aggregatorapi/web/initialize-setup

Headers

Name
Type
Description

secret_key*

String

Your Merchant Key get from Foloosi Panel

Request Body

Name
Type
Description

transaction_amount*

Double

customer_unique_identifier

String

customer_mobile

String

customer_email

String

customer_name

String

currency*

String

billing_state

String

customer_city

String

customer_address

String

billing_country

String

billing_postal_code

String

{
 "message": "Application setup successfully",
 "data": {
   "reference_token":
   "U0sjdGVzdF8kMnkkMTAkM21LRi0xZGliVDhldTV4NHlZSm9tZXZobnZxWTNEVnZmay1MdHNndTNFenNBTDU0clhWYkccVE4jRkxTQVBJNWM3Njk2ZDkwOWIzNxxSVCMkMnkkMTAkQXZ4ay9wdjlpTFlYLzRSZ2FjSkxpZWhHb2o0U0wvTFpZNXAyVjRGOVFycWNQZ2lHQ3VEZ08="
  }
 }
{
    "message": "Invalid Integration settings! Kindly check both foloosi merchant application settings and your integration keys"
}
{
    "message": "Invalid secret key"
}
{
    "message": "No routes found"
}

Use the line of code below to make payment with the reference token

Foloosi.makePaymentWithReferenceToken('REFERENCE_TOKEN', (response) => {
  let { success, message, transaction_id } = JSON.parse(response);
  //success - type boolean
  //message - type string
  //transaction_id - type string if success is true otherwise it's null
});

Api Specification

  • 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

  1. This is mandatory when you are using saved card payment.

  2. This data must be Unique like email id,customer id, etc.,

Support

Developed by

Foloosi Technologies Pvt Ltd.

License

Copyrights (c) 2025 Foloosi

PreviousReact Native SDKNextFlutter SDK

Last updated 1 month ago

Was this helpful?

Visit for support requests or email to [email protected].

https://www.foloosi.com