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
- Extract this folder.
- Drag the
PayFortSDK.framework
&PayFortSDK.bundle
toFrameworks
in Project Navigator. - 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. - Set
-ObjC
in the Other Linker Flags in theTarget
→Build Settings
Tab. - For Swift Projects Don’t forget to add the
#import
to theBridging-Header.h
Android
- Extract this folder.
- In Android Studio, choose
File
→New
→New Module
then selectImport .JAR\.AAR Package
. - In the next step, find to the path of .aar file in library folder and press
Finish
.
Usage
document from Payfort carefully
First, you have to read the; let data = {};data'access_code' = 'abcdxyzqwerty'; // require fielddata'merchant_identify' = 'poilkjyhm'; // require fielddata'request_phrase' = 'tgbvfe'; // require fielddata'customer_email' = 'v@example.com'; // require fielddata'currency' = 'USD'; // require fielddata'amount' = '10'; // require fielddata'merchant_reference' = '123456'; // require fielddata'customer_name' = 'Glenn';data'customer_ip' = '27.79.60.231';data'payment_option' = 'VISA';data'order_description' = 'Order for testing'; RNReactNativePayfortSdk;