qq小程序微信支付debug
parent
37fdd14fe1
commit
c1499a40af
|
|
@ -288,6 +288,13 @@ class OrderService
|
|||
// 支付日志id
|
||||
'order_id' => $pay_log['data']['id'],
|
||||
'order_no' => $pay_log['data']['log_no'],
|
||||
|
||||
// 支付方式信息
|
||||
'payment' => [
|
||||
'id' => $payment['id'],
|
||||
'name' => $payment['name'],
|
||||
'payment' => $payment['payment'],
|
||||
],
|
||||
];
|
||||
|
||||
// 是否线下支付
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ class Weixin
|
|||
'name' => '微信', // 插件名称
|
||||
'version' => '1.1.1', // 插件版本
|
||||
'apply_version' => '不限', // 适用系统版本描述
|
||||
'apply_terminal'=> ['pc', 'h5', 'ios', 'android', 'weixin', 'toutiao'], // 适用终端 默认全部 ['pc', 'h5', 'app', 'alipay', 'weixin', 'baidu']
|
||||
'apply_terminal'=> ['pc', 'h5', 'ios', 'android', 'weixin', 'toutiao', 'qq'], // 适用终端 默认全部 ['pc', 'h5', 'app', 'alipay', 'weixin', 'baidu']
|
||||
'desc' => '适用公众号+PC+H5+APP+[微信|头条]小程序,即时到帐支付方式,买家的交易资金直接打入卖家账户,快速回笼交易资金。 <a href="https://pay.weixin.qq.com/" target="_blank">立即申请</a>', // 插件描述(支持html)
|
||||
'author' => 'Devil', // 开发者
|
||||
'author_url' => 'http://shopxo.net/', // 开发者主页
|
||||
|
|
@ -337,8 +337,11 @@ class Weixin
|
|||
return DataReturn('支付类型不匹配', -1);
|
||||
}
|
||||
|
||||
// 平台
|
||||
$client_type = ApplicationClientType();
|
||||
|
||||
// openid
|
||||
if(APPLICATION == 'app')
|
||||
if($client_type == 'weixin')
|
||||
{
|
||||
$openid = isset($params['user']['weixin_openid']) ? $params['user']['weixin_openid'] : '';
|
||||
} else {
|
||||
|
|
@ -346,7 +349,7 @@ class Weixin
|
|||
}
|
||||
|
||||
// appid
|
||||
$appid = (APPLICATION == 'app') ? $this->config['mini_appid'] : $this->config['appid'];
|
||||
$appid = ($client_type == 'weixin') ? $this->config['mini_appid'] : $this->config['appid'];
|
||||
|
||||
// 异步地址处理
|
||||
$notify_url = (__MY_HTTP__ == 'https' && isset($this->config['agreement']) && $this->config['agreement'] == 1) ? 'http'.mb_substr($params['notify_url'], 5, null, 'utf-8') : $params['notify_url'];
|
||||
|
|
@ -389,6 +392,7 @@ class Weixin
|
|||
'weixin' => 'JSAPI',
|
||||
'h5' => 'MWEB',
|
||||
'toutiao' => 'MWEB',
|
||||
'qq' => 'MWEB',
|
||||
'app' => 'APP',
|
||||
'ios' => 'APP',
|
||||
'android' => 'APP',
|
||||
|
|
|
|||
|
|
@ -233,21 +233,41 @@ Page({
|
|||
switch (res.data.data.is_payment_type) {
|
||||
// 正常线上支付
|
||||
case 0 :
|
||||
qq.requestPayment({
|
||||
package: res.data.data.data,
|
||||
success: function(res) {
|
||||
// 数据设置
|
||||
self.order_item_pay_success_handle(order_ids);
|
||||
// 是否微信支付
|
||||
if(res.data.data.payment.payment == 'Weixin') {
|
||||
qq.requestWxPayment({
|
||||
url: res.data.data.data,
|
||||
referer: app.data.request_url,
|
||||
success: function(res) {
|
||||
// 数据设置
|
||||
self.order_item_pay_success_handle(order_ids);
|
||||
|
||||
// 跳转支付页面
|
||||
qq.navigateTo({
|
||||
url: "/pages/paytips/paytips?code=9000"
|
||||
});
|
||||
},
|
||||
fail: function (res) {
|
||||
app.showToast('支付失败');
|
||||
}
|
||||
});
|
||||
// 跳转支付页面
|
||||
qq.navigateTo({
|
||||
url: "/pages/paytips/paytips?code=9000"
|
||||
});
|
||||
},
|
||||
fail: function (res) {
|
||||
app.showToast('支付失败');
|
||||
}
|
||||
});
|
||||
} else {
|
||||
qq.requestPayment({
|
||||
package: res.data.data.data,
|
||||
success: function(res) {
|
||||
// 数据设置
|
||||
self.order_item_pay_success_handle(order_ids);
|
||||
|
||||
// 跳转支付页面
|
||||
qq.navigateTo({
|
||||
url: "/pages/paytips/paytips?code=9000"
|
||||
});
|
||||
},
|
||||
fail: function (res) {
|
||||
app.showToast('支付失败');
|
||||
}
|
||||
});
|
||||
}
|
||||
break;
|
||||
|
||||
// 线下支付
|
||||
|
|
|
|||
Loading…
Reference in New Issue