银联支付插件
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools"
|
||||
package="com.liyahong.unionpay"
|
||||
>
|
||||
<uses-permission android:name="android.permission.INTERNET"/>
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
|
||||
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE"/>
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
|
||||
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
|
||||
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
|
||||
<uses-permission android:name="android.permission.NFC" />
|
||||
<uses-feature android:name="android.hardware.nfc.hce"/>
|
||||
<uses-permission android:name="org.simalliance.openmobileapi.SMARTCARD" />
|
||||
<uses-permission android:name="android.permission.QUERY_ALL_PACKAGES" />
|
||||
|
||||
<application>
|
||||
<uses-library android:name="org.simalliance.openmobileapi" android:required="false"/>
|
||||
|
||||
<activity
|
||||
android:name="com.unionpay.UPPayWapActivity"
|
||||
android:configChanges="orientation|keyboardHidden|fontScale"
|
||||
android:screenOrientation="portrait"
|
||||
android:exported="false"
|
||||
android:windowSoftInputMode="adjustResize" />
|
||||
</application>
|
||||
</manifest>
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"minSdkVersion": "21"
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"dependencies":{
|
||||
"libuppayment": "./libs/libuppayment.har"
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,75 @@
|
||||
//
|
||||
// PaymentControl.h
|
||||
// PaymentControl
|
||||
//
|
||||
// Created by qcao on 15/10/20.
|
||||
// Copyright © 2015年 China Unionpay Co.,Ltd. All rights reserved.
|
||||
// v3.6.3 build1(mini)
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
|
||||
typedef void (^UPPaymentResultBlock)(NSString* code, NSDictionary* data);
|
||||
typedef void (^UPPaymentDirectAppSucc)(NSArray* directApps);
|
||||
typedef void (^UPPaymentDirectAppFail)(NSString* code,NSString* msg);
|
||||
|
||||
@interface UPPaymentControl : NSObject
|
||||
|
||||
|
||||
/**
|
||||
* 创建支付单例服务
|
||||
*
|
||||
* @return 返回单例对象
|
||||
*/
|
||||
|
||||
+ (UPPaymentControl *)defaultControl;
|
||||
|
||||
|
||||
/**
|
||||
* 支付接口
|
||||
*
|
||||
* @param tn 订单信息
|
||||
* @param schemeStr 调用支付的app注册在info.plist中的scheme
|
||||
* @param mode 支付环境
|
||||
* @param viewController 启动支付控件的viewController
|
||||
* @return 返回成功失败
|
||||
*/
|
||||
- (BOOL)startPay:(NSString*)tn
|
||||
fromScheme:(NSString *)schemeStr
|
||||
mode:(NSString*)mode
|
||||
viewController:(UIViewController*)viewController;
|
||||
|
||||
|
||||
|
||||
/// APP是否已安装检测接口,通过该接口得知用户是否安装银联支付的APP。
|
||||
/// @param mode 支付环境
|
||||
/// @param merchantInfo 商户标识
|
||||
- (BOOL)isPaymentAppInstalled:(NSString*)mode withMerchantInfo:(NSString *)merchantInfo;
|
||||
|
||||
|
||||
/**
|
||||
* 接口非线程安全,通过主线程回调异步返回直通可用app列表
|
||||
* @param mode 支付环境
|
||||
* @param merchantInfo 商户标识
|
||||
* @param succBlock 主线程成功回调,回调参数directApps,表示直通可用app列表,如无可用App则directApps为空数组@[]
|
||||
* @param succBlock 主线程成功回调,回调参数一code,表示错误码(参数错误 : 01,网络错误 : 02,其它 : 03)
|
||||
* 回调参数二msg,表示错误信息(参数错误 : parameter error,网络错误 : network error,其它 : unknown error)
|
||||
*/
|
||||
- (void)getDirectApps:(NSString*)mode
|
||||
withMerchantInfo:(NSString*)merchantInfo
|
||||
succBlock:(UPPaymentDirectAppSucc)succBlock
|
||||
failBlock:(UPPaymentDirectAppFail)failBlock;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 处理钱包或者独立快捷app支付跳回商户app携带的支付结果Url
|
||||
*
|
||||
* @param url 支付结果url,传入后由SDK解析
|
||||
* @param completionBlock 结果回调,保证跳转钱包支付过程中,即使调用方app被系统kill时,能通过这个回调取到支付结果。
|
||||
*/
|
||||
- (void)handlePaymentResult:(NSURL*)url completeBlock:(UPPaymentResultBlock)completionBlock;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,19 @@
|
||||
//
|
||||
// UPPaymentControlMini.h
|
||||
// UPPaymentControlMini
|
||||
//
|
||||
// Created by jianchen on 2024/3/21.
|
||||
// Copyright © 2024 China Unionpay Co.,Ltd. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <UPPaymentControlMini/UPPaymentControl.h>
|
||||
//! Project version number for UPPaymentControlMini.
|
||||
FOUNDATION_EXPORT double UPPaymentControlMiniVersionNumber;
|
||||
|
||||
//! Project version string for UPPaymentControlMini.
|
||||
FOUNDATION_EXPORT const unsigned char UPPaymentControlMiniVersionString[];
|
||||
|
||||
// In this header, you should import all the public headers of your framework using statements like #import <UPPaymentControlMini/PublicHeader.h>
|
||||
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,6 @@
|
||||
framework module UPPaymentControlMini {
|
||||
umbrella header "UPPaymentControlMini.h"
|
||||
export *
|
||||
|
||||
module * { export * }
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>NSPrivacyTrackingDomains</key>
|
||||
<array/>
|
||||
<key>NSPrivacyTracking</key>
|
||||
<false/>
|
||||
<key>NSPrivacyAccessedAPITypes</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>NSPrivacyAccessedAPIType</key>
|
||||
<string>NSPrivacyAccessedAPICategoryUserDefaults</string>
|
||||
<key>NSPrivacyAccessedAPITypeReasons</key>
|
||||
<array>
|
||||
<string>1C8F.1</string>
|
||||
<string>CA92.1</string>
|
||||
</array>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>NSPrivacyAccessedAPIType</key>
|
||||
<string>NSPrivacyAccessedAPICategoryFileTimestamp</string>
|
||||
<key>NSPrivacyAccessedAPITypeReasons</key>
|
||||
<array>
|
||||
<string>C617.1</string>
|
||||
</array>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,162 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>files</key>
|
||||
<dict>
|
||||
<key>Headers/UPPaymentControl.h</key>
|
||||
<data>
|
||||
lUIYX/vWkeiAf8yN5e76vTBXzm4=
|
||||
</data>
|
||||
<key>Headers/UPPaymentControlMini.h</key>
|
||||
<data>
|
||||
vet6Fb0UERMco/wGncRFVXS8TXQ=
|
||||
</data>
|
||||
<key>Info.plist</key>
|
||||
<data>
|
||||
DJf/0h9lOKhmpP6EWhqv2Gr9Tyk=
|
||||
</data>
|
||||
<key>Modules/module.modulemap</key>
|
||||
<data>
|
||||
Sh7SIRMAu2cPHe58dK3I34oDN9w=
|
||||
</data>
|
||||
<key>PaymentControlPrivacy.bundle/PrivacyInfo.xcprivacy</key>
|
||||
<data>
|
||||
0OHpv8paT+zhCRgwkm8W01cB2I0=
|
||||
</data>
|
||||
</dict>
|
||||
<key>files2</key>
|
||||
<dict>
|
||||
<key>Headers/UPPaymentControl.h</key>
|
||||
<dict>
|
||||
<key>hash</key>
|
||||
<data>
|
||||
lUIYX/vWkeiAf8yN5e76vTBXzm4=
|
||||
</data>
|
||||
<key>hash2</key>
|
||||
<data>
|
||||
mLUdwyl5s6nFTrRvWFLorErec/OiYl+oFc3rvt+5VfQ=
|
||||
</data>
|
||||
</dict>
|
||||
<key>Headers/UPPaymentControlMini.h</key>
|
||||
<dict>
|
||||
<key>hash</key>
|
||||
<data>
|
||||
vet6Fb0UERMco/wGncRFVXS8TXQ=
|
||||
</data>
|
||||
<key>hash2</key>
|
||||
<data>
|
||||
MXfiWTa0rtbqZoTW8jF9ZBdd4RAwXaZGPEnvx8QFDVc=
|
||||
</data>
|
||||
</dict>
|
||||
<key>Modules/module.modulemap</key>
|
||||
<dict>
|
||||
<key>hash</key>
|
||||
<data>
|
||||
Sh7SIRMAu2cPHe58dK3I34oDN9w=
|
||||
</data>
|
||||
<key>hash2</key>
|
||||
<data>
|
||||
qjfQ26DcOeeqGITBWz4flSg5RUaRECAcHha+Rc0o26w=
|
||||
</data>
|
||||
</dict>
|
||||
<key>PaymentControlPrivacy.bundle/PrivacyInfo.xcprivacy</key>
|
||||
<dict>
|
||||
<key>hash</key>
|
||||
<data>
|
||||
0OHpv8paT+zhCRgwkm8W01cB2I0=
|
||||
</data>
|
||||
<key>hash2</key>
|
||||
<data>
|
||||
trLG3kFk3BQb4Gg32fmJfZUhCnOO9gKdSuoR/XPSnC0=
|
||||
</data>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>rules</key>
|
||||
<dict>
|
||||
<key>^.*</key>
|
||||
<true/>
|
||||
<key>^.*\.lproj/</key>
|
||||
<dict>
|
||||
<key>optional</key>
|
||||
<true/>
|
||||
<key>weight</key>
|
||||
<real>1000</real>
|
||||
</dict>
|
||||
<key>^.*\.lproj/locversion.plist$</key>
|
||||
<dict>
|
||||
<key>omit</key>
|
||||
<true/>
|
||||
<key>weight</key>
|
||||
<real>1100</real>
|
||||
</dict>
|
||||
<key>^Base\.lproj/</key>
|
||||
<dict>
|
||||
<key>weight</key>
|
||||
<real>1010</real>
|
||||
</dict>
|
||||
<key>^version.plist$</key>
|
||||
<true/>
|
||||
</dict>
|
||||
<key>rules2</key>
|
||||
<dict>
|
||||
<key>.*\.dSYM($|/)</key>
|
||||
<dict>
|
||||
<key>weight</key>
|
||||
<real>11</real>
|
||||
</dict>
|
||||
<key>^(.*/)?\.DS_Store$</key>
|
||||
<dict>
|
||||
<key>omit</key>
|
||||
<true/>
|
||||
<key>weight</key>
|
||||
<real>2000</real>
|
||||
</dict>
|
||||
<key>^.*</key>
|
||||
<true/>
|
||||
<key>^.*\.lproj/</key>
|
||||
<dict>
|
||||
<key>optional</key>
|
||||
<true/>
|
||||
<key>weight</key>
|
||||
<real>1000</real>
|
||||
</dict>
|
||||
<key>^.*\.lproj/locversion.plist$</key>
|
||||
<dict>
|
||||
<key>omit</key>
|
||||
<true/>
|
||||
<key>weight</key>
|
||||
<real>1100</real>
|
||||
</dict>
|
||||
<key>^Base\.lproj/</key>
|
||||
<dict>
|
||||
<key>weight</key>
|
||||
<real>1010</real>
|
||||
</dict>
|
||||
<key>^Info\.plist$</key>
|
||||
<dict>
|
||||
<key>omit</key>
|
||||
<true/>
|
||||
<key>weight</key>
|
||||
<real>20</real>
|
||||
</dict>
|
||||
<key>^PkgInfo$</key>
|
||||
<dict>
|
||||
<key>omit</key>
|
||||
<true/>
|
||||
<key>weight</key>
|
||||
<real>20</real>
|
||||
</dict>
|
||||
<key>^embedded\.provisionprofile$</key>
|
||||
<dict>
|
||||
<key>weight</key>
|
||||
<real>20</real>
|
||||
</dict>
|
||||
<key>^version\.plist$</key>
|
||||
<dict>
|
||||
<key>weight</key>
|
||||
<real>20</real>
|
||||
</dict>
|
||||
</dict>
|
||||
</dict>
|
||||
</plist>
|
||||
Binary file not shown.
@@ -0,0 +1,52 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>LSApplicationQueriesSchemes</key>
|
||||
<array>
|
||||
<string>uppaysdk</string>
|
||||
<string>uppaywallet</string>
|
||||
<string>uppayx1</string>
|
||||
<string>uppayx2</string>
|
||||
<string>uppayx3</string>
|
||||
<string>paesuperbank</string>
|
||||
<string>ccbmbsylunionpay</string>
|
||||
<string>bocom</string>
|
||||
<string>bankabc</string>
|
||||
<string>cmbmobilebank</string>
|
||||
<string>cmblife</string>
|
||||
<string>com.icbc.iphoneclient</string>
|
||||
<string>spdbbank</string>
|
||||
<string>spdbcccUnionPay</string>
|
||||
<string>citicbankpay</string>
|
||||
<string>credit</string>
|
||||
<string>uppayxingyecredit</string>
|
||||
<string>uppayhuaxiacredit</string>
|
||||
<string>uppaybeijingcredit</string>
|
||||
<string>uppayzhonghangcredit</string>
|
||||
<string>uppayguangdacredit</string>
|
||||
<string>uppaygonghangcredit</string>
|
||||
<string>uppayjianhangcredit</string>
|
||||
<string>uppayjiaohangcredit</string>
|
||||
<string>uppayguangfa</string>
|
||||
<string>psbccashier</string>
|
||||
<string>uppayyouchucredit</string>
|
||||
<string>com.cebbank.ebank</string>
|
||||
<string>BankOfShangHai</string>
|
||||
<string>boscgdlf</string>
|
||||
<string>citicbankdkkj</string>
|
||||
<string>cmbc</string>
|
||||
<string>cibmb</string>
|
||||
<string>bocmbankpsn</string>
|
||||
<string>bankofbjpay</string>
|
||||
<string>uppaynonghangcredit</string>
|
||||
<string>uppayhuaxia</string>
|
||||
<string>zytuppay</string>
|
||||
<string>LZYHSJYHAUTHSSOAPP</string>
|
||||
<string>bnbpay</string>
|
||||
<string>dlrcb</string>
|
||||
<string>czbank</string>
|
||||
<string>uppayCbhb</string>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"deploymentTarget": "11",
|
||||
"validArchitectures": [ // 可选,支持的 CPU 架构类型 默认:arm64
|
||||
"arm64"
|
||||
],
|
||||
"frameworks": [ // 可选,依赖的系统库(系统库有.framework和.tbd和.dylib类型)
|
||||
"SystemConfiguration.framework",
|
||||
"libz.tbd",
|
||||
"LocalAuthentication.framework",
|
||||
"libc++.tbd"
|
||||
]
|
||||
}
|
||||
Binary file not shown.
@@ -0,0 +1,39 @@
|
||||
/**
|
||||
* uts插件接口定义文件,按规范定义接口文件可以在HBuilderX中更好的做到语法提示
|
||||
*/
|
||||
type modeType = '00' | '01'
|
||||
|
||||
export type startPayOptions = {
|
||||
/**
|
||||
* 银联环境,00正式环境,01测试环境
|
||||
*/
|
||||
mode: modeType,
|
||||
/**
|
||||
* 服务端返回的交易流水号,即tn
|
||||
*/
|
||||
tn: string,
|
||||
/**
|
||||
* 【可选】【IOS无效】手机pay支付类别,传入会展示对应的手机支付,如:华为支付
|
||||
*/
|
||||
seType?: string,
|
||||
/**
|
||||
* 支付结果回调
|
||||
*/
|
||||
callback: (result: any) => void
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查是否安装云闪付App
|
||||
*/
|
||||
export type checkWalletInstalled = () => boolean
|
||||
|
||||
/**
|
||||
* 拉起云闪付app并发起支付
|
||||
*/
|
||||
export type startPay = (options: startPayOptions) => void
|
||||
|
||||
/**
|
||||
* 检查已安装的支持直通模式的银行app列表
|
||||
* 用途是在服务端生成tn时,保留域传入"ebankEnAbbr" : "银行标识"
|
||||
*/
|
||||
export type getDirectApps = (callback: Function) => void
|
||||
Reference in New Issue
Block a user