1,apple beta版 测试账号走第三方支付

2,支付订单号统一bug
3,横竖版切换显示
master
tpingzhang 5 years ago
parent 42f1ac9591
commit b6d7c20c32

@ -185,9 +185,15 @@ class ExchangeController extends BaseController{
$this->set_message(1089,"fail","订单号重复,请关闭支付页面重新支付");
}
// file_put_contents("./Application/Sdk/Scheme/".$request['game_id'].".txt",$request['scheme']);
// -----------apple beta版 测试账号走第三方支付
$testUser = ['test11', 'test12', 'test13', 'test142',
'test171','test830','test1003','test1002','test170','test169'];
$istest = false;
if (in_array($userPlayInfo['user_account'], $testUser)) {
$istest = true;
}
if(get_game_appstatus2($request['game_id'])/* &&$request['is_create_ordernumer']!=1 */){ /* 第三方支付 */
if(get_game_appstatus2($request['game_id'] || $istest)/* &&$request['is_create_ordernumer']!=1 */){ /* 第三方支付 */
$prefix = $request['code'] == 1 ? "SP_" : "PF_"; // SP
$out_trade_no = $prefix.date('Ymd').date('His').sp_random_string(4);
$request['pay_order_number'] = $out_trade_no;

@ -23,35 +23,31 @@ class PayH5Controller extends BaseController{
if (!$this->userId) {
$this->error("用户未登入");
}
$request['user_id'] = $this->userId;
$user_id = $this->userId;
$game_id = I('request.game_id');
// 支付验证 是否让支付
$payCheck = pay_check($this->userId);
if (!$payCheck['code']) {
redirect(U('Spend/notice',array('user_id'=>$user_id,'game_id'=>$game_id,'msg'=>$payCheck['msg'], 'user_token' => $this->userToken)));exit;
// echo json_encode(['code'=>0,'msg'=> $payCheck['msg']]);exit;
}
$pay_order_number = I('request.pay_order_number', 0);
if ($pay_order_number) {
$payOrder = M("deposit", "tab_")->where(['pay_order_number' => $pay_order_number])->find();
if ($payOrder['pay_status'] == 1) {
$this->success("充值成功", "/sdk.php/");
}
$pay_order_number = $payOrder['pay_amount'];
$request['pay_order_number'] = $pay_order_number;
$price = $payOrder['pay_amount'];
} else {
$price = I('request.price');
$request['price'] = $price;
$request['pay_order_number'] = 'PF_'.date('Ymd').date('His').sp_random_string(4);
$request['user_id'] = $user_id;
$request['price'] = I('request.price');
$pay_info = M('pay_info', 'tab_')->where([
'user_id' => $user_id,
'game_id' => $game_id,
'type' => 'platform_pay',
])->order('id desc')->find();
if ($pay_info['price'] != $request['price']) {
jsonOutput(0, "充值金额有误..");
}
$price = $request['price'];
$price = round($price, 2);
if($price <= 0){
redirect(U('Spend/notice',array('user_id'=>$user_id,'game_id'=>$game_id,'msg'=>'充值金额有误', 'user_token' => $this->userToken)));exit;
}
$request['pay_order_number'] = $pay_info['order_id'];
if(get_zfb_type()==0){ // 支付宝官方
if(C('alipay.way')==1/* || ($request['is_create_ordernumer']==1 && C('alipay.way')==0) */){ /* wap */
@ -522,6 +518,8 @@ class PayH5Controller extends BaseController{
$table = $param['code'] == 1 ? "spend" : "deposit";
$prefix = $param['code'] == 1 ? "SP_" : "PF_";
$out_trade_no = $prefix.date('Ymd').date('His').sp_random_string(4);
if ($param['pay_order_number']) $out_trade_no = $param['pay_order_number'];
$user = get_user_entity($param['user_id']);
switch ($param['apitype']) {
case 'swiftpass':
@ -601,12 +599,21 @@ ADD COLUMN `pay_url` text NULL AFTER `check_sign`;
//redirect(U('Spend/notice',array('user_id'=>$user_id, 'is_platform' => 1, 'msg'=>'充值金额有误', 'game_id' => $game_id, 'user_token' => $this->userToken)));exit;
}
$pay_info = M('pay_info', 'tab_')->where([
'user_id' => $user_id,
'game_id' => $game_id,
'type' => 'platform_pay',
])->order('id desc')->find();
if ($pay_info['price'] != $request['price']) {
jsonOutput(0, "充值金额有误..");
}
$pay_amount = $request['price'];
$prefix = "PF_";
$request['pay_way'] = C("PAY_WAY.WEIXIN");
$request['pay_status'] = 0;
$request['spend_ip'] = get_client_ip();
$request['pay_order_number'] = 'PF_'.date('Ymd').date('His').sp_random_string(4);
$request['pay_order_number'] = $pay_info['order_id']; //'PF_'.date('Ymd').date('His').sp_random_string(4);
$request['sdk_version'] = I('request.sdk_version');
//0 官方 1威富通 2俊付通

@ -213,14 +213,13 @@
</div>
<!---微信支付存在时有更多支付出现-->
<if condition="$pay_price elt C('WX_PAY_LIMIT')">
<if condition="C('wei_xin.status') eq 1 or C('weixin_gf.status') eq 1 or (C('goldpig.status') eq 1 and C('goldpig.wx') eq 1) or (C('heepay.status') eq 1 and C('heepay.wxp') eq 1) or (C('sqpay.status') eq 1 and C('sqpay.wx_small') eq 1)">
<if condition="C('wei_xin.status') eq 1 or C('weixin_gf.status') eq 1 or (C('goldpig.status') eq 1 and C('goldpig.wx') eq 1) or (C('heepay.status') eq 1) or (C('sqpay.status') eq 1 and C('sqpay.wx_small') eq 1)">
<div class="showotherpay weui-cells">
其他支付方式
</div>
</if>
</if>
</div>
<botton id="platform_pay" class="bottombutton">
确认支付

Loading…
Cancel
Save