Socket
Socket
Sign inDemoInstall

rn-alipay-phillip

Package Overview
Dependencies
0
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    rn-alipay-phillip

alipay and aliAuth module for react native from phillip


Version published
Maintainers
1
Created

Readme

Source

rn-alipay-phillip

React Native Module for alipay.com

install

npm install rn-alipay-phillip --save
or
yarn add rn-alipay-phillip

Android

react-native link react-native-yunpeng-alipay

Manually

  • android/settings.gradle
include ':rn-alipay-phillip'
project(':rn-alipay-phillip').projectDir = new File(rootProject.projectDir, '../node_modules/rn-alipay-phillip/android')
  • android/app/build.gradle
dependencies {
    compile project(':rn-alipay-phillip')
}
  • register module (in MainActivity.java)
...

import com.yunpeng.alipay.AlipayPackage; // <--- IMPORT

public class MainActivity extends ReactActivity {

    ...

    @Override
    protected List<ReactPackage> getPackages() {
        return Arrays.<ReactPackage>asList(
            new MainReactPackage(),
            new AlipayPackage() // <--- ADD HERE
        );
    }
}

iOS

react-native link rn-alipay-phillip

Manually

Link AlipayModule library from your node_modules/rn-alipay-phillip/ios folder like its described here. Don't forget to add it to "Build Phases" of project.

Config

  • Added the following libraries to your "Link Binary With Libraries":
    • CoreMotion.framework
    • CoreTelephony.framework
    • libc++
    • libz
  • add URL Schema as your app id for URL type in Targets - info
  • Make sure you have these code in AppDelegate.m to enable callback
#import "AlipayModule.h"
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url
  sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
{
  [AlipayModule handleCallback:url];
  return YES;
}

General Usage

import Alipay from 'rn-alipay-phillip';

Alipay.pay("signed pay info string").then(function(data){
        console.log(data);
    }, function (err) {
        console.log(err);
    });

Alipay.authLogin("signed pay info string").then(function(data){
        console.log(data);
    }, function (err) {
        console.log(err);
    });

Keywords

FAQs

Last updated on 07 Nov 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc