|
|
|
@ -11,6 +11,9 @@ use Org\HeepaySDK\Heepay;
|
|
|
|
|
use Qiniu\json_decode;
|
|
|
|
|
use Think\Log;
|
|
|
|
|
use Sdk\Model\ValueDetailLogModel;
|
|
|
|
|
use Sdk\Model\PayLimitConfModel;
|
|
|
|
|
use Sdk\Model\PayChannelInterntionModel;
|
|
|
|
|
use Sdk\Model\PayChannelIntentionModel;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class PayH5Controller extends BaseController{
|
|
|
|
@ -52,6 +55,16 @@ class PayH5Controller extends BaseController{
|
|
|
|
|
}
|
|
|
|
|
$request['pay_order_number'] = $pay_info['order_id'];
|
|
|
|
|
|
|
|
|
|
$payLimitConf = new PayLimitConfModel();
|
|
|
|
|
// 先判断意向记录支付请求情况
|
|
|
|
|
$check = $payLimitConf->check($request['user_id'], $request['price'], $payLimitConf::PAY_TYPE_ALIPAY, $request['pay_order_number']);
|
|
|
|
|
// 在更新历史支付请求订单提交情况
|
|
|
|
|
$payChannelInterntion = new PayChannelIntentionModel();
|
|
|
|
|
$payChannelInterntion->paySubmit($request['pay_order_number']);
|
|
|
|
|
if ($check) {
|
|
|
|
|
echo json_encode(['code'=>1001,'msg'=> "请求发起失效,编号{$request['pay_order_number']},请选择其他支付方式或联系客服"]);exit;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(get_zfb_type($game_id, $user_id)==0){ // 支付宝官方
|
|
|
|
|
if(C('alipay.way')==1/* || ($request['is_create_ordernumer']==1 && C('alipay.way')==0) */){ /* wap */
|
|
|
|
|
|
|
|
|
@ -302,6 +315,16 @@ class PayH5Controller extends BaseController{
|
|
|
|
|
echo json_encode(['code'=>0,'msg'=>'订单号重复,请关闭支付页面重新支付']);exit;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$payLimitConf = new PayLimitConfModel();
|
|
|
|
|
// 先判断意向记录支付请求情况
|
|
|
|
|
$check = $payLimitConf->check($request['user_id'], $request['price'], $payLimitConf::PAY_TYPE_ALIPAY, $request['pay_order_number']);
|
|
|
|
|
// 在更新历史支付请求订单提交情况
|
|
|
|
|
$payChannelInterntion = new PayChannelIntentionModel();
|
|
|
|
|
$payChannelInterntion->paySubmit($request['pay_order_number']);
|
|
|
|
|
if ($check) {
|
|
|
|
|
echo json_encode(['code'=>1001,'msg'=> "请求发起失效,编号{$request['pay_order_number']},请选择其他支付方式或联系客服"]);exit;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$this->other_price($request);
|
|
|
|
|
|
|
|
|
|
if(get_zfb_type($game_id, $user_id)==0){ // 支付宝官方
|
|
|
|
@ -618,6 +641,16 @@ ADD COLUMN `pay_url` text NULL AFTER `check_sign`;
|
|
|
|
|
$request['pay_order_number'] = $pay_info['order_id']; //'PF_'.date('Ymd').date('His').sp_random_string(4);
|
|
|
|
|
$request['sdk_version'] = I('request.sdk_version');
|
|
|
|
|
|
|
|
|
|
$payLimitConf = new PayLimitConfModel();
|
|
|
|
|
// 先判断意向记录支付请求情况
|
|
|
|
|
$check = $payLimitConf->check($request['user_id'], $request['price'], $payLimitConf::PAY_TYPE_WXPAY, $request['pay_order_number']);
|
|
|
|
|
// 在更新历史支付请求订单提交情况
|
|
|
|
|
$payChannelInterntion = new PayChannelIntentionModel();
|
|
|
|
|
$payChannelInterntion->paySubmit($request['pay_order_number']);
|
|
|
|
|
if ($check) {
|
|
|
|
|
echo json_encode(['code'=>1001,'msg'=> "请求发起失效,编号{$request['pay_order_number']},请选择其他支付方式或联系客服"]);exit;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//0 官方 1威富通 2俊付通
|
|
|
|
|
if (get_wx_pay_type() == 0) {
|
|
|
|
|
$weixn = new Weixin();
|
|
|
|
@ -1294,7 +1327,7 @@ ADD COLUMN `pay_url` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL AFTER
|
|
|
|
|
}
|
|
|
|
|
$extend_data = M('spend','tab_')->where(array('extend'=>$request['extend'],'game_id'=>$request['game_id']/* ,'pay_status'=>1 */))->find();
|
|
|
|
|
if($extend_data){
|
|
|
|
|
echo json_encode(['code'=>0,'msg'=> '订单号重复,请关闭支付页面重新支付']);exit;
|
|
|
|
|
echo json_encode(['code'=>0,'msg'=> '订单号重复,请关闭支付页面重新支付.']);exit;
|
|
|
|
|
//$this->set_message(1089,"fail","订单号重复,请关闭支付页面重新支付");
|
|
|
|
|
//redirect(U('Spend/notice',array('user_id'=>$user_id,'game_id'=>$game_id,'msg'=>'订单号重复,请关闭支付页面重新支付', 'user_token' => $this->userToken)));exit;
|
|
|
|
|
}
|
|
|
|
@ -1302,6 +1335,17 @@ ADD COLUMN `pay_url` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL AFTER
|
|
|
|
|
if (pay_limit('wx')) {
|
|
|
|
|
echo json_encode(['code'=>0,'msg'=> '支付限额,暂不支持']);exit;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$payLimitConf = new PayLimitConfModel();
|
|
|
|
|
// 先判断意向记录支付请求情况
|
|
|
|
|
$check = $payLimitConf->check($request['user_id'], $request['price'], $payLimitConf::PAY_TYPE_WXPAY, $request['pay_order_number']);
|
|
|
|
|
// 在更新历史支付请求订单提交情况
|
|
|
|
|
$payChannelInterntion = new PayChannelIntentionModel();
|
|
|
|
|
$payChannelInterntion->paySubmit($request['pay_order_number']);
|
|
|
|
|
if ($check) {
|
|
|
|
|
echo json_encode(['code'=>1001,'msg'=> "请求发起失效,编号{$request['order_id']},请选择其他支付方式或联系客服"]);exit;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$table = $request['code'] == 1 ? "spend" : "deposit";
|
|
|
|
|
$prefix = $request['code'] == 1 ? "SP_" : "PF_";
|
|
|
|
|
//折扣
|
|
|
|
|