master
elf 2 years ago
parent 8164119a7b
commit 4c82631c41

@ -200,6 +200,33 @@ class PayH5Controller extends BaseController{
// redirect(U('Spend/notice',array('user_id'=>$user_id,'game_id'=>$game_id,'msg'=>$ret[0]['respMess'], 'user_token' => $this->userToken)));exit;
}
} elseif ($pay_info['channel'] == 6) { // 酷点
$request['pay_way'] = 11;
$request['pay_status'] = 0;
$request['spend_ip'] = get_client_ip();
$this->add_deposit($request, 1);
$notifyUrl = C('PAY_DOMAIN')."/callback.php/Notify/kd_callback";
$backUrl = C('PAY_DOMAIN')."sdk.php/Spend/paycallback/orderno/{$request['pay_order_number']}/user_token/".$this->userToken."/paytype/weixinpay/game_id/{$game_id}";
$body = '消费-' . $request["pay_order_number"];
$response = KDApi::h5Pay($request['pay_order_number'], $request['price']*100, $notifyUrl, $backUrl, 'ALIPAY', $body, get_client_ip());
if($response->isSuccess()) {
// 存入pay_url 继续支付
M("deposit", "tab_")->where([
'extend' => $request['extend'],
'game_id' => $request['game_id'],
'pay_order_number' => $request["pay_order_number"]
])->save([
'pay_url' => $response->getResult('url')
]);
$orderno = $request['pay_order_number'];
} else {
echo json_encode(['code'=>1001,'msg'=> "请求发起失败【{$response->getMsg()}】,请选择其他支付方式或联系客服"]);exit;
}
} else{ // 支付宝第三方
if( empty(C('goldpig.partner'))||empty(C('goldpig.wooolid'))){
// $this->set_message(1009, "fail", "支付参数未配置");
@ -857,19 +884,6 @@ class PayH5Controller extends BaseController{
}
} elseif($pay_info['channel'] == 6) { // 酷点
$request['pay_way'] = 21;
$request['pay_status'] = 0;
$request['spend_ip'] = get_client_ip();
$request['merchant_id'] = $pay_info['id'];
$request['merchant_way'] = 2;
$request['main_id'] = $main_id;
$ordercheck = M("spend","tab_")->where(array('pay_order_number'=>$request["pay_order_number"]))->find();
if ($ordercheck) {
$returl = U('Spend/notice',array('user_id'=>$ordercheck['user_id'],'game_id'=>$ordercheck['game_id'],'msg'=>'订单已经存在,请刷新充值页面重新下单!'));
echo json_encode(['code'=>0,'msg'=>'订单已经存在,请刷新充值页面重新下单!','wap'=>1]);
exit;
}
$this->add_spend($request,1);
$notifyUrl = C('PAY_DOMAIN')."/callback.php/Notify/kd_callback";
$backUrl = C('PAY_DOMAIN')."sdk.php/Spend/paycallback/orderno/{$request['pay_order_number']}/user_token/".$this->userToken."/paytype/weixinpay/game_id/{$game_id}";
@ -877,22 +891,15 @@ class PayH5Controller extends BaseController{
$response = KDApi::h5Pay($request['pay_order_number'], $request['price']*100, $notifyUrl, $backUrl, 'WXPAY', $body, get_client_ip());
if($response->isSuccess()){
// 存入pay_url 继续支付
M("spend", "tab_")->where([
'extend' => $request['extend'],
'game_id' => $request['game_id'],
'pay_order_number' => $request["pay_order_number"]
])->save([
'pay_url' => $response->getResult('url')
]);
$orderno = $request['pay_order_number'];
$request['pay_url'] = $response->getResult('url');
$request['merchant_id'] = $pay_info['id'];
$request['merchant_way'] = self::WX_PAY;
$request['main_id'] = $main_id;
$this->add_deposit($request, 1);
} else {
echo json_encode(['code'=>1001,'msg'=> "请求发起失败【{$response->getMsg()}】,请选择其他支付方式或联系客服"]);exit;
// redirect(U('Spend/notice',array('user_id'=>$user_id,'game_id'=>$game_id,'msg'=>$ret[0]['respMess'], 'user_token' => $this->userToken)));exit;
jsonOutput(0, "支付失败");
exit;
}
} elseif(get_wx_pay_type() == 2){
if($request['code']==1){

Loading…
Cancel
Save