微信支付 优先扣除绑定币

master
tpingzhang 5 years ago
parent cd8c3f4d28
commit 6d2ff7a95d

@ -1195,6 +1195,7 @@ ADD COLUMN `pay_url` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL AFTER
// file_put_contents(dirname(__FILE__).'/1222222.txt',get_wx_pay_type()); // file_put_contents(dirname(__FILE__).'/1222222.txt',get_wx_pay_type());
// 绑币平台币优先处理 // 绑币平台币优先处理
$this->other_price($request, $discountAmount); $this->other_price($request, $discountAmount);
$pay_amount = $request['price'];
//0 官方 1威富通 2俊付通 //0 官方 1威富通 2俊付通
if (get_wx_pay_type() == 0) { if (get_wx_pay_type() == 0) {
@ -1333,13 +1334,16 @@ ADD COLUMN `pay_url` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL AFTER
$json_data['url']='http://'.$_SERVER ['HTTP_HOST']; $json_data['url']='http://'.$_SERVER ['HTTP_HOST'];
} }
} }
redirect(U('spend/paycallback', array(
echo json_encode(['code' => 200, 'url' => U('spend/paycallback', array(
'sdk_version' => $request['sdk_version'], 'sdk_version' => $request['sdk_version'],
'paytype' => 'weixinpay', 'paytype' => 'weixinpay',
'orderno' => $request['pay_order_number'], 'orderno' => $request['pay_order_number'],
'game_id' => $game_id, 'game_id' => $game_id,
'gopay' => 1 // 立即支付 'gopay' => 1 // 立即支付
))); ))]);
exit;
// redirect($json_data['url']); // redirect($json_data['url']);
} }

@ -251,7 +251,21 @@ $(function() {
flag = true; flag = true;
$r = small_program("{:C('sqpay.wx_small')}"); $r = small_program("{:C('sqpay.wx_small')}");
if ($r) { if ($r) {
window.location.href = $(this).data('url'); var url = $(this).data('url');
$.ajax({
type:'post',
dataType:'json',
data:{},
url:url,
success:function(result) {
if(result.code==200) {
window.location.href = result.url;
}
}
});
//window.location.href = $(this).data('url');
} }
}); });

Loading…
Cancel
Save