An open API service indexing awesome lists of open source software.

https://github.com/cashfree/react-native-cashfree-pg-sdk

Sample app demonstrating integration of Cashfree's payment gateway in your React native project
https://github.com/cashfree/react-native-cashfree-pg-sdk

bnpl card cardless-emi cashfree emi net-banking payment-gateway payment-integration payments upi wallets

Last synced: 4 months ago
JSON representation

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

Awesome Lists containing this project

README

          

# react-native-cashfree-pg-sdk

![GitHub](https://img.shields.io/github/license/cashfree/react-native-cashfree-pg-sdk) ![Discord](https://img.shields.io/discord/931125665669972018?label=discord) ![GitHub last commit (branch)](https://img.shields.io/github/last-commit/cashfree/react-native-cashfree-pg-sdk/master) ![GitHub release (with filter)](https://img.shields.io/github/v/release/cashfree/react-native-cashfree-pg-sdk?label=latest) ![npm](https://img.shields.io/npm/v/react-native-cashfree-pg-sdk) ![GitHub forks](https://img.shields.io/github/forks/cashfree/react-native-cashfree-pg-sdk) ![GitHub Repo stars](https://img.shields.io/github/stars/cashfree/react-native-cashfree-pg-sdk)

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](https://docs.cashfree.com/docs/react-native-integration) for more Documentation.

## Installation

```sh
npm install react-native-cashfree-pg-sdk
```

### iOS
Add the following code to application's info.plist file.
```xml
LSApplicationCategoryType

LSApplicationQueriesSchemes

phonepe
tez
paytm
bhim

```

## Usage

```js
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](CONTRIBUTING.md) 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.