更新记录
1.0.0(2026-06-09)
发布版本
平台兼容性
uni-app(4.56)
| Vue2 | Vue3 | Chrome | Safari | app-vue | app-nvue | Android | iOS | 鸿蒙 |
|---|---|---|---|---|---|---|---|---|
| - | - | - | - | - | - | √ | √ | √ |
| 微信小程序 | 支付宝小程序 | 抖音小程序 | 百度小程序 | 快手小程序 | 京东小程序 | 鸿蒙元服务 | QQ小程序 | 飞书小程序 | 小红书小程序 | 快应用-华为 | 快应用-联盟 |
|---|---|---|---|---|---|---|---|---|---|---|---|
| - | - | - | - | - | - | - | - | - | - | - | - |
uni-app x(4.56)
| Chrome | Safari | Android | iOS | 鸿蒙 | 微信小程序 |
|---|---|---|---|---|---|
| - | - | √ | √ | √ | - |
jwh-jhlzf
建行龙支付、微信 App 支付、支付宝 App 支付 UTS 插件。支持 App Android、App iOS、HarmonyOS。
配置总览
先准备这些值:
| 名称 | 示例 | 用途 |
|---|---|---|
<ccbThirdAppInfo> |
comccbpay你的商户号xxx |
建行 App 回跳标识,对应订单串里的 THIRDAPPINFO。 |
<wechatAppId> |
wx1234567890abcdef |
微信开放平台 AppID。 |
<wechatUniversalLink> |
https://pay.example.com/app/ |
iOS 微信 Universal Link。 |
<androidApplicationId> |
com.example.demo |
Android 应用包名。 |
<androidSign> |
你的 Android 签名 | 微信开放平台、建行后台配置使用。 |
<harmonyWant> |
当前 Ability 的 want |
HarmonyOS 微信初始化使用。 |
按支付方式配置
龙支付:provider: 'ccb'
| 端 | 必须配置 |
|---|---|
| Android | uni_modules/jwh-jhlzf/utssdk/app-android/AndroidManifest.xml 里的建行 <action android:name="<ccbThirdAppInfo>" />。 |
| iOS | manifest.json > app-plus.distribute.ios.urltypes 包含 <ccbThirdAppInfo>。 |
| HarmonyOS | entry/src/main/module.json5 的 querySchemes 包含 ccbapp、mbspay。 |
| 服务端 | 返回建行龙支付 orderInfo;THIRDAPPINFO=<ccbThirdAppInfo>。 |
| JS 调用 | pay({ provider: 'ccb', orderInfo }),不需要调用 initPayment。 |
聚合支付:provider: 'aggregate'
| 端 | 必须配置 |
|---|---|
| Android | 与龙支付相同:配置建行 <action android:name="<ccbThirdAppInfo>" />。 |
| iOS | 与龙支付相同:urltypes 包含 <ccbThirdAppInfo>。 |
| HarmonyOS | querySchemes 包含 ccbapp、mbspay。 |
| 服务端 | 返回建行聚合支付 orderInfo;THIRDAPPINFO=<ccbThirdAppInfo>;商户后台开通聚合支付需要展示的渠道。 |
| JS 调用 | pay({ provider: 'aggregate', orderInfo }),不需要调用 initPayment。 |
如果聚合页里要使用微信渠道,再按“微信支付”补齐微信开放平台配置。如果聚合页里要使用支付宝渠道,再按“支付宝支付”确认支付宝 scheme 配置。
微信支付:provider: 'wechat'
| 端 | 必须配置 |
|---|---|
| Android | 建行 <action android:name="<ccbThirdAppInfo>" />;微信开放平台填写 <wechatAppId>、<androidApplicationId>、<androidSign>。 |
| iOS | urltypes 包含 <ccbThirdAppInfo>,<wechatAppId>;微信开放平台填写 <wechatAppId>、Bundle ID、<wechatUniversalLink>。 |
| HarmonyOS | querySchemes 包含 weixin、wxopensdk;调用 initPayment 时传 <wechatAppId> 和 <harmonyWant>。 |
| 服务端 | 返回微信支付对应的 orderInfo;需要建行回跳时 THIRDAPPINFO=<ccbThirdAppInfo>。 |
| JS 调用 | 先 initPayment(...),再 pay({ provider: 'wechat', orderInfo })。 |
支付宝支付:provider: 'alipay'
| 端 | 必须配置 |
|---|---|
| Android | 插件已包含支付宝 SDK 和包名查询配置;不需要额外配置支付宝 AppID。 |
| iOS | urltypes 包含 <ccbThirdAppInfo>;插件已包含支付宝 SDK。 |
| HarmonyOS | querySchemes 包含 https、alipays。 |
| 服务端 | 返回支付宝支付对应的 orderInfo。 |
| JS 调用 | pay({ provider: 'alipay', orderInfo }),不需要调用 initPayment。 |
Android 必配
1. 修改建行回跳 action
文件位置:
uni_modules/jwh-jhlzf/utssdk/app-android/AndroidManifest.xml
找到:
<activity
android:name="com.ccb.ccbnetpay.activity.appresult.ResultActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:exported="true"
android:screenOrientation="portrait"
tools:node="merge">
<intent-filter>
<action android:name="comccbpay你的商户号xxx" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
只改 <action> 这一行:
<action android:name="<ccbThirdAppInfo>" />
2. 检查微信回跳入口
文件位置:
uni_modules/jwh-jhlzf/utssdk/app-android/AndroidManifest.xml
保留:
<activity-alias
android:name="${applicationId}.wxapi.WXPayEntryActivity"
android:exported="true"
android:targetActivity="uts.sdk.modules.jwhJhlzf.WXPayEntryActivity"
android:theme="@android:style/Theme.Translucent.NoTitleBar"
tools:node="merge" />
3. 配置微信开放平台
使用 provider: 'wechat' 时必须配置:
| 微信开放平台字段 | 填写 |
|---|---|
| AppID | <wechatAppId> |
| Android 包名 | <androidApplicationId> |
| Android 签名 | <androidSign> |
4. 不启用内置支付模块
文件位置:
manifest.json
不要配置 HBuilderX 内置支付:
{
"app-plus": {
"modules": {
"Payment": {}
},
"distribute": {
"sdkConfigs": {
"payment": {}
}
}
}
}
插件已声明:
| SDK | 当前版本 |
|---|---|
| 建行 SDK | utssdk/app-android/libs/ccbnetbankpay_v2.6.0_pro.aar |
| 微信 SDK | com.tencent.mm.opensdk:wechat-sdk-android:6.8.0 |
| 支付宝 SDK | com.alipay.sdk:alipaysdk-android:15.8.41 |
iOS 必配
1. 配置 URL Schemes
文件位置:
manifest.json
配置位置:
{
"app-plus": {
"distribute": {
"ios": {
"urltypes": "<ccbThirdAppInfo>,<wechatAppId>"
}
}
}
}
填写规则:
| 使用渠道 | urltypes 必须包含 |
|---|---|
ccb |
<ccbThirdAppInfo> |
aggregate |
<ccbThirdAppInfo> |
wechat |
<ccbThirdAppInfo>,<wechatAppId> |
alipay |
<ccbThirdAppInfo> |
2. 配置微信开放平台
使用 provider: 'wechat' 时必须配置:
| 微信开放平台字段 | 填写 |
|---|---|
| AppID | <wechatAppId> |
| Bundle ID | 你的 iOS Bundle ID |
| Universal Link | <wechatUniversalLink> |
3. 插件已声明
| SDK | 当前版本 |
|---|---|
| 建行 SDK | utssdk/app-ios/Frameworks/CCBNetPaySDK.framework |
| 微信 SDK | utssdk/app-ios/Libs/libWeChatSDK.a |
| 支付宝 SDK | AlipaySDK-iOS 15.8.30 |
| 最低系统版本 | iOS 12.0 |
不要额外引入 WechatOpenSDK。
HarmonyOS 必配
1. 配置 querySchemes
文件位置按你的 HarmonyOS 工程结构,一般是:
entry/src/main/module.json5
按使用渠道配置:
| 使用渠道 | querySchemes 必须包含 |
|---|---|
ccb |
ccbapp、mbspay |
aggregate |
ccbapp、mbspay |
wechat |
weixin、wxopensdk |
alipay |
https、alipays |
示例:
{
module: {
querySchemes: [
"ccbapp",
"mbspay",
"weixin",
"wxopensdk",
"https",
"alipays"
]
}
}
2. 微信支付初始化参数
使用 provider: 'wechat' 时必须传:
initPayment({
wechatAppId: '<wechatAppId>',
want: harmonyWant
})
3. 插件已声明
| SDK | 当前版本 |
|---|---|
| 建行 SDK | utssdk/app-harmony/libs/longpaysdk_v2.2_pro.har |
| 微信 SDK | @tencent/wechat_open_sdk 1.0.14 |
| 支付宝 SDK | @cashier_alipay/cashiersdk 15.8.26 |
服务端必配
服务端返回完整建行订单参数串 orderInfo:
MERCHANTID=...&POSID=...&BRANCHID=...&ORDERID=...&PAYMENT=...&TXCODE=...&THIRDAPPINFO=<ccbThirdAppInfo>&MAC=...
必须保持一致:
| 项 | 必须一致 |
|---|---|
| Android 建行回跳 action | <ccbThirdAppInfo> |
iOS urltypes 建行 scheme |
<ccbThirdAppInfo> |
| 服务端订单串 | THIRDAPPINFO=<ccbThirdAppInfo> |
当前示例值替换清单:
| 位置 | 当前示例值 | 替换成 |
|---|---|---|
uni_modules/jwh-jhlzf/utssdk/app-android/AndroidManifest.xml |
comccbpay你的商户号xxx |
<ccbThirdAppInfo> |
manifest.json > app-plus.distribute.android.schemes |
comccbpay你的商户号xxx,lzfcs |
<ccbThirdAppInfo>,<你的其他scheme> |
manifest.json > app-plus.distribute.ios.urltypes |
comccbpay你的商户号xxx,lzfcs,wx1234567890abcdef |
<ccbThirdAppInfo>,<你的其他scheme>,<wechatAppId> |
JS 调用 initPayment.wechatAppId |
wx1234567890abcdef |
<wechatAppId> |
JS 调用 initPayment.universalLink |
https://help.wechat.com/... |
<wechatUniversalLink> |
快速接入
1. 引入插件
import {
initPayment,
pay,
isAppInstalled,
getSDKVersion
} from '@/uni_modules/jwh-jhlzf'
2. 选择支付渠道
| 支付方式 | provider | 必要配置 |
|---|---|---|
| 建行龙支付 | ccb |
对应端的建行配置、服务端 orderInfo。 |
| 聚合/综合选择支付 | aggregate |
对应端的建行配置、服务端 orderInfo。 |
| 微信支付 | wechat |
对应端的微信配置、initPayment、服务端 orderInfo。 |
| 支付宝支付 | alipay |
对应端的支付宝配置、服务端 orderInfo。 |
3. 复制支付代码
let wechatReady = false
function ensureWechatPaymentReady(provider, done) {
if (provider !== 'wechat') {
done()
return
}
if (wechatReady) {
done()
return
}
initPayment({
wechatAppId: '<wechatAppId>',
universalLink: '<wechatUniversalLink>',
// HarmonyOS 微信支付时传入当前 want
// want: harmonyWant,
success: () => {
wechatReady = true
done()
},
fail: (err) => {
console.log('微信支付初始化失败', err)
}
})
}
function startPayment(provider, orderInfo) {
if (!orderInfo) {
console.log('orderInfo 不能为空')
return
}
if (!isAppInstalled({ provider })) {
console.log('未安装对应支付 App')
return
}
ensureWechatPaymentReady(provider, () => {
pay({
provider: provider,
orderInfo: orderInfo,
success: (res) => {
console.log('支付成功', res)
},
fail: (err) => {
if (err.errCode === 9010007) {
console.log('用户取消支付', err)
return
}
console.log('支付失败', err)
},
complete: (res) => {
console.log('支付结束', res)
}
})
})
}
4. 发起支付
startPayment('ccb', orderInfo)
startPayment('aggregate', orderInfo)
startPayment('wechat', orderInfo)
startPayment('alipay', orderInfo)
直接调用:
pay({ provider: 'ccb', orderInfo })
pay({ provider: 'aggregate', orderInfo })
pay({ provider: 'wechat', orderInfo })
pay({ provider: 'alipay', orderInfo })
API 参数
initPayment
微信支付初始化。
initPayment({
wechatAppId: '<wechatAppId>',
universalLink: '<wechatUniversalLink>',
want: harmonyWant,
success: (res) => {},
fail: (err) => {},
complete: (res) => {}
})
| 参数 | 类型 | 必填端 | 说明 |
|---|---|---|---|
wechatAppId |
string |
Android/iOS/HarmonyOS | 微信开放平台 AppID。 |
universalLink |
string |
iOS | 微信 Universal Link。 |
want |
any |
HarmonyOS | 当前 Ability 的 want。 |
success |
function |
否 | 初始化成功回调。 |
fail |
function |
否 | 初始化失败回调。 |
complete |
function |
否 | 初始化完成回调。 |
pay
发起支付。
pay({
provider: 'ccb',
orderInfo: orderInfo,
success: (res) => {},
fail: (err) => {},
complete: (res) => {}
})
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
provider |
ccb \| aggregate \| wechat \| alipay |
否 | 不传默认 ccb。 |
orderInfo |
string |
是 | 服务端返回的建行订单参数串。 |
success |
function |
否 | 支付成功回调。 |
fail |
function |
否 | 支付失败回调。 |
complete |
function |
否 | 支付完成回调。 |
isAppInstalled
检查支付 App。
const installed = isAppInstalled({ provider: 'wechat' })
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
provider |
ccb \| aggregate \| wechat \| alipay |
是 | 要检查的支付渠道。 |
getSDKVersion
查看 SDK 版本。
console.log(getSDKVersion())
provider 对应入口
| provider | Android | iOS | HarmonyOS |
|---|---|---|---|
ccb |
provider: 'ccb' 调 CcbPayPlatform |
payAppOrder |
SDKBuilder + PayType.PAY_APP |
aggregate |
provider: 'aggregate' 调 CcbMorePay |
payViewOrder |
SDKBuilder + PayType.PAY_APP_H5 |
wechat |
CcbPayWechatPlatform |
payWechatOrder |
WXBuilder |
alipay |
CcbPayAliPlatform |
payAliSDKOrder |
@cashier_alipay/cashiersdk |
回调数据
成功回调:
{
provider: 'ccb',
status: 'success',
errCode: 0,
errMsg: 'pay:ok',
raw: {}
}
失败回调:
{
errCode: 9010006,
errMsg: '支付失败:...',
provider: 'ccb',
raw: {}
}
| errCode | 说明 |
|---|---|
9010001 |
参数错误。 |
9010002 |
当前平台或支付渠道不支持。 |
9010003 |
原生页面上下文不可用。 |
9010004 |
微信支付未初始化。 |
9010005 |
未安装对应支付 App。 |
9010006 |
支付失败。 |
9010007 |
用户取消支付。 |
9010008 |
支付结果未知。 |
常见返回
| 返回内容 | 处理 |
|---|---|
| 交易结果待确认 | 查服务端订单状态。 |
| 建行返回:支付服务连接失败 | 检查网络、环境、白名单、代理、防火墙、域名或 IP。 |
| 微信返回:支付失败 | 检查 AppID、包名、签名、订单参数、prepayId。 |
| 微信返回:用户取消支付 | 按取消处理,通常对应 9010007。 |
| 支付宝返回:订单支付失败 | 检查订单参数、签约产品、AppID、私钥签名。 |
| 支付宝返回:用户取消支付 | 按取消处理,通常对应 9010007。 |
| 支付宝返回:网络连接出错 | 检查设备网络。 |
| 支付宝返回:支付结果未知 | 查服务端订单状态,通常对应 9010008。 |
err.raw 保留 SDK 原始错误;err.errMsg 可能包含“原始错误”。

收藏人数:
购买源码授权版(
试用
使用 HBuilderX 导入示例项目
赞赏(0)
下载 93
赞赏 0
下载 12198230
赞赏 1918
赞赏
京公网安备:11010802035340号