
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
react-native-unionpay-plugin
Advanced tools
本插件参考 银联官方 - 手机支付控件(含安卓Pay)文档。



<key>LSApplicationQueriesSchemes</key>
<array>
<string>uppaysdk</string>
<string>uppaywallet</string>
<string>uppayx1</string>
<string>uppayx2</string>
<string>uppayx3</string>
</array>
// iOS 9.x or newer
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options
{
return [RCTLinkingManager application:application openURL:url options:options];
}
// iOS 8.x or older
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
{
return [RCTLinkingManager application:application openURL:url sourceApplication:sourceApplication annotation:annotation];
}
import {Unionpay, UnionpayEmitter, UNIONPAY_MODAL_PRODUCTION, UNIONPAY_MODAL_DEVELOPMENT} from 'react-native-china-unionpay';
| Method | Return Type | iOS | Android |
|---|---|---|---|
| startPay(tn: string, mode: string) | void | ✅ | ✅ |
| payAliPayMiniPro(appPayRequest: string) | void | ✅ | ✅ |
| payWX(appPayRequest: string) | void | ✅ | ✅ |
| startSEPay(tn: string, mode: string, seType: string) | void | ❌ | ✅ |
| getSEPayInfo() | Promise<object> | ❌ | ✅ |
| checkWalletInstalled() | Promise<boolean> | ❌ | ✅ |
| isPaymentAppInstalled() | Promise<boolean> | ✅ | ❌ |
tn - 交易流水号
mode - 连接环境:"00" - 银联正式环境 "01" - 银联测试环境,该环境中不发生真实交易
通过银联工具类启动支付插件,支付结果在 UnionpayEmitter 事件中获取。
Unionpay.startPay(tn, UNIONPAY_MODAL_DEVELOPMENT);
tn - 交易流水号
通过银联工具类启动支付宝小程序支付,支付结果在 UnionpayEmitter 事件中获取。
Unionpay.payAliPayMiniPro(appPayRequest);
tn - 交易流水号
通过银联工具类启动微信支付,支付结果在 UnionpayEmitter 事件中获取。
Unionpay.payWX(appPayRequest);
tn - 交易流水号 mode - 连接环境:"00" - 银联正式环境 "01" - 银联测试环境,该环境中不发生真实交易 指定手机 Pay 支付接口调用 seType - 手机pay支付类别
调用指定手机Pay支付接口(startSEPay())之前,需要先调用检查手机Pay状态接口(getSEPayInfo())获取seType,startSEPay()调用方式同startPay()。
Unionpay.startSEPay(tn, UNIONPAY_MODAL_DEVELOPMENT, seType);
检查手机 Pay 状态接口
Unionpay.getSEPayInfo().then(data => {
console.log(data);
}).catch(error => {
console.log(error.message);
});
检测是否已安装云闪付客户端接口调用
Unionpay.checkWalletInstalled().then(data => {
console.log(data);
}).catch(error => {
console.log(error.message);
});
检测是否已安装银联 App 接口调用
Unionpay.isPaymentAppInstalled().then(data => {
console.log(data);
});
用于支付结果的事件订阅。支付结果的 pay_result 参数有3个选项:
export default class App extends Component {
constructor(props) {
super(props);
this.onUnionPayResponse = this._onUnionPayResponse.bind(this);
}
componentDidMount() {
UnionpayEmitter.on("UnionPayResponse", this.onUnionPayResponse);
}
componentWillUnmount() {
this.isMount = false;
UnionpayEmitter.removeListener('UnionPayResponse', this.onUnionPayResponse);
}
_onUnionPayResponse(data) {
console.log(data);
}
连接环境,有2个常量选项
参考官网 测试环境的测试卡信息 测试卡信息-前台类交易
招商银行借记卡:6226090000000048
手机号:18100000000
密码:111101
短信验证码:111111(先点获取验证码之后再输入)
证件类型:01
证件号:510265790128303
姓名:张三
华夏银行贷记卡:6226388000000095
手机号:18100000000
cvn2:248
有效期:1225(后台接口注意格式YYMM需倒一下)
短信验证码:111111(先点获取验证码之后再输入)
证件类型:01
证件号:510265790128303
姓名:张三
平安银行借记卡:6216261000000000018
手机号:13552535506
证件类型:01
证件号:341126197709218366
密码:123456
姓名:全渠道
短信验证码:111111(先点获取验证码之后再输入)
平安银行贷记卡:6221558812340000
手机号:13552535506
cvn2:123
有效期:1123(后台接口注意格式YYMM需倒一下)
短信验证码:111111(先点获取验证码之后再输入)
姓名:互联网
证件类型:01
证件号:341126197709218366
农行贷记卡:5200831111111113
手机号:13552535506
cvn2:123
有效期:1125(后台接口注意格式YYMM需倒一下)
短信验证码:111111(先点获取验证码之后再输入)
姓名:全渠道
证件类型:01
身份证号:341126197709218366
平安银行贷记卡:6221558812340013(信用卡还款被还款信用卡)
手机号:13552535506
cvn2:123
有效期:1123(后台接口注意格式YYMM需倒一下)
短信验证码:111111(先点获取验证码之后再输入)
姓名:全渠道
证件类型:01
证件号:341126197709218366
FAQs
react-native-unionpay plugin
The npm package react-native-unionpay-plugin receives a total of 39 weekly downloads. As such, react-native-unionpay-plugin popularity was classified as not popular.
We found that react-native-unionpay-plugin demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.