Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rummykhan/react-native-payfort
Payfort SDK for React Native (Android Only)
https://github.com/rummykhan/react-native-payfort
android payfort react-native sdk
Last synced: 15 days ago
JSON representation
Payfort SDK for React Native (Android Only)
- Host: GitHub
- URL: https://github.com/rummykhan/react-native-payfort
- Owner: rummykhan
- Created: 2018-11-17T02:42:02.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2018-11-20T06:48:13.000Z (about 6 years ago)
- Last Synced: 2024-12-19T13:02:18.514Z (about 1 month ago)
- Topics: android, payfort, react-native, sdk
- Language: Java
- Homepage:
- Size: 222 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# React Native Payfort (Android Only)
### Install
`$ npm install react-native-payfort --save`
### Automatic Installation
`$ react-native link react-native-payfort`
### Usage
`NativeFort` exposes some constants for Payfort Commands, Currency and Languages
```javascript
import NativeFort from 'react-native-payfort';
let merchantID = "xxxxx";
let accessCode = "xxxxx";
let shaRequest = "xxxxx";
let shaResponse = "xxxxx";NativeFort.sendCommand(
NativeFort.COMMAND_PURCHASE,
"2000",
NativeFort.CURRENCY_SAR,
"[email protected]",
NativeFort.LANGUAGE_EN,
merchantID,
accessCode,
shaRequest,
shaResponse,
true,
).then(function(response){
console.log(response);
}).catch(function(error){
console.log(error);
});```
#### Response Format
```json
{
"amount":"2000",
"response_code":"14000",
"card_number":"400555******0001",
"card_holder_name":"Visa",
"payment_option":"VISA",
"expiry_date":"2105",
"customer_ip":"4.8.1.2",
"eci":"ECOMMERCE",
"language":"en",
"fort_id":"154244999500011151",
"command":"PURCHASE",
"response_message":"Success",
"sdk_token":"7A63FCACAC1E23CBE053321E320AED27",
"authorization_code":"819341",
"merchant_reference":"1542450845349",
"customer_email":"[email protected]",
"token_name":"79D4D15A30DE2401E053321E320A16E2",
"currency":"SAR",
"status":"14"
}
```#### Constants
```javascript// Commands
NativeFort.COMMAND_PURCHASE,
NativeFort.COMMAND_AUTHORIZATION,// Currencies
NativeFort.CURRENCY_AED,
NativeFort.CURRENCY_SAR,// Languages
NativeFort.LANGUAGE_EN,
NativeFort.LANGUAGE_AR,```
#### Signature for sendCommand
```javscript
NativeFort.sendCommand(
String payfortCommand,
String amount, // you have to multiply the value with the currency decimal code according to ISO code 3. e.g. if amount is 2 multiply it by 100 and then pass
String currency,
String email,
String language,
String payfortMerchantID,
String payfortAccessCode,
String payfortShaRequest,
String payfortShaResponse,
boolean isSandbox
)```
### Contact
[[email protected]](mailto:[email protected])