1
0
Code Issues Pull Requests Packages Projects Releases Wiki Activity GitHub Gitee
react-native-alipay/index.js

34 lines
782 B
JavaScript
Raw Normal View History

2020-07-07 20:10:43 +08:00
import { NativeModules, Platform } from 'react-native';
2020-07-07 17:44:10 +08:00
2020-07-07 20:10:43 +08:00
export default class Alipay {
2020-07-07 17:44:10 +08:00
2020-07-07 20:10:43 +08:00
/**
* 支付宝端支付
* @param orderInfo 支付详情
* @param callback 支付宝回调结果 详情见 https://docs.open.alipay.com/204/105301
*/
static alipay(orderInfo, callback) {
NativeModules.Alipay.alipay(orderInfo, callback)
}
/**
* 设置支付宝跳转Scheme iOS
* @param scheme
*/
static setAlipayScheme(scheme) {
if (Platform.OS === 'ios') {
NativeModules.Alipay.setAlipayScheme(scheme);
}
}
2020-07-08 10:21:49 +08:00
/**
* 设置支付宝沙箱环境 Android
* @param isSandBox
*/
static setAlipaySandbox(isSandbox) {
if (Platform.OS === 'android') {
NativeModules.Alipay.setAlipaySandbox(isSandBox);
}
}
2020-07-07 20:10:43 +08:00
}