银联支付插件
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
## 1.1.2(2026-05-25)
|
||||
【文档】增加uniappx项目引用插件的说明
|
||||
## 1.1.1(2026-04-07)
|
||||
升级云闪付SDK版本:`Android:v3.5.18`,`IOS:v3.6.3`,`HarmonyOS:v3.1.3`
|
||||
## 1.1.0(2026-02-27)
|
||||
【优化】文档增加已知问题说明
|
||||
## 1.0.9(2026-02-03)
|
||||
【优化】HarmonyOS完善module.json5文件,文档增加对鸿蒙平台的特殊说明
|
||||
## 1.0.8(2025-09-22)
|
||||
修复频繁调用插件函数报回调被回收的问题
|
||||
## 1.0.7(2025-09-03)
|
||||
【修复】修复鸿蒙打包报错问题
|
||||
## 1.0.6.1(2025-08-29)
|
||||
【优化】移除插件中module.json5的配置
|
||||
## 1.0.6(2025-07-15)
|
||||
【修复】修复鸿蒙打包报错的问题
|
||||
## 1.0.5(2025-05-08)
|
||||
修复IOS端modules丢失打包报错的问题
|
||||
## 1.0.4(2025-05-08)
|
||||
升级云闪付SDK版本:`Android:v3.5.16`,`IOS:v3.6.2`,`HarmonyOS:v3.1.2`
|
||||
## 1.0.3(2025-04-25)
|
||||
IOS端修复支持成功之后App闪退问题
|
||||
## 1.0.2(2025-03-25)
|
||||
* Android端修复打包冲突问题
|
||||
## 1.0.1(2025-03-11)
|
||||
* 代码优化,修复bug
|
||||
## 1.0.0(2025-01-10)
|
||||
* 第一版发布,同时支持`Android`、`IOS`、`HarmonyOS`三端
|
||||
* 云闪付SDK版本:`Android:v3.5.15`,`IOS:v3.6.0`,`HarmonyOS:v3.1.0`
|
||||
* 初次发布,如有问题请欢迎大家指出,会及时调整
|
||||
@@ -0,0 +1 @@
|
||||
Îà^wïøòR<>£LËAËœÞÂôz…aY¿@6y»Ióµ¡î?¿mpDqÚ%ÃCc)“ô²/CÓl7vʲ$ùi|ËꄟQuXsõœä}˜ÌâPíó-q:Ù.?h‘Z™Zc–ÃÄdXgµ>ñåøpþ‹R5dÖQß躵ޜ£<C2A3>[×üDð
|
||||
@@ -0,0 +1,132 @@
|
||||
{
|
||||
"id": "liyahong-unionpay",
|
||||
"displayName": "【Android+IOS+harmonyOS】银联云闪付支付",
|
||||
"version": "1.1.2",
|
||||
"description": "银联云闪付支付UTS插件,全方位支持Android/IOS/harmonyOS,支持自定义支付",
|
||||
"keywords": [
|
||||
"云闪付",
|
||||
"云闪付支付",
|
||||
"银联",
|
||||
"银联支付",
|
||||
"支付"
|
||||
],
|
||||
"repository": "",
|
||||
"engines": {
|
||||
"HBuilderX": "^3.6.8",
|
||||
"uni-app": "^4.36",
|
||||
"uni-app-x": "^4.36"
|
||||
},
|
||||
"dcloudext": {
|
||||
"type": "uts",
|
||||
"sale": {
|
||||
"regular": {
|
||||
"price": "89.90"
|
||||
},
|
||||
"sourcecode": {
|
||||
"price": "0.00"
|
||||
}
|
||||
},
|
||||
"contact": {
|
||||
"qq": "1299259684"
|
||||
},
|
||||
"declaration": {
|
||||
"ads": "无",
|
||||
"data": "插件使用的云闪付支付SDK会采集数据,详情可参考:https://wallet.95516.com/s/wl/WebAPP/helpAgree/page/agreement/regPrivacy.html",
|
||||
"permissions": "安卓访问如下权限: <uses-permission android:name=\"android.permission.INTERNET\" /> <uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\" /> <uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\" />"
|
||||
},
|
||||
"npmurl": "",
|
||||
"darkmode": "√",
|
||||
"i18n": "√",
|
||||
"widescreen": "√"
|
||||
},
|
||||
"uni_modules": {
|
||||
"dependencies": [],
|
||||
"encrypt": [],
|
||||
"platforms": {
|
||||
"cloud": {
|
||||
"tcb": "√",
|
||||
"aliyun": "√",
|
||||
"alipay": "√"
|
||||
},
|
||||
"client": {
|
||||
"uni-app": {
|
||||
"vue": {
|
||||
"vue2": {
|
||||
"extVersion": "1.0.0",
|
||||
"minVersion": ""
|
||||
},
|
||||
"vue3": {
|
||||
"extVersion": "1.0.0",
|
||||
"minVersion": ""
|
||||
}
|
||||
},
|
||||
"web": {
|
||||
"safari": "x",
|
||||
"chrome": "x"
|
||||
},
|
||||
"app": {
|
||||
"vue": {
|
||||
"extVersion": "1.0.0",
|
||||
"minVersion": ""
|
||||
},
|
||||
"nvue": {
|
||||
"extVersion": "1.0.0",
|
||||
"minVersion": ""
|
||||
},
|
||||
"android": {
|
||||
"extVersion": "1.0.0",
|
||||
"minVersion": "21"
|
||||
},
|
||||
"ios": {
|
||||
"extVersion": "1.0.0",
|
||||
"minVersion": "12"
|
||||
},
|
||||
"harmony": {
|
||||
"extVersion": "1.0.0",
|
||||
"minVersion": "12"
|
||||
}
|
||||
},
|
||||
"mp": {
|
||||
"weixin": "x",
|
||||
"alipay": "x",
|
||||
"toutiao": "x",
|
||||
"baidu": "x",
|
||||
"kuaishou": "x",
|
||||
"jd": "x",
|
||||
"harmony": "x",
|
||||
"qq": "x",
|
||||
"lark": "x",
|
||||
"xhs": "x"
|
||||
},
|
||||
"quickapp": {
|
||||
"huawei": "x",
|
||||
"union": "x"
|
||||
}
|
||||
},
|
||||
"uni-app-x": {
|
||||
"web": {
|
||||
"safari": "x",
|
||||
"chrome": "x"
|
||||
},
|
||||
"app": {
|
||||
"android": {
|
||||
"extVersion": "1.0.0",
|
||||
"minVersion": "21"
|
||||
},
|
||||
"ios": {
|
||||
"extVersion": "1.0.0",
|
||||
"minVersion": "12"
|
||||
},
|
||||
"harmony": {
|
||||
"extVersion": "1.0.0",
|
||||
"minVersion": "12"
|
||||
}
|
||||
},
|
||||
"mp": {
|
||||
"weixin": "x"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
260
property-uniapp-project/uni_modules/liyahong-unionpay/readme.md
Normal file
260
property-uniapp-project/uni_modules/liyahong-unionpay/readme.md
Normal file
@@ -0,0 +1,260 @@
|
||||
##插件功能概述
|
||||
* 支持拉起云闪付并完成支付
|
||||
* 支持检查是否安装云闪付
|
||||
* 支持获取已安装的云闪付直通App列表
|
||||
* 支持配置各个直通银行及手机支付(如小米支付、华为支付等)
|
||||
* 支持Android/IOS/harmonyOS三端`本插件为原生SDK,仅支持App端`
|
||||
* 待完善功能。。。
|
||||
|
||||
##插件接入文档
|
||||
### 关于更新
|
||||
有空闲时间会不断更新维护,有问题随便提,有时间一定会修改!
|
||||
|
||||
### 特别推荐
|
||||
其他插件请参考主页,如人脸采集、百度OCR等(深受广大用户青睐,可以一试)
|
||||
* 作者主页:[https://ext.dcloud.net.cn/publisher?id=214114](https://ext.dcloud.net.cn/publisher?id=214114)
|
||||
|
||||
### 鸿蒙特殊说明`重要授权说明`
|
||||
* uni-app项目: 由于官方目前不支持`试用以及普通授权`,建议`新建uni-appx项目`引用插件测通后购买源码授权使用
|
||||
* uni-appx项目: 可直接使用
|
||||
|
||||
###准备工作
|
||||
1. Android、ios、harmonyOS端证书准备工作
|
||||
* 1) Android端:准备应用的Android打包文件.jks文件。(`如使用官方证书忽略`)参考:[https://ask.dcloud.net.cn/article/35777](https://ask.dcloud.net.cn/article/35777)
|
||||
* 2) IOS端:这里只简单介绍一下windows系统下如何创建ios证书,如果你是mac系统,直接百度搜索就行,网上一堆教程,windows证书申请教程参考:[https://www.pianshen.com/article/59121497532/](https://www.pianshen.com/article/59121497532/)
|
||||
* 3) harmonyOS端:usb连接真机 ---> 运行 ---> 运行手机或模拟器 ---> 运行到鸿蒙 ---> 配置证书(可以自动生成) ---> 运行
|
||||
|
||||
###接入步骤
|
||||
#### 最简单的接入步骤(基本10分钟搞定)
|
||||
* step1:插件页右边有个`试用`的按钮,点它,然后弹出来一个模态框,选择`试用的项目`,点击`确认`按钮,点击`继续导入HBuilderX`
|
||||
* step2:将demo里面`index.vue`文件里面的函数方法复制过来
|
||||
* step3:打开你项目的`manifest.json`文件,找到`安卓/iOS常用其他设置`,找到`IOS设置` ---> `UrlSchemes`,将`uppaylyhuts`填写进去。如果你本来就有(比如你原来有XXX)则是:`XXX,uppaylyhuts`
|
||||
* step4:同上,在`安卓/iOS常用其他设置`中找到`IOS设置` ---> `应用访问白名单`,将`uppaywallet,uppaysdk,uppayx1,uppayx2,uppayx3,paesuperbank,ccbmbsylunionpay,bocom,bankabc,cmbmobilebank,cmblife,com.icbc.iphoneclient,spdbbank,spdbcccUnionPay,citicbankpay,credit,uppayxingyecredit,uppayhuaxiacredit,uppaybeijingcredit,uppayzhonghangcredit,uppayguangdacredit,uppaygonghangcredit,uppayjianhangcredit,uppayjiaohangcredit,uppayguangfa,psbccashier,uppayyouchucredit,com.cebbank.ebank,BankOfShangHai,boscgdlf,citicbankdkkj,cmbc,cibmb,bocmbankpsn,bankofbjpay,uppaynonghangcredit,uppayhuaxia,zytuppay,LZYHSJYHAUTHSSOAPP,bnbpay,dlrcb,czbank,uppayCbhb`填写进去
|
||||
* step5:Android/IOS打自定义基座包,然后选择以自定义基座包运行
|
||||
* step6:harmonyOS执行完成准备工作,将`moudle.json5文件拷贝至harmony-configs -> entry -> src -> main目录下`
|
||||
* step6.1:`module.json5`路径:`unpackage -> dist -> dev -> app-harmony -> entry -> src -> main`
|
||||
* step6.2:修改`module.json5`文件,新增以下代码
|
||||
```javascript
|
||||
"module": {
|
||||
...
|
||||
"pages": "$profile:main_pages",
|
||||
"querySchemes": [
|
||||
"uppaywallet",
|
||||
"uppaysdk",
|
||||
],
|
||||
"abilities": [
|
||||
{
|
||||
...
|
||||
"skills": [
|
||||
{
|
||||
...
|
||||
"uris": [
|
||||
{
|
||||
"scheme": "uppaylyhuts",
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
* step7:运行项目
|
||||
|
||||
#### 详细接入步骤及其他细则
|
||||
1. 使用插件
|
||||
* 1) 插件方法说明(HX其实都有提示,再赘述一遍吧,别嫌我啰嗦哈)
|
||||
+ checkWalletInstalled() 检查是否安装云闪付App,返回true或者false
|
||||
+ startPay(object) 拉起云闪付app并发起支付,具体说明见下
|
||||
+ getDirectApps(function) 检查已安装的支持直通模式的银行app列表。`用途是在服务端生成tn时,保留域传入"supportBank": "银行标识"`。`感谢用户cha***@126.com的修正`
|
||||
|
||||
---
|
||||
> `startPay`方法说明
|
||||
>
|
||||
> 参数说明(入参为object)
|
||||
>
|
||||
> | 属性 | 类型 | 默认值 | 必填 | 说明 |
|
||||
> | ------------ | ------------ | ------------ | ------------ | ------------ |
|
||||
> |mode | string | 无 | 是 | 银联环境,可选项00/01,00正式环境,01测试环境 |
|
||||
> |tn | string | 无 | 是 | 服务端返回的交易流水号,即tn |
|
||||
> |seType | string | 无 | 否 | `【IOS无效】`手机pay支付类别,传入会展示对应的手机支付,如:华为支付就传04,具体说明见`seType说明表` |
|
||||
> |callback | function | 无 | 是 | 支付结果回调,回参为`object`,属性见`返回值说明` |
|
||||
>
|
||||
> 返回值说明
|
||||
>
|
||||
> | 属性 | 返回值说明 |
|
||||
> | ------------ | ------------ |
|
||||
> |code | 【必填】状态码,0:支付成功、1:前台支付成功,存在不确定性,需要后端查询订单实际支付结果(基于data中的签名判断)、-1:支付失败、-2:支付取消 |
|
||||
> |msg | 【必填】提示信息 |
|
||||
> |data | 【选填】支付签名信息,只有`code=1`的时候返回 |
|
||||
|
||||
---
|
||||
> `getDirectApps`方法说明
|
||||
>
|
||||
> 参数说明(入参为function函数,回参为`object`,属性见`返回值说明`)
|
||||
>
|
||||
> 返回值说明
|
||||
>
|
||||
> | 属性 | 返回值说明 |
|
||||
> | ------------ | ------------ |
|
||||
> |code | 【必填】状态码。0:请求成功、1:请求失败(会将银联的错误code和错误msg都返回在data中,组成一个对象) |
|
||||
> |msg | 【必填】提示信息 |
|
||||
> |data | 【必填】响应结果。code=0时为Array<string>对象,其中的值代表`直通银行标识`,详见`直通银行标识对照表`、code=1是为object对象,是银联的错误对象 |
|
||||
|
||||
2. seType说明表`注意:seType是string类型,不是number`
|
||||
|
||||
| 手机品牌 | seType |
|
||||
| ------------ | ------------ |
|
||||
| Samsung Pay | 02 |
|
||||
| Huawei Pay | 04 |
|
||||
| Meizu Pay | 27 |
|
||||
| Le Pay | 30 |
|
||||
| Mi Pay | 25 |
|
||||
| OPPO Pay | 29 |
|
||||
| vivo Pay | 33 |
|
||||
| Smartisan Pay | 32 |
|
||||
| realme Pay | 35 |
|
||||
|
||||
3. 代码示例
|
||||
|
||||
```javascript
|
||||
// uniapp项目引入方式
|
||||
import { checkWalletInstalled, getDirectApps, startPay } from '../../uni_modules/liyahong-unionpay'
|
||||
// uniappx项目引用方式(注意:uniappx项目必须使用@符号的方式引用,否则会报路径找不到的问题)
|
||||
import { checkWalletInstalled, getDirectApps, startPay } from '@/uni_modules/liyahong-unionpay'
|
||||
|
||||
/**
|
||||
* 检查是否安装云闪付App
|
||||
*/
|
||||
checkInstalled() {
|
||||
const result = checkWalletInstalled()
|
||||
this.installResult = `是否安装云闪付:${result}`
|
||||
},
|
||||
/**
|
||||
* 【鸿蒙不支持此功能】获取直通银行App列表
|
||||
*/
|
||||
getBankAppList() {
|
||||
getDirectApps((result) => {
|
||||
console.log(JSON.stringify(result))
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 拉起云闪付进行支付
|
||||
*/
|
||||
startPay() {
|
||||
startPay({
|
||||
tn: '',
|
||||
mode: '00',
|
||||
callback: (result) => {
|
||||
console.log(JSON.stringify(result))
|
||||
}
|
||||
})
|
||||
}
|
||||
```
|
||||
|
||||
4. 直通银行标识对照表`服务端生成tn时使用,举例:supportBank:CQP`
|
||||
|
||||
| 银行标识 | 银行 APP 名称 |
|
||||
| ------------ | ------------ |
|
||||
| CQP | 云闪付 |
|
||||
| CMBCC | 全民生活 |
|
||||
| PAB | 平安口袋银行 |
|
||||
| CCB | 中国建设银行 |
|
||||
| BoCom | 交通银行 |
|
||||
| ABC | 中国农业银行 |
|
||||
| CMB | 招商银行 |
|
||||
| CMBLIFE | 掌上生活 |
|
||||
| ICBC | 中国工商银行 |
|
||||
| SPDB | 浦发银行 |
|
||||
| SPDBC | 浦大喜奔 |
|
||||
| CNCB | 中信银行手机银行 |
|
||||
| GDBC | 发现精彩 |
|
||||
| CIBC | 兴业生活(好兴动) |
|
||||
| HXBC | 华彩生活 |
|
||||
| BCCBC | 掌上京彩 |
|
||||
| BOCC | 中国银行缤纷生活 |
|
||||
| CEBC | 阳光惠生活 |
|
||||
| ICBCC | 工银 e 生活 |
|
||||
| CCBC | 建行生活 |
|
||||
| BoComC | 买单吧 |
|
||||
| GDB | 广发银行手机银行 |
|
||||
| PSBC | 邮储银行 |
|
||||
| PSBCC | 邮储信用卡 |
|
||||
| CEB | 光大银行手机银行 |
|
||||
| BOS | 上海银行手机银行 |
|
||||
| SHBANK | 上银美好生活 |
|
||||
| CNCBC | 动卡空间 |
|
||||
| CMBC | 民生银行手机银行 |
|
||||
| CIB | 兴业银行手机银行 |
|
||||
| BOC | 中国银行 |
|
||||
| BCCB | 京彩生活 |
|
||||
| ABCC | 农银 e 管家 |
|
||||
| HXB | 华夏手机银行 |
|
||||
|
||||
5. iOS访问白名单对照表
|
||||
|
||||
| 支付 APP scheme | 对应支付 APP |
|
||||
| ------------ | ------------ |
|
||||
| uppaysdk | 云闪付 APP |
|
||||
| uppaywallet | 云闪付 APP |
|
||||
| uppayx1 | 全民生活 |
|
||||
| uppayx2 | 预留 |
|
||||
| uppayx3 | 预留 |
|
||||
| paesuperbank | 平安口袋银行 |
|
||||
| ccbmbsylunionpay | 中国建设银行 |
|
||||
| bocom | 交通银行 |
|
||||
| bankabc | 中国农业银行 |
|
||||
| cmbmobilebank | 招商银行 |
|
||||
| cmblife | 掌上生活 |
|
||||
| com.icbc.iphoneclient | 中国工商银行 |
|
||||
| spdbbank | 浦发银行 |
|
||||
| spdbcccUnionPay | 浦大喜奔 |
|
||||
| citicbankpay | 中信银行手机银行 |
|
||||
| credit | 发现精彩 |
|
||||
| uppayxingyecredit | 兴业生活(好兴动) |
|
||||
| uppayhuaxiacredit | 华彩生活 |
|
||||
| uppaybeijingcredit | 掌上京彩 |
|
||||
| uppayzhonghangcredit | 中国银行缤纷生活 |
|
||||
| uppayguangdacredit | 阳光惠生活 |
|
||||
| uppaygonghangcredit | 工银 e 生活 |
|
||||
| uppayjianhangcredit | 建行生活 |
|
||||
| uppayjiaohangcredit | 买单吧 |
|
||||
| uppayguangfa | 广发银行手机银行 |
|
||||
| psbccashier | 邮储银行 |
|
||||
| uppayyouchucredit | 邮储信用卡 |
|
||||
| com.cebbank.ebank | 光大银行手机银行 |
|
||||
| BankOfShangHai | 上海银行手机银行 |
|
||||
| boscgdlf | 上银美好生活 |
|
||||
| citicbankdkkj | 动卡空间 |
|
||||
| cmbc | 民生银行手机银行 |
|
||||
| cibmb | 兴业银行手机银行 |
|
||||
| bocmbankpsn | 中国银行 |
|
||||
| bankofbjpay | 京彩生活 |
|
||||
| uppaynonghangcredit | 农银 e 管家 |
|
||||
| uppayhuaxia | 华夏手机银行 |
|
||||
| zytuppay | 中银通 |
|
||||
| LZYHSJYHAUTHSSOAPP | 兰州银行 |
|
||||
| bnbpay | 宁波银行 |
|
||||
| dlrcb | 大连农商行 |
|
||||
| czbank | 浙商银行 |
|
||||
| uppayCbhb | 渤海银行 |
|
||||
|
||||
6. 其他附属
|
||||
|
||||
* 1) 银联测试卡链接:[测试卡直达](https://open.unionpay.com/tjweb/support/faq/mchlist?id=4)
|
||||
* 2) 商户需按照以下链接及表格内容配置 IP 及地址白名单。[配置服务端白名单链接直达](https://open.unionpay.com/tjweb/support/faq/mchlist?id=228)
|
||||
|
||||
| 测试 | 生产 |
|
||||
| ------------ | ------------ |
|
||||
| https://appcashier.test.cup.com.cn | https://conf.cup.com.cn |
|
||||
| https://appcashier.test.95516.com | https://conf.95516.com |
|
||||
| | https://acpstatic.cup.com.cn |
|
||||
| | https://acpstatic.95516.com |
|
||||
| | https://appcashier.95516.com |
|
||||
|
||||
* 3) Apple Pay需要自行接入,接入参考:[链接直达](https://open.unionpay.com/tjweb/support/faq/mchlist?id=741)
|
||||
* 4) 其他问题请参见 [https://open.unionpay.com](https://open.unionpay.com) 帮助中心-FAQ
|
||||
|
||||
7. 已知问题
|
||||
* Q:频繁调用`getDirectApps`、`startPay`函数会导致callback回调触发多次?`感谢用户:[爱心]GLL`
|
||||
* A:多页面可以通过页面路径来判断是否是当前页面触发,如果是再执行下一步操作,否则拦截
|
||||
@@ -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