Giter VIP home page Giter VIP logo

cashfree / react-native-cashfree-pg-sdk Goto Github PK

View Code? Open in Web Editor NEW
7.0 2.0 11.0 586 KB

Sample app demonstrating integration of Cashfree's payment gateway in your React native project

Home Page: https://docs.cashfree.com/docs/react-native-integration

License: MIT License

Shell 0.17% Java 23.63% JavaScript 24.16% TypeScript 22.66% Objective-C 3.93% Swift 20.68% Ruby 3.42% Objective-C++ 1.34%
bnpl card cardless-emi cashfree emi net-banking payment-gateway payment-integration payments upi

react-native-cashfree-pg-sdk's Introduction

react-native-cashfree-pg-sdk

GitHub Discord GitHub last commit (branch) GitHub release (with filter) npm GitHub forks GitHub Repo stars

The Cashfree React Native SDK allows you to integrate Cashfree Payment Gateway into your application and start collecting payments from your customers. The React Native SDK has been designed to minimise the complexity of handling and integrating payments in your React Native project.

Click here for more Documentation.

Installation

npm install react-native-cashfree-pg-sdk

iOS

Add the following code to application's info.plist file.

<key>LSApplicationCategoryType</key>
<string></string>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>phonepe</string>
<string>tez</string>
<string>paytm</string>
<string>bhim</string>
</array>

Usage

import {
  CFCallback,
  CFErrorResponse,
  CFPaymentGatewayService,
} from 'react-native-cashfree-pg-sdk';
import {
  CFDropCheckoutPayment,
  CFEnvironment,
  CFSession,
  CFThemeBuilder,
} from 'cashfree-pg-api-contract';

// ...

try {
  const session = new CFSession(
    'order_token',
    'order_id',
    CFEnvironment.SANDBOX
  );
  const theme = new CFThemeBuilder()
    .setNavigationBarBackgroundColor('#E64A19')
    .setNavigationBarTextColor('#FFFFFF')
    .setButtonBackgroundColor('#FFC107')
    .setButtonTextColor('#FFFFFF')
    .setPrimaryTextColor('#212121')
    .setSecondaryTextColor('#757575')
    .build();
  const dropPayment = new CFDropCheckoutPayment(session, null, theme);
  CFPaymentGatewayService.doPayment(dropPayment);
} catch (e: any) {
  console.log(e.message);
}

Contributing

If you want to contribute please read the Contributing guidelines.

License

The Cashfree React Native SDK is licensed under the MIT License.
See the LICENSE file distributed with this work for additional
information regarding copyright ownership.

Except as contained in the LICENSE file, the name(s) of the above copyright
holders shall not be used in advertising or otherwise to promote the sale,
use or other dealings in this Software without prior written authorization.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.