更新记录
1.0.2(2024-04-07)
更新操作说明书
1.0.1(2024-04-01)
1:支持支付宝支付 2:支持双卡支付 3:更新使用说明
平台兼容性
Android | Android CPU类型 | iOS |
---|---|---|
适用版本区间:7.1 - 13.0 | armeabi-v7a:支持,arm64-v8a:支持,x86:支持 | × |
原生插件通用使用流程:
- 购买插件,选择该插件绑定的项目。
- 在HBuilderX里找到项目,在manifest的app原生插件配置中勾选模块,如需要填写参数则参考插件作者的文档添加。
- 根据插件作者的提供的文档开发代码,在代码中引用插件,调用插件功能。
- 打包自定义基座,选择插件,得到自定义基座,然后运行时选择自定义基座,进行log输出测试。
- 开发完毕后正式云打包
付费原生插件目前不支持离线打包。
Android 离线打包原生插件另见文档 https://nativesupport.dcloud.net.cn/NativePlugin/offline_package/android
iOS 离线打包原生插件另见文档 https://nativesupport.dcloud.net.cn/NativePlugin/offline_package/ios
注意事项:使用HBuilderX2.7.14以下版本,如果同一插件且同一appid下购买并绑定了多个包名,提交云打包界面提示包名绑定不一致时,需要在HBuilderX项目中manifest.json->“App原生插件配置”->”云端插件“列表中删除该插件重新选择
Airwallex Payment Demo
1:调用方式
var mpairwallexModule = uni.requireNativePlugin("mphl-airwallex");
2:参数格式与解释
//json格式参数
var res = {
"msg": "请求成功",
"code": 1,
"data": {//数据,通过空中云汇接口创建的PaymentIntent结果均需要传过来
"customer_payment_consents": [],
"base_currency": "HKD",
"amount": 0.03,//总金额
"merchant_order_id": "AO202410590922571847001100",//商家订单编号
"customer_payment_methods": [],
"available_payment_method_types": [
"card",
"alipaycn",
"wechatpay",
"alipayhk",
"applepay",
"googlepay"
],
"created_at": "2024-03-27T02:59:09+0000",
"descriptor": "YYYXINTERNATIONALCO.,LIMITED",
"nonce": "XB3vK9AS",
//空中云汇token必须传递
"token": "eyJhbGciOiJIUzI1NiJ9.eyJ0eXBlIjoiY2xpZW50IiwiZGMiOiJISyIsImRhdGFfY2VudGVyX3JlZ2lvbiI6IkhLIiwiaXNzZGMiOiJVUyIsImp0aSI6ImFmZjU3NDNlLWNiZjAtNDNkNC1hNmJkLTU0MzA0MTlmYjIxYyIsInN1YiI6IjBjYWI1Y2FiLTUyOTMtNGFiZC05MDU2LTVhNzc5Yjc3YzA2YSIsImlhdCI6MTcxMTUwNzgwNSwiZXhwIjoxNzExNTA5NjA1LCJhY2NvdW50X2lkIjoiNjIyYTZhNWMtZjVhYS00YzdjLTk1NzgtMGEzYzI4ZWYxMDRlIiwicGVybWlzc2lvbnMiOlsicjphd3g6KjoqIiwidzphd3g6KjoqIl19.lS2GNtNhYSoCkevaxFf-lIaOoWWzGbOR3_8Zd53nrrI",
"updated_at": "2024-03-27T02:59:09+0000",
"captured_amount": 0,
"base_amount": 0.03,
"currency": "HKD",
"id": "int_hkpd4vlwjguog2xp892",
"client_secret": "eyJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE3MTE1MDgzNDksImV4cCI6MTcxMTUxMTk0OSwidHlwZSI6ImNsaWVudC1zZWNyZXQiLCJwYWRjIjoiSEsiLCJhY2NvdW50X2lkIjoiNjIyYTZhNWMtZjVhYS00YzdjLTk1NzgtMGEzYzI4ZWYxMDRlIiwiaW50ZW50X2lkIjoiaW50X2hrcGQ0dmx3amd1b2cyeHA4OTIiLCJjdXN0b21lcl9pZCI6ImN1c19oa3BkOXJ3aDhndWl4bDg1YWZ2IiwiYnVzaW5lc3NfbmFtZSI6IllZWVggSU5URVJOQVRJT05BTCBDTy4sIExJTUlURUQifQ.TMXP5Ic9cVscB4yCY8l0CONidZEUCQTd2rkA_DMLWQY",
"customer_id": "cus_hkpd9rwh8guixl85afv",
"pay_id": "797",
"request_id": "AO202410590922571847001100",
"order": {
"type": "Onlinerecharge",
"products": [
{
"code": "8",
"quantity": 1,
"name": "购买`套餐一`",
"sku": "",
"type": "Onlinerecharge",
"unit_price": 0.01,
"url": "https://sstvcn.com/uploads/20231223/dcdcf342f5dda1f4564a1c2644d57855.jpg",
"desc": "购买`套餐一`"
}
]
},
"option": {//按钮自定义配置
"buttonType": "去支付",//按钮上文字
"buttonColor": "#612fff",//按钮背景色
"countryCode": "HK",
"totalPriceLabel": "總金額"//总金额标签显示文字
},
"status": "REQUIRES_PAYMENT_METHOD"
}
}
3:方法调用
mpairwallexModule.gotoPayment(res,(ret) => {
//回调逻辑自定义
if(ret.code == 1){
}else{
}
});
4:结果回调
json格式,{code:1,msg:"",title:""} code:结果码,1-成功,0-不成功 msg:具体结果文字信息