新零售支付全家桶


创建支付订单,完成付款

<p>因为H5 APP创建支付订单的后端WEB方法可以使用之前安卓项目的WEB方法,所以不需要再创建,只需要写好uni-app的订单页面代码即可。</p> <pre><code class="language-javasript">uni.request({ url: that.url.zfb.appPayOrder, method: "POST", header: { "token": uni.getStorageSync("token") }, data: { "orderId": id }, success: function(resp) { let orderString = resp.data.orderString const jyAliPay = uni.requireNativePlugin('JY-ALIPAY') jyAliPay.show({ // 发起支付 if_sanbox: true, auto_create_order_info: false, appid: that.zfb.app.appid, rsa2_private: that.zfb.app.privateKey, order_info: orderString }, function(result) { // 支付完成回调 // console.log(result) if (result.resultStatus == '9000') { uni.showToast({ title: "付款成功" }) uni.request({ url: that.url.zfb.updateOrderStatus, method: "POST", header: { "token": uni.getStorageSync("token") }, data: { "orderId": id }, success: function(resp) { that.loadData() } }) } else { uni.showToast({ title: "付款失败", icon: "none" }) } }); } )</code></pre> <p>如果在非沙箱环境中使用支付宝付款,代码应该这样写:</p> <pre><code class="language-javascript">uni.requestPayment({ provider:"alipay", orderInfo:orderString, success:function(){ }, fail:function(){ } })</code></pre>

页面列表

ITEM_HTML