Merge branch 'dev' of 47.111.118.107:/srv/git/sdk into dev

master
chenzhi 5 years ago
commit 0af4f5e4f3

@ -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());
// 绑币平台币优先处理
$this->other_price($request, $discountAmount);
$pay_amount = $request['price'];
//0 官方 1威富通 2俊付通
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'];
}
}
redirect(U('spend/paycallback', array(
echo json_encode(['code' => 200, 'url' => U('spend/paycallback', array(
'sdk_version' => $request['sdk_version'],
'paytype' => 'weixinpay',
'orderno' => $request['pay_order_number'],
'game_id' => $game_id,
'gopay' => 1 // 立即支付
)));
))]);
exit;
// redirect($json_data['url']);
}

@ -61,7 +61,6 @@ class SpendController extends Controller {
$file = file_get_contents ( "./Application/Sdk/OrderNo/" . $user_id . "-" . $game_id . ".txt" );
$request = json_decode ( think_decrypt ( $file ), true );
$data = array(
'coin' => $request ['body'],
'price' => $request ['price'],
@ -76,14 +75,15 @@ class SpendController extends Controller {
'game_id' => $game_id
) )->getField ( 'bind_balance' );
// $data['price'] = 1;
$this->assign ( 'balance', $balance );
$this->assign ( 'bind_balance', $bind_balance );
$this->assign ( 'data', $data );
$this->assign ( 'btncolor', $request ['btncolor'] );
if ($balance + $bind_balance > $data['price']) {
$apply_money = $data['price'];
$this->assign ('pay_price', 0); // 是否第三方支付
} else {
$apply_money = $balance + $bind_balance;
$payPrice = $data['price'] - $balance - $bind_balance;
$this->assign ('pay_price', $payPrice ? $payPrice : 0);
}
@ -98,6 +98,7 @@ class SpendController extends Controller {
unset($data['pay_way']);
/* if ($request['sdk_version'] == 1) // android 没有 is_create_ordernumer苹果内购
unset($data['is_create_ordernumer']); */
$this->assign('apply_money',$apply_money); //适用平台金额
$this->assign('sdk_version', $request['sdk_version']);
$this->assign('small_json', json_encode(array(
'appId' => 'wx8419130aa4ff123b',

@ -227,7 +227,8 @@ class WapPayController extends BaseController{
*/
public function shortcut_pay() {
$sqpay = new Sqpay();
$param = I();
$param = I("request.");
$signContract = false; // 签约标记
if (!$param['user_id'] || !$param['game_id']) {
@ -268,7 +269,7 @@ class WapPayController extends BaseController{
'secret' => C('sqpay.key'),
));
//echo "发起支付==》".time()."<br>";
sleep(5);
// sleep(5);
if ($rsp['responseCode'] == '88') {
redirect(U('Spend/pay_success',array('orderno' => $payInfo['order_id'], 'user_id'=>$param['user_id'],'game_id'=>$param['game_id'])));exit;
} else {

@ -154,7 +154,7 @@
<div class="weui-cell__bd">
<p>适用平台余额:</p>
</div>
<div class="weui-cell__ft" style="color: #292929">-¥{$balance+$bind_balance}</div>
<div class="weui-cell__ft" style="color: #292929">-¥{$apply_money}</div>
</div>
<div class="weui-cell">
<div class="weui-cell__bd">
@ -251,7 +251,21 @@ $(function() {
flag = true;
$r = small_program("{:C('sqpay.wx_small')}");
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