npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-native-payfort

v1.0.1

Published

A react native wrapper for PayFort SDK.

Downloads

12

Readme

React Native PayFort

A react native wrapper for PayFort SDK.

Install

1.Download and follow the installation steps in PayFort documentation

https://docs.payfort.com/docs/mobile-sdk/build/index.html#download

2.Run

npm install react-native-payfort --save react-native link react-native-payfort

Usage

let { Payfort } = require('react-native').NativeModules;
........
let options = {
  isLive: false, // true for production, false for sandbox
  access_code: '', // Access Code
  command: 'AUTHORIZATION', //Command (AUTHORIZATION, PURCHASE)
  merchant_identifier: '', //The Merchant Identifier
  merchant_reference: 'XYZ9239-yu8100', //The Merchant’s unique order number (XYZ9239-yu8100)
  merchant_extra: '', //Extra data sent by merchant. Will be received and sent back as received. Will not be displayed in any report
  merchant_extra1: '', //Extra data sent by merchant. Will be received and sent back as received. Will not be displayed in any report
  merchant_extra2: '', //Extra data sent by merchant. Will be received and sent back as received. Will not be displayed in any report
  merchant_extra3: '', //Extra data sent by merchant. Will be received and sent back as received. Will not be displayed in any report
  merchant_extra4: '', //Extra data sent by merchant. Will be received and sent back as received. Will not be displayed in any report
  customer_name: '', //The customer’s name
  customer_email: '[email protected]', //The customer’s email ([email protected])
  phone_number: '', //The customer’s phone number (00962797219966)
  payment_option:'', //Payment option (MASTERCARD,VISA,AMEX)
  language: 'en', // The checkout page and messages language (en, ar)
  currency: 'EGP', //The currency of the transaction’s amount in ISO code 3 (EGP)
  amount: '1000', //The transaction’s amount
  eci: 'ECOMMERCE', //Ecommerce indicator (ECOMMERCE)
  order_description: '' //A description of the order
};
Payfort.initPayfort(options, (err, results) => {
  if (err) {
      console.log("error initializing Payfort: ", err);
      return;
  }
  // Payfort initialized...
  console.log(results)
});

Response

{
  amount: "1000",
  authorization_code: "******",
  card_number: "400555******0001",
  command: "AUTHORIZATION",
  currency: "EGP",
  customer_email: "[email protected]",
  customer_ip: "**.**.**.**",
  customer_name: "",
  eci: "ECOMMERCE",
  expiry_date: "2105",
  fort_id: "**1904821400021901",
  language: "en",
  merchant_reference: "XYZ9239-yu8100",
  payment_option: "VISA",
  phone_number: "",
  response_code: "02000",
  response_message: "Success",
  sdk_token: "**8FE89271477477E053321E320AEE28",
  status: "02",
  token_name: "**8FE0E32A5D7475E053321E320A1300"
}

Test Card Details

You 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.

Credit Cards

| CARD TYPE | NUMBER | EXPIARY DATE | CVV / CVC | |--|--|--|--| | Visa | 4005550000000001 | 05/21 | 123 | | MasterCard | 5123456789012346 | 05/21 | 123 | | AMEX | 345678901234564 | 05/21 | 1234 |

3-D Secure Credit Cards

| CARD TYPE | NUMBER | EXPIARY DATE | CVV / CVC | |--|--|--|--| | Visa | 4557012345678902 | 05/21 | 123 | | MasterCard | 5313581000123430 | 05/21 | 123 | | AMEX | 374200000000004 | 05/21 | 1234 |

Local Payment Methods

| PAYMENT OPTION | NUMBER | EXPIARY DATE | CVV / CVC |--|--|--|--| | Knet | 0000000001 | 05/17 | 1234

| PAYMENT OPTION | NUMBER | EXPIARY DATE | OTP | PIN |--|--|--|--|--| | Naps | 4215375500883243 | 06/17 | 1234 | 1234

| PAYMENT OPTION | PAYMENT ID | PASSWORD | OTP | |--|--|--|--| | Sadad | sadadOlpTest | 1234 | 112358 |

| PAYMENT OPTION | NUMBER | CARD TYPE | |--|--|--| | E-dirham | 4724439901004942 | Gold Card |

Digital Wallets

| PAYMENT OPTION | NUMBER | EXPIARY DATE | CVV / CVC | |--|--|--|--| | MasterPass | 4000000000000002 | 05/21 | 123 | | Visa Checkout | 4000000000000002 | 05/21 | 123 |