elf 2 weeks ago
parent adff2b721a
commit a12e680c60

@ -1643,37 +1643,39 @@ class PayH5Controller extends BaseController{
$this->add_spend($request,1); $this->add_spend($request,1);
} else { } else {
echo json_encode(['code'=>0,'msg'=> '支付失败']); echo json_encode(['code'=>0,'msg'=> '支付失败']);
Log::write("weixin_pay支付失败".serialize($is_pay)); Log::write("weixin_pay支付失败".serialize($result));
exit; exit;
} }
} } else {
$weixn = new Weixin();
$weixn = new Weixin(); $is_pay = json_decode($weixn->weixin_pay(!empty($request['title']) ? $request['title']: "充值", $request['pay_order_number'], $pay_amount, 'MWEB', 1, $pay_conf), true);
$is_pay = json_decode($weixn->weixin_pay(!empty($request['title']) ? $request['title']: "充值", $request['pay_order_number'], $pay_amount, 'MWEB', 1, $pay_conf), true);
if($is_pay['status']==1){
if($request['code']==1){ if($is_pay['status']==1){
$redirectBaseUri = C('PAY_DOMAIN');
$json_data['url'] = $is_pay['mweb_url'].'&redirect_url='.urlencode($redirectBaseUri."sdk.php/Spend/paycallback/orderno/{$request['pay_order_number']}/game_id/{$request['game_id']}/paytype/weixinpay"); if($request['code']==1){
$request['pay_url'] = $json_data['url'] . "&tx_client=hideopen"; $redirectBaseUri = C('PAY_DOMAIN');
$request['merchant_id'] = $pay_info['id']; $json_data['url'] = $is_pay['mweb_url'].'&redirect_url='.urlencode($redirectBaseUri."sdk.php/Spend/paycallback/orderno/{$request['pay_order_number']}/game_id/{$request['game_id']}/paytype/weixinpay");
$request['merchant_way'] = self::WX_PAY; $request['pay_url'] = $json_data['url'] . "&tx_client=hideopen";
$request['main_id'] = $main_id; $request['merchant_id'] = $pay_info['id'];
if (C('SHARE_ID.'.$pay_conf['partner']) == 'y') { $request['merchant_way'] = self::WX_PAY;
$request['share_status'] = 1; $request['main_id'] = $main_id;
if (C('SHARE_ID.'.$pay_conf['partner']) == 'y') {
$request['share_status'] = 1;
}
$this->add_spend($request,1);
} }
$this->add_spend($request,1);
// $json_data['url'] = $is_pay['mweb_url'].'&redirect_url='.C('PAY_DOMAIN')."sdk.php/Spend/paycallback/orderno/{$request['pay_order_number']}/game_id/{$request['game_id']}";
// (is_ssl()?'https%3A%2F%2F':'http%3A%2F%2F'). $_SERVER ['HTTP_HOST'] . "%2Fsdk.php%2FSpend%2Fpay_success%2Forderno%2F".$request['pay_order_number'].'%2Fgame_id%2F'.$request['game_id'] ;
}else{
echo json_encode(['code'=>0,'msg'=> '支付失败']);
Log::write("platform_weixin_pay支付失败".serialize($is_pay));
exit;
// redirect(U('Spend/notice',array('user_id'=>$user_id,'game_id'=>$game_id,'msg'=>'支付失败', 'user_token' => $this->userToken)));exit;
} }
// $json_data['url'] = $is_pay['mweb_url'].'&redirect_url='.C('PAY_DOMAIN')."sdk.php/Spend/paycallback/orderno/{$request['pay_order_number']}/game_id/{$request['game_id']}";
// (is_ssl()?'https%3A%2F%2F':'http%3A%2F%2F'). $_SERVER ['HTTP_HOST'] . "%2Fsdk.php%2FSpend%2Fpay_success%2Forderno%2F".$request['pay_order_number'].'%2Fgame_id%2F'.$request['game_id'] ;
}else{
echo json_encode(['code'=>0,'msg'=> '支付失败']);
Log::write("platform_weixin_pay支付失败".serialize($is_pay));
exit;
// redirect(U('Spend/notice',array('user_id'=>$user_id,'game_id'=>$game_id,'msg'=>'支付失败', 'user_token' => $this->userToken)));exit;
} }
}elseif ($pay_info['channel'] == 5) { }elseif ($pay_info['channel'] == 5) {
$request['pay_way'] = self::WX_PAY; $request['pay_way'] = self::WX_PAY;

Loading…
Cancel
Save