@ -160,6 +160,49 @@ class PayH5Controller extends BaseController{
//echo json_encode(['code'=>0,'msg'=>$ret[0]['respMess'],'wap'=>1]);
//exit;
}
} elseif(get_zfb_type($game_id, $user_id) == 4) { // 汇付宝
$request['pay_way'] = C('PAY_WAY.WFT_PAY');
$request['pay_status'] = 0;
$request['spend_ip'] = get_client_ip();
$this->add_deposit($request, 1);
$pay['agent_id'] = C('heepay.partner');//商户号
$pay['order_no'] = $request['pay_order_number'];
$pay['time'] = date('YmdHis', time());
$pay['pay_type'] = 22;
$pay['amount'] = $request['price'];
$pay['user_ip'] = get_client_ip();
$pay['sign_key'] = C('heepay.key');//密钥
$pay['payerName'] = iconv("UTF-8", "gb2312//IGNORE", "万盟天下");
$pay['number'] = 1;
$pay['goods_note']= "消费-".$request["pay_order_number"];
$pay['device'] = "wap";
$pay['bank_card_type'] = 0;
$pay['return_url'] = C('PAY_DOMAIN')."sdk.php/Spend/paycallback/orderno/{$request['pay_order_number']}/user_token/".$this->userToken."/paytype/weixinpay/game_id/{$game_id}";
$pay['notifyurl'] = C('PAY_DOMAIN')."/callback.php/Notify/heepay_callback";//通知
$heepay = new Heepay();
$json_data = $heepay->alih5_pay($pay);
// pp($json_data);
if($json_data['ret_code'] == "0000"){
$json_data['url'] = $json_data['url']/* . "?tx_client=hideopen" */;
// 存入pay_url 继续支付
M("deposit", "tab_")->where([
'extend' => $request['extend'],
'game_id' => $request['game_id'],
'pay_order_number' => $request["pay_order_number"]
])->save([
'pay_url' => $json_data['url']
]);
$orderno = $request['pay_order_number'];
} else {
echo json_encode(['code'=>1001,'msg'=> "请求发起失败【{$json_data['ret_msg']}】,请选择其他支付方式或联系客服"]);exit;
// redirect(U('Spend/notice',array('user_id'=>$user_id,'game_id'=>$game_id,'msg'=>$ret[0]['respMess'], 'user_token' => $this->userToken)));exit;
}
} else{ // 支付宝第三方
if( empty(C('goldpig.partner'))||empty(C('goldpig.wooolid'))){
// $this->set_message(1009, "fail", "支付参数未配置");
@ -423,6 +466,55 @@ class PayH5Controller extends BaseController{
echo json_encode(['code'=>0,'msg'=>$ret[0]['respMess'],'wap'=>1]);
exit;
}
} elseif(get_zfb_type($game_id, $user_id) == 4) { // 汇付宝
$request['pay_way'] = C('PAY_WAY.WFT_PAY');
$request['pay_status'] = 0;
$request['spend_ip'] = get_client_ip();
$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);
$pay['agent_id'] = C('heepay.partner');//商户号
$pay['order_no'] = $request['pay_order_number'];
$pay['time'] = date('YmdHis', time());
$pay['pay_type'] = 22;
$pay['amount'] = $request['price'];
$pay['user_ip'] = get_client_ip();
$pay['sign_key'] = C('heepay.key');//密钥
$pay['payerName'] = iconv("UTF-8", "gb2312//IGNORE", "万盟天下");
$pay['number'] = 1;
$pay['goods_note']= "消费-".$request["pay_order_number"];
$pay['device'] = "wap";
$pay['bank_card_type'] = 0;
$pay['return_url'] = C('PAY_DOMAIN')."sdk.php/Spend/paycallback/orderno/{$request['pay_order_number']}/user_token/".$this->userToken."/paytype/weixinpay/game_id/{$game_id}";
$pay['notifyurl'] = C('PAY_DOMAIN')."/callback.php/Notify/heepay_callback";//通知
$heepay = new Heepay();
$json_data = $heepay->alih5_pay($pay);
if($json_data['ret_code'] == "0000"){
$json_data['url'] = $json_data['url']/* . "?tx_client=hideopen" */;
// 存入pay_url 继续支付
M("spend", "tab_")->where([
'extend' => $request['extend'],
'game_id' => $request['game_id'],
'pay_order_number' => $request["pay_order_number"]
])->save([
'pay_url' => $json_data['url']
]);
$orderno = $request['pay_order_number'];
} else {
echo json_encode(['code'=>1001,'msg'=> "请求发起失败【{$json_data['ret_msg']}】,请选择其他支付方式或联系客服"]);exit;
// redirect(U('Spend/notice',array('user_id'=>$user_id,'game_id'=>$game_id,'msg'=>$ret[0]['respMess'], 'user_token' => $this->userToken)));exit;
}
} else{ // 支付宝第三方
if( empty(C('goldpig.partner'))||empty(C('goldpig.wooolid'))){
// $this->set_message(1009, "fail", "支付参数未配置");
@ -669,7 +761,7 @@ ADD COLUMN `pay_url` text NULL AFTER `check_sign`;
jsonOutput(0, "支付失败");
// redirect(U('Spend/notice',array('user_id'=>$user_id, 'is_platform' => 1,'game_id'=>$game_id,'msg'=>'支付失败', 'user_token' => $this->userToken)));exit;
}
}elseif(get_wx_pay_type() == 1){
}elseif(get_wx_pay_type() == 1){ // 汇付宝
$request['pay_way'] = C('PAY_WAY.WFT_PAY'); // 威富通wx
$pay['agent_id'] = C('heepay.partner');//商户号
@ -750,9 +842,9 @@ ADD COLUMN `pay_url` text NULL AFTER `check_sign`;
$pay['amount'] = $request['price'];
$pay['user_ip'] = get_client_ip();
$pay['sign_key'] = C('heepay.key');//密钥
$pay['payerName'] = "cs ";
$pay['payerName'] = "";
$pay['number'] = 1;
$pay['goods_note']="cs ";
$pay['goods_note']="游戏充值 ";
$pay['device'] = "wap";
$pay['bank_card_type'] = 0;
$pay['return_url'] ='http://' . $_SERVER ['HTTP_HOST'] . "/sdk.php/Spend/pay_success/orderno/".$pay['order_no'].'/game_id/'.$request['game_id'];
@ -1396,10 +1488,15 @@ ADD COLUMN `pay_url` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL AFTER
$pay['return_url'] = C('PAY_DOMAIN')."sdk.php/Spend/paycallback/orderno/{$request['pay_order_number']}/user_token/".$this->userToken."/paytype/weixinpay/game_id/{$game_id}";
$pay['notify_url'] = C('PAY_DOMAIN')."/callback.php/Notify/heepay_callback";
$heepay = new Heepay();
$url = $heepay->wxh5_pay($pay);
$request['pay_url'] = $url/* ."& tx_client=hideopen" */;
$json_data = $heepay->wxh5_pay($pay);
if($json_data['ret_code'] == "0000"){
$request['pay_url'] = $json_data['url'] . "&tx_client=hideopen";
$this->add_spend($request,1);
} else {
echo json_encode(['code'=>0,'msg'=> '支付失败,请重试'.$json_data['ret_msg']]);
exit;
}
$this->add_spend($request,1);
}elseif(get_wx_pay_type() == 2){
if($request['code']==1){