react-native-asiapay
TypeScript icon, indicating that this package has built-in type declarations

0.2.6 • Public • Published

react-native-asiapay

Asiapay react native library

Requirements

React Native 0.60.0+ XCode 12+ iOS 10+ Android SDK 17+

PaySDK version

iOS: 2.6.02 Android: 2.2.7

Installation

npm install react-native-asiapay
yarn add react-native-asiapay

iOS installation

  1. pod install
  2. Add #import <AP_PaySDK/AP_PaySDK.h> to your AppDelegate.m
  3. Add [[PaySDK shared] processOrderWithUrl:url]; to - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options

Android installation

Add flatDir { dirs "$rootDir/../node_modules/react-native-asiapay/android/libs" } to android/build.gradle

Inside

allprojects {
    repositories {
      ....
    }
}

Add pay sdk public key file

Android

Put your public key file in android/app/src/main/assets/paysdk.properties

iOS

Put your public key file in android/app/src/main/assets/paysdk.properties

Usage

JS Code

import Asiapay from "react-native-asiapay";

// Config environment and merchant id at the beginning of your app
Asiapay.setup('Production' | 'Sandbox', 'merchant id');

// Make payment
Asiapay.alipay('price', 'HKD', 'transaction id', 'Remark')
.then(s => {
  // Successfully capture payment from Alipay
})
.catch(({ code, message }) => {
  // Failed with error
});

Others

Check https://github.com/asiapay-lib/ for more details

Contribution

Did you find a bug?

  • Ensure the bug was not already reported by searching on Gihub under https://github.com/onecharge-ev/react-native-asiapay/issues
  • If you're unable to find an open issue addressing the problem, open a new one. Be sure to include a title and clear description, as much relevant information as possible, and a code sample or an executable test case demonstrating the expected behavior that is not occurring.

Did you write a patch that fixes a bug?

  • Open a new GitHub pull request with the patch.
  • Ensure the PR description clearly describes the problem and solution. Include the relevant issue number if applicable.

Do you intend to add a new feature or change an existing one?

  • Open a new GitHub pull request with the new updates.

Readme

Keywords

none

Package Sidebar

Install

npm i react-native-asiapay

Weekly Downloads

0

Version

0.2.6

License

MIT

Unpacked Size

110 MB

Total Files

408

Last publish

Collaborators

  • salamik