{"id":19040129,"url":"https://github.com/logisticinfotech/react-native-payfort-sdk","last_synced_at":"2025-04-23T21:06:31.578Z","repository":{"id":39787754,"uuid":"229726539","full_name":"logisticinfotech/react-native-payfort-sdk","owner":"logisticinfotech","description":"A library for react native payfort  SDK.","archived":false,"fork":false,"pushed_at":"2021-11-23T10:20:41.000Z","size":5798,"stargazers_count":7,"open_issues_count":13,"forks_count":10,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-23T21:06:30.785Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/logisticinfotech.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-12-23T10:08:12.000Z","updated_at":"2023-10-25T13:32:30.000Z","dependencies_parsed_at":"2022-07-14T03:40:40.806Z","dependency_job_id":null,"html_url":"https://github.com/logisticinfotech/react-native-payfort-sdk","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logisticinfotech%2Freact-native-payfort-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logisticinfotech%2Freact-native-payfort-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logisticinfotech%2Freact-native-payfort-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logisticinfotech%2Freact-native-payfort-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/logisticinfotech","download_url":"https://codeload.github.com/logisticinfotech/react-native-payfort-sdk/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250514782,"owners_count":21443209,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-08T22:20:42.602Z","updated_at":"2025-04-23T21:06:31.556Z","avatar_url":"https://github.com/logisticinfotech.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"left\"\u003e\n\u003ca href=\"https://www.npmjs.com/package/@logisticinfotech/react-native-payfort-sdk\"\u003e\u003cimg alt=\"npm version\" src=\"https://img.shields.io/badge/npm-v1.0.15-green.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://www.npmjs.com/package/@logisticinfotech/react-native-payfort-sdk\"\u003e\u003cimg src=\"https://img.shields.io/badge/downloads-%3E1K-yellow.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://www.npmjs.com/package/@logisticinfotech/react-native-payfort-sdk\"\u003c\u003e\u003cimg src=\"https://img.shields.io/badge/license-MIT-orange.svg\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n# @logisticinfotech/react-native-payfort-sdk\n\n## Getting started\n\n`$ npm install @logisticinfotech/react-native-payfort-sdk --save`\n\n### Mostly automatic installation\n\n`$ react-native link @logisticinfotech/react-native-payfort-sdk`\n\n### Manual installation\n\n#### iOS\n\n1. In XCode, in the project navigator, right click `Libraries` ➜ `Add Files to [your project's name]`\n2. Go to `node_modules` ➜ `@logisticinfotech/react-native-payfort-sdk` and add `PayFort.xcodeproj`\n3. In XCode, in the project navigator, select your project. Add `libPayFort.a` to your project's `Build Phases` ➜ `Link Binary With Libraries`\n4. Run your project (`Cmd+R`)\u003c\n\n#### Android\n\n1. Open up `android/app/src/main/java/[...]/MainActivity.java`\n\n- Add `import com.RNPayfortSdk.RNPayfortSdkPackage;` to the imports at the top of the file\n- Add `new RNPayfortSdkPackage()` to the list returned by the `getPackages()` method\n\n2. Append the following lines to `android/settings.gradle`:\n\n   ```\n   include ':@logisticinfotech/react-native-payfort-sdk'\n   project(':@logisticinfotech/react-native-payfort-sdk').projectDir = new File(rootProject.projectDir,     '../node_modules/@logisticinfotech/react-native-payfort-sdk/android')\n   ```\n\n3. Insert the following lines inside the dependencies block in `android/app/build.gradle`:\n\n   ```\n     compile project(':@logisticinfotech/react-native-payfort-sdk')\n   ```\n\n## Steps to follow before use\n\n### Android\n\n1. Download PayFort module file from [here](https://docs.payfort.com/docs/api/build/lib/FORTSDKv1.5.zip).\n2. Extract FORTSDKv1.5.zip.\n3. Open directory of android of your react native project in Android Studio.\n4. Click on File → New → New Module→ Select \"Import .JAR/.AAR Packages\" → Click on Next → Select FORTSDKv1.5.aar in File name → Click on Finish.\n\n### iOS\n\n1. Download PayFort SDK Module file from [here](https://docs.payfort.com/docs/api/build/lib/PayFortSDK1.9.zip).\n2. Extract PayFortSDK1.9.zip and open \u0026 copy PayFortSDK.bundle \u0026 PayFortSDK.framework to iOS directory of your project.\n3. Replace `#import \u003cPayFortSDK/PayFortView.h\u003e` to `#import \"PayFortView.h\"` and replace `#import \u003cPayFortSDK/PayFortController.h\u003e` to `#import \"PayFortController.h\"` in PayFortSDK.framework → Headers → PayFortSDK.h\n4. Copy path of PayFortSDK.h file from PayFortSDK.framework → Headers and add that path in Pods → Development Pods → react-native-payfort-sdk → PayFort.h as shown in screenshot\n   ![](Screenshot.png)\n5. Add `pod 'JVFloatLabeledTextField'` in the pod file.\n6. open iOS folder in terminal and run command \"pod install\" .\n\n## Usage\n\n```javascript\nimport { RNPayFort } from \"@logisticinfotech/react-native-payfort-sdk/PayFortSDK/PayFortSDK\";\n\nonPay = async () =\u003e {\n  await RNPayFort({\n    command: \"PURCHASE\",\n    access_code: \"xxxxxxxxxxxxxxxxxx\",\n    merchant_identifier: \"xxxxxxxxxx\",\n    sha_request_phrase: \"xxxxxxxxxxxxxxxxxx\",\n    amount: 100,\n    currencyType: \"SAR\",\n    language: \"en\",\n    email: \"naishadh@logisticinfotech.co.in\",\n    testing: true,\n  })\n    .then((response) =\u003e {\n      console.log(response);\n    })\n    .catch((error) =\u003e {\n      console.log(error);\n    });\n};\n```\n\n##### Usage with sdk_token provided\n\n```javascript\nimport {\n  getPayFortDeviceId,\n  RNPayFort,\n} from \"@logisticinfotech/react-native-payfort-sdk/PayFortSDK/PayFortSDK\";\n\ngetDeviceToken = async () =\u003e {\n  getPayFortDeviceId().then(async (deviceId) =\u003e {\n    await Axios.post(\"YOUR_WEB_URL_FOR_SDK_TOKEN_GENERATION\", {\n      deviceId: deviceId,\n    })\n      .then((response) =\u003e {\n        this.setState({ sdk_token: response.data.sdk_token }, () =\u003e {\n          this.onPay();\n        });\n      })\n      .catch((error) =\u003e {\n        console.log(error);\n      });\n  });\n};\n\nonPay = async () =\u003e {\n  await RNPayFort({\n    command: \"PURCHASE\",\n    access_code: \"xxxxxxxxxxxxxxxxxx\",\n    merchant_identifier: \"xxxxxxxxxx\",\n    sha_request_phrase: \"xxxxxxxxxxxxxxxxxx\",\n    amount: 100,\n    currencyType: \"SAR\",\n    language: \"en\",\n    email: \"naishadh@logisticinfotech.co.in\",\n    testing: true,\n    sdk_token: this.state.sdk_token,\n  })\n    .then((response) =\u003e {\n      console.log(response);\n    })\n    .catch((error) =\u003e {\n      console.log(error);\n    });\n};\n```\n\n##### Note\n\nThere is no any difference between sdk_token provided and without provided.\n\n1. In case if you are not providing sdk_token then it will call payfort sdk_token generation api automatically without any worries.\n\n2. In case if you want to provide sdk_token manually then you have to first get deviceId from `getPayFortDeviceId()` method and pass deviceId as parameter to payfort sdk_token generation api, response of that api will give you sdk_token. Provide that sdk_token to parameters as above example.\n\n![](RNPayfortSDK.gif)\n\n## Note\n\n1. Before sending the amount value of any transaction, you have to multiply the value with the currency decimal code according to ISO code 3.\n   For example: If the amount value was 500 AED; according to ISO code 3, you should multiply the value with 100 (2 decimal points); so it will be sent in the request as 50000.\n   Another example: If the amount value was 100 JOD; according to ISO code 3, you should multiply the value with 1000 (3 decimal points); so it will be sent in the request as 100000.\n\n2. If you have unique merchant_reference then you can add to parameter, else system will generate unique merchant_reference by its own.\n\n## Basic properties\n\n| Parameter Name       | Type         | Mandatory | Description                                                                                                                                                                                                                                                                    | Length | Special Characters      | Possible/ Expected Values                                                                                                                               | Example             |\n| -------------------- | ------------ | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------ | ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------- |\n| command              | Alpha        | ✅        | Command                                                                                                                                                                                                                                                                        | 20     |                         | \"AUTHORIZATION\" or \"PURCHASE\"                                                                                                                           |                     |\n| access_code          | Alphanumeric | ✅        | This will be your unique access_code provided by payfort console.                                                                                                                                                                                                              |        |                         |                                                                                                                                                         |                     |\n| merchant_identifier  | Alphanumeric | ✅        | This will be your unique merchant_identifier provided by payfort console.                                                                                                                                                                                                      |        |                         |                                                                                                                                                         |                     |\n| sha_request_phrase   | Alphanumeric | ✅        | This will be your unique sha_request_phrase provided by payfort console.                                                                                                                                                                                                       |        |                         |                                                                                                                                                         |                     |\n| amount               | Numeric      | ✅        | The transaction's amount. \\*Each currency has predefined allowed decimal points that should be taken into consideration when sending the amount.                                                                                                                               | 10     |                         |                                                                                                                                                         | 10000               |\n| currency             | Alpha        | ✅        | The currency of the transaction’s amount in ISO code 3.                                                                                                                                                                                                                        | 3      |                         |                                                                                                                                                         | AED                 |\n| language             | Alpha        | ✅        | The checkout page and messages language.                                                                                                                                                                                                                                       | 2      |                         | \"en\" or \"ar\"                                                                                                                                            |                     |\n| customer_email       | Alphanumeric | ✅        | The customer's email.                                                                                                                                                                                                                                                          | 254    | \\_ - . @                |                                                                                                                                                         | customer@domain.com |\n| testing              | Boolean      | ✅        | Testing or Production                                                                                                                                                                                                                                                          |        |                         | \"true\" or \"false\"                                                                                                                                       |                     |\n| merchant_reference   | Alphanumeric | ❌        | The Merchant’s unique order number.                                                                                                                                                                                                                                            | 40     | \\_ - .                  |                                                                                                                                                         | XYZ9239-yu898       |\n| token_name           | Alphanumeric | ❌        | The Token received from the Tokenization process.                                                                                                                                                                                                                              | 100    | \\_ - . @                |                                                                                                                                                         | Op9Vmp              |\n| sdk_token            | Alphanumeric | ❌        | You can provide if you have sdk_token already generated from payfort api from your server side. **Note**: For this you will have to first generate deviceID from given method `getPayFortDeviceId()`, then provide deviceId as parameter for payfort sdk_token generation api. |        |                         |                                                                                                                                                         |                     |\n| payment_option       | Alpha        | ❌        | Payment option.                                                                                                                                                                                                                                                                | 10     |                         | \"MASTERCARD\" or \"VISA\" or \"AMEX\" or \"MADA (for Purchase operations and eci Ecommerce only)\" or \"MEEZA (for Purchase operations and ECOMMERCE eci only)\" |                     |\n| eci                  | Alpha        | ❌        | E-commerce indicator.                                                                                                                                                                                                                                                          | 16     |                         | ECOMMERCE                                                                                                                                               |                     |\n| order_description    | Alphanumeric | ❌        | A description of the order.                                                                                                                                                                                                                                                    | 150    | # ' / . \\_ - : \\$ Space |                                                                                                                                                         | iPhone 6-S          |\n| customer_ip          | Alphanumeric | ❌        | It holds the customer's IP address. \\*It's Mandatory, if the fraud service is active.                                                                                                                                                                                          | 45     | .                       |                                                                                                                                                         | 192.178.1.10        |\n| customer_name        | Alpha        | ❌        | The customer's name.                                                                                                                                                                                                                                                           | 40     | \\_ \\ / - . ,            |                                                                                                                                                         | John Smith          |\n| phone_number         | Alphanumeric | ❌        | The customer’s phone number.                                                                                                                                                                                                                                                   | 19     | + - ( ) Space           |                                                                                                                                                         | 0096279 7219966     |\n| settlement_reference | Alphanumeric | ❌        | The Merchant submits this value to the FORT. The value is then passed to the Acquiring bank and displayed to the merchant in the Acquirer settlement file.                                                                                                                     | 34     | . - \\_                  |                                                                                                                                                         | XYZ9239-yu898       |\n| merchant_extra       | Alphanumeric | ❌        | Extra data sent by merchant. Will be received and sent back as received. Will not be displayed in any report.                                                                                                                                                                  | 999    | . ; / \\_ - , ' @        |                                                                                                                                                         | JohnSmith           |\n| merchant_extra1      | Alphanumeric | ❌        | Extra data sent by merchant. Will be received and sent back as received. Will not be displayed in any report.                                                                                                                                                                  | 250    | . ; / \\_ - , ' @        |                                                                                                                                                         | JohnSmith           |\n| merchant_extra2      | Alphanumeric | ❌        | Extra data sent by merchant. Will be received and sent back as received. Will not be displayed in any report.                                                                                                                                                                  | 250    | . ; / \\_ - , ' @        |                                                                                                                                                         | JohnSmith           |\n| merchant_extra3      | Alphanumeric | ❌        | Extra data sent by merchant. Will be received and sent back as received. Will not be displayed in any report.                                                                                                                                                                  | 250    | . ; / \\_ - , ' @        |                                                                                                                                                         | JohnSmith           |\n| merchant_extra4      | Alphanumeric | ❌        | Extra data sent by merchant. Will be received and sent back as received. Will not be displayed in any report.                                                                                                                                                                  | 250    | . ; / \\_ - , ' @        |                                                                                                                                                         | JohnSmith           |\n\n## Methods\n\n`getPayFortDeviceToken()` : For generate deviceId to provide as parameter in sdk_token generation api.\n\n`RNPayFort(parameters)` : For payment procedure.\n\n## Test Card Details\n\nYou want to test a transaction but you don’t have a credit card or user credentials for our other payments options? Well we’ve got your back, here you can find card numbers for any type of test you wish to do.\n\n### Credit Cards\n\n| Card type  | Number           | Expiry date | CVV / CVC |\n| ---------- | ---------------- | ----------- | --------- |\n| Visa       | 4005550000000001 | 05/21       | 123       |\n| MasterCard | 5123456789012346 | 05/21       | 123       |\n| AMEX       | 345678901234564  | 05/21       | 1234      |\n\n### 3-D Secure Credit Cards\n\n| Card type  | Number           | Expiry date | CVV / CVC |\n| ---------- | ---------------- | ----------- | --------- |\n| Visa       | 4557012345678902 | 05/21       | 123       |\n| MasterCard | 5313581000123430 | 05/21       | 123       |\n| AMEX       | 374200000000004  | 05/21       | 1234      |\n\n### Local Payment Methods\n\n| Payment option | Number     | Expiry date | CVV / CVC |\n| -------------- | ---------- | ----------- | --------- |\n| Knet           | 0000000001 | 05/17       | 1234      |\n\n| Payment option | Number           | Expiry date | OTP  | Pin  |\n| -------------- | ---------------- | ----------- | ---- | ---- |\n| Naps           | 4215375500883243 | 06/17       | 1234 | 1234 |\n\n| Payment option | Payment ID   | Password | OTP    |\n| -------------- | ------------ | -------- | ------ |\n| Sadad          | sadadOlpTest | 1234     | 112358 |\n\n| Payment option | Number           | Card type |\n| -------------- | ---------------- | --------- |\n| E-dirham       | 4724439901004942 | Gold Card |\n\n### Digital Wallets\n\n| Payment option | Number           | Expiry date | CVV / CVC |\n| -------------- | ---------------- | ----------- | --------- |\n| MasterPass     | 4000000000000002 | 05/21       | 123       |\n| Visa Checkout  | 4000000000000002 | 05/21       | 123       |\n\n#### for more details, visit references [Payfort Documentation](https://docs.payfort.com/docs/api/build/index.html) and [Payfort Mobile SDK](https://docs.payfort.com/docs/api/build/index.html#fort-mobile-sdk)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flogisticinfotech%2Freact-native-payfort-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flogisticinfotech%2Freact-native-payfort-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flogisticinfotech%2Freact-native-payfort-sdk/lists"}