1
0
Code Issues Pull Requests Packages Projects Releases Wiki Activity GitHub Gitee
react-native-alipay/index.js
2020-07-09 18:56:50 +08:00

34 lines
780 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { NativeModules, Platform } from 'react-native';
export default class Alipay {
/**
* 支付宝端支付
* @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);
}
}
/**
* 设置支付宝沙箱环境,仅 Android
* @param isSandBox
*/
static setAlipaySandbox(isSandBox) {
if (Platform.OS === 'android') {
NativeModules.Alipay.setAlipaySandbox(isSandBox);
}
}
}