1
0
Code Issues Pull Requests Packages Projects Releases Wiki Activity GitHub Gitee

Compare commits

..

2 Commits

Author SHA1 Message Date
jaywcjlove
b6a11caf86 released v1.0.1 2020-07-08 10:23:07 +08:00
jaywcjlove
afa8dee9b6 feat: Add setAlipaySandbox props. 2020-07-08 10:21:49 +08:00
4 changed files with 18 additions and 1 deletions

View File

@@ -25,6 +25,8 @@ import Alipay from 'react-native-uiwjs-alipay';
// 设置 支付宝 URL Schemes
// scheme = `ap` + `APPID`
Alipay.setAlipayScheme(scheme);
// 设置支付宝沙箱环境
Alipay.setAlipaySandbox(isSandbox);
// 支付宝 iOS 端的支付
// payInfo 是后台拼接好的支付参数
Alipay.alipay(payInfo, (res)=>console.log(res))

5
index.d.ts vendored
View File

@@ -54,6 +54,11 @@ export const Alipay: {
* @param scheme scheme = `ap` + `APPID`
*/
setAlipayScheme: (scheme: string) => void;
/**
* 设置支付宝沙箱环境,仅 Android
* @param isSandBox
*/
setAlipaySandbox: (isSandbox: boolean) => void;
};
export default Alipay;

View File

@@ -20,4 +20,14 @@ export default class Alipay {
NativeModules.Alipay.setAlipayScheme(scheme);
}
}
/**
* 设置支付宝沙箱环境,仅 Android
* @param isSandBox
*/
static setAlipaySandbox(isSandbox) {
if (Platform.OS === 'android') {
NativeModules.Alipay.setAlipaySandbox(isSandBox);
}
}
}

View File

@@ -1,6 +1,6 @@
{
"name": "react-native-uiwjs-alipay",
"version": "1.0.0",
"version": "1.0.1",
"description": "基于 React Native 的宝支付插件",
"main": "index.js",
"files": [