# react-native-payfort-sdk

> The first completed React Native library for Payfort SDK integration

Latest version **1.0.10** (published 2020-01-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-native-payfort-sdk
pnpm add react-native-payfort-sdk
yarn add react-native-payfort-sdk
bun add react-native-payfort-sdk
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; large bundle.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.10 |
| Published | 2020-01-07 |
| First published | 2019-03-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 11.7 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Glenn, Chau |
| Maintainers | hoangvuong94st |
| Keywords | react-native, payfort, android, ios, payment |

## Links

- npm: https://www.npmjs.com/package/react-native-payfort-sdk
- Repository: https://github.com/crabbynguyen/RN-Payfort-SDK
- Homepage: https://github.com/crabbynguyen/RN-Payfort-SDK#readme
- Issues: https://github.com/crabbynguyen/RN-Payfort-SDK/issues
- npm.io page: https://npm.io/package/react-native-payfort-sdk

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 1.0.10 (latest) — 2020-01-07
- 1.0.9 — 2020-01-07
- 1.0.8 — 2020-01-07
- 1.0.7 — 2020-01-07
- 1.0.6 — 2019-08-01
- 1.0.5 — 2019-08-01
- 1.0.4 — 2019-06-15
- 1.0.3 — 2019-03-30
- 1.0.2 — 2019-03-30
- 1.0.1 — 2019-03-28
- 1.0.0 — 2019-03-27

## README

# react-native-payfort-sdk

## Getting started

`$ npm install react-native-payfort-sdk --save`

### Mostly automatic installation

`$ react-native link react-native-payfort-sdk`

### Add library to each platform


#### iOS

1. Extract [this](https://docs.payfort.com/docs/mobile-sdk/build/lib/PayFortSDK%201.8.zip) folder. 
2. Drag the `PayFortSDK.framework` & `PayFortSDK.bundle` to `Frameworks` in Project Navigator.
3. Create a new group `Frameworks` if it does not exist:
        * Choose Create groups for any added folders.
        * Make Sure to select Copy files if needed.
4. Set `-ObjC` in the Other Linker Flags in the `Target` → `Build Settings` Tab.
5. For Swift Projects Don’t forget to add the `#import` to the `Bridging-Header.h`

#### Android

1. Extract [this](https://docs.payfort.com/docs/mobile-sdk/build/lib/FORTSDKv1.5.zip) folder.
2. In Android Studio, choose `File` → `New` → `New Module` then select `Import .JAR\.AAR Package`.
3. In the next step, find to the path of .aar file in library folder and press `Finish`.


## Usage

#### First, you have to read the [document](https://docs.payfort.com/docs/mobile-sdk/build/index.html#before-starting-the-integration-section-in-the-api) from Payfort carefully

```javascript
import RNReactNativePayfortSdk from 'react-native-payfort-sdk';

let data = {};
data['access_code'] = 'abcdxyzqwerty';          // require field
data['merchant_identify'] = 'poilkjyhm';        // require field
data['request_phrase'] = 'tgbvfe';              // require field
data['customer_email'] = 'v@example.com';       // require field
data['currency'] = 'USD';                       // require field
data['amount'] = '10';                          // require field
data['merchant_reference'] = '123456';          // require field
data['customer_name'] = 'Glenn';
data['customer_ip'] = '27.79.60.231';
data['payment_option'] = 'VISA';
data['order_description'] = 'Order for testing';

RNReactNativePayfortSdk.openPayfort(data, (response) => {
    console.log(response);
}, (message) => {
    // Message in case payment is failure or cancel
});
```

---
_Source: https://npm.io/package/react-native-payfort-sdk · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
