react-native-china-unionpay
Version:
本插件参考 [银联官方 - 手机支付控件(含安卓Pay)文档](https://open.unionpay.com/tjweb/acproduct/list?apiservId=450)。 ## 安装
24 lines (20 loc) • 694 B
JavaScript
import { NativeModules } from 'react-native';
const { UnionPayModule } = NativeModules;
class Api {
/**
* 通过银联工具类启动支付插件
* @param {[type]} tn: string 交易流水号
* @param {[type]} mode: string 连接环境:"00" - 银联正式环境 "01" - 银联测试环境,该环境中不发生真实交易
*/
startPay(tn: string, mode: string) {
UnionPayModule.startPay(tn, mode);
}
/**
* 检查是否安装银联 App 的接口
* @return {[type]} Promise
*/
isPaymentAppInstalled(): Promise {
return UnionPayModule.isPaymentAppInstalled();
}
}
export const Unionpay = new Api();