1 Star 0 Fork 0

hanwenbo / react-native-yunpeng-alipay

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

react-native-yunpeng-alipay

React Native Module for alipay.com

install

npm install react-native-yunpeng-alipay --save

Android

With rnpm

rnpm link react-native-yunpeng-alipay

Manually

  • android/settings.gradle
include ':react-native-yunpeng-alipay'
project(':react-native-yunpeng-alipay').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-yunpeng-alipay/android')
  • android/app/build.gradle
dependencies {
    compile project(':react-native-yunpeng-alipay')
}
  • 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

With rnpm

rnpm link react-native-yunpeng-alipay

Manually

Link AlipayModule library from your node_modules/react-native-yunpeng-alipay/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 'react-native-yunpeng-alipay';
Alipay.pay("signed pay info string").then(function(data){
                    console.log(data);
                }, function (err) {
                    console.log(err);
                });

空文件

简介

取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/hanwenbo/react-native-yunpeng-alipay.git
git@gitee.com:hanwenbo/react-native-yunpeng-alipay.git
hanwenbo
react-native-yunpeng-alipay
react-native-yunpeng-alipay
master

搜索帮助