react-native-ottpay

1.1.2 • Public • Published

React Native OttPay

Installation

yarn add react-native-ottpay

or

npm install react-native-ottpay --save

Automatically Link

# RN < 0.60
react-native link react-native-ottpay

# RN > 0.60
cd ios && pod install && cd ..

Manual linking

Manually linking the library for iOS

Open project.xcodeproj in Xcode

Drag ottpay.xcodeproj to your project on Xcode xcode-add

Link libottpay.a binary with libraries

Click on your main project file (the one that represents the .xcodeproj). Add libottpay.a to your project's Build PhasesLink Binary With Libraries xcode-link

Manually linking the library for Android

android/settings.gradle

include ':react-native-ottpay'
project(':react-native-ottpay').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-ottpay/android')

android/app/build.gradle

dependencies {
   ...
   implementation project(':react-native-ottpay')
}

android/app/src/main/.../MainApplication.java

On top, where imports are:

import com.ottpay.OttpayPackage;

Add the OttpayPackage class to your list of exported packages.

@Override
protected List<ReactPackage> getPackages() {
    return Arrays.asList(
            new MainReactPackage(),
            new OttpayPackage()
    );
}

iOS Setup

Select your project. Add the following System libraries to your project's Build Phases -> Link Binary With Libraries:

  • QuartzCore.framework
  • CoreTelephony.framework
  • CoreText.framework
  • UIKit.framework
  • Foundation.framework
  • CoreGraphics.framework
  • CoreMotion.framework
  • CFNetwork.framework
  • SystemConfiguration.framework
  • libc++.tbd
  • libsqlite3.tbd
  • libz.tbd

Then add the AlipaySDK.framework(under your node_modules/react-native-ottpay/ios folder) librarie to your project's Build Phases -> Link Binary With Libraries

If framework not found AlipaySDK please drag the folder node_modules/react-native-ottpay/ios to your project's Build Setting -> Framework Search Paths

copy the following in AppDelegate.m:

#import "IPNCrossBorderPluginAPi.h"
- (void)applicationWillEnterForeground:(UIApplication *)application {
    [IPNCrossBorderPluginAPi applicationDidBecomeActive];
    // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
}

Use

import OttPay from 'react-native-ottpay';

const payStr = 'appId=*******&mhtAmtCurrFlag=1&mhtCharset=UTF-8&mhtCurrencyType=USD&mhtOrderAmt=1&mhtOrderDetail=mhtOrderDetail&mhtOrderName=merchantTest&mhtOrderNo=20211026105613&mhtOrderStartTime=20211026105530&mhtOrderTimeOut=3600&mhtOrderType=01&notifyUrl=http%3A%2F%2Flocalhost%3A10802%2F&payChannelType=90&mhtSignType=MD5&mhtSignature=c0fbeceaf63331b60b908d0526fc3f82';

OttPay.startPay(payStr);

海带跨境

Dependencies (2)

Dev Dependencies (21)

Package Sidebar

Install

npm i react-native-ottpay

Weekly Downloads

2

Version

1.1.2

License

ISC

Unpacked Size

27.2 MB

Total Files

67

Last publish

Collaborators

  • rueen