Skip to content

1mohmmad4/urway-appleapy-react-native

 
 

Repository files navigation

urway-appleapy-react-native

adding applepay in react-native

Installation

npm install urway-appleapy-react-native

guides

  1. First make sure to follow the guide on Setting Up Apple Pay.
  2. Make sure to create an pk8 certificate in order for urway to decrypt the payment you can refer to the urway document on how to create it refer to section E create a pk8.
  3. Add a config file in your root directory and export your credentials key form
export const config = {
  currency: 'SAR',
  terminalId: '******',
  password: '*****',
  key: '********',
  requestUrl: '********',
};
  1. After installing the package make sure to link it to xcode by cleaning the build and the pod file
cd ios
rm -rf ios/build
rm -rf ios/Pods
pod install

Usage

  • you will import Urway as shown below and initlalize it by creating instance of the class urway
  • when ever you went make a payment call processPayment this funciton will accept three parameter
    • amount : amount to be paid
    • order id : order number from your side
    • label : this name will be shown in the payment sheet
import Urway from 'urway-appleapy-react-native';
// ...
//initialize  urway applepay
const pay = new Urway('merchant.example.com');
//....

try {
  let result = await pay.processPayment(20, '22', 'urway');
  console.log(res);
} catch (e) {
  console.log(e);
}

License

MIT


Made with create-react-native-library

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 29.3%
  • Swift 23.2%
  • Objective-C++ 20.3%
  • Ruby 13.4%
  • Objective-C 13.2%
  • C 0.5%
  • TypeScript 0.1%