From ba3396058e23b48f3e9179ba0eace97affc102eb Mon Sep 17 00:00:00 2001
From: tpingzhang <635929049@qq.com>
Date: Wed, 6 Nov 2019 14:34:47 +0800
Subject: [PATCH 01/10] =?UTF-8?q?=E5=B9=B3=E5=8F=B0=E5=B8=81=E5=85=85?=
=?UTF-8?q?=E5=80=BC?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Sdk/Controller/PayH5Controller.class.php | 29 +++++++++++++++++--
.../Sdk/Controller/WapPayController.class.php | 2 +-
2 files changed, 27 insertions(+), 4 deletions(-)
diff --git a/Application/Sdk/Controller/PayH5Controller.class.php b/Application/Sdk/Controller/PayH5Controller.class.php
index d90f2cf9..16917ef2 100644
--- a/Application/Sdk/Controller/PayH5Controller.class.php
+++ b/Application/Sdk/Controller/PayH5Controller.class.php
@@ -67,9 +67,11 @@ class PayH5Controller extends BaseController{
//$request['callback'] = 'http://'.$_SERVER['HTTP_HOST']. "/sdk.php/Spend/pay_success/orderno/".$request['pay_order_number'].'/game_id/'.$request['game_id'];
//$request['notifyurl'] = 'http://'.$_SERVER['HTTP_HOST']. "/callback.php/Notify/notify/apitype/alipay/method/notify";
$pay_url=$this->pay($request);
+ $request['pay_url'] = $pay_url['url'];
+ $orderno = $pay_url['out_trade_no'];
//echo $pay_url['url'];die;
// redirect($pay_url['url']);
- echo json_encode(['code'=>200,'msg'=>'','data'=>['url'=>$pay_url['url'],'wap'=>1]]);exit;
+// echo json_encode(['code'=>200,'msg'=>'','data'=>['url'=>$pay_url['url'],'wap'=>1]]);exit;
} else {/* app */
$game_set_data = get_game_set_info(I('request.game_id'));
$request['apitype'] = "alipay";
@@ -83,10 +85,21 @@ class PayH5Controller extends BaseController{
$md5_sign = $this->encrypt_md5(base64_encode($data['arg']), $game_set_data["access_key"]);
$data = array("orderInfo" => base64_encode($data['arg']), "out_trade_no" => $data['out_trade_no'], "order_sign" => $data['sign'], "md5_sign" => $md5_sign, "code" => 0);
+ $request['pay_url'] = json_encode($data);
+ $orderno = $data['out_trade_no'];
- echo json_encode(['code'=>200,'msg'=>'','data'=>['url'=>json_encode($data),'wap'=>0]]);exit;
+ //echo json_encode(['code'=>200,'msg'=>'','data'=>['url'=>json_encode($data),'wap'=>0]]);exit;
}
+ // 存入pay_url 继续支付
+ M("deposit", "tab_")->where([
+ 'extend' => $request['extend'],
+ 'game_id' => $request['game_id'],
+ 'pay_order_number' => $orderno
+ ])->save([
+ 'pay_url' => $request['pay_url']
+ ]);
+
}elseif(get_zfb_type() == 2) { // 双乾
$request['pay_way'] = C('PAY_WAY.SQ_ALIPAY');
@@ -115,7 +128,17 @@ class PayH5Controller extends BaseController{
$ret = json_decode($ret, true);
$json_data['url']=$ret[0]['payURL'];
if($ret[0]['respCode'] == '000000'){
- redirect($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']
+ ]);
+
+ //redirect($json_data['url']);
//echo json_encode(['code'=>200,'msg'=>'','data'=>['url'=>$json_data['url'],'wap'=>1]]);
//exit;
} else {
diff --git a/Application/Sdk/Controller/WapPayController.class.php b/Application/Sdk/Controller/WapPayController.class.php
index 3486f6ca..751f834e 100644
--- a/Application/Sdk/Controller/WapPayController.class.php
+++ b/Application/Sdk/Controller/WapPayController.class.php
@@ -269,8 +269,8 @@ class WapPayController extends BaseController{
'secret' => C('sqpay.key'),
));
//echo "发起支付==》".time()."
";
-// sleep(5);
if ($rsp['responseCode'] == '88') {
+ sleep(5);
redirect(U('Spend/pay_success',array('orderno' => $payInfo['order_id'], 'user_id'=>$param['user_id'],'game_id'=>$param['game_id'])));exit;
} else {
// 支付失败
From a472a1183e95139bedbdcf422e7c700dc1a9c678 Mon Sep 17 00:00:00 2001
From: tpingzhang <635929049@qq.com>
Date: Wed, 6 Nov 2019 14:38:36 +0800
Subject: [PATCH 02/10] =?UTF-8?q?=E5=B9=B3=E5=8F=B0=E5=B8=81=E5=85=85?=
=?UTF-8?q?=E5=80=BC?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Application/Sdk/Controller/PayH5Controller.class.php | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/Application/Sdk/Controller/PayH5Controller.class.php b/Application/Sdk/Controller/PayH5Controller.class.php
index 16917ef2..e6657579 100644
--- a/Application/Sdk/Controller/PayH5Controller.class.php
+++ b/Application/Sdk/Controller/PayH5Controller.class.php
@@ -24,6 +24,7 @@ class PayH5Controller extends BaseController{
$this->error("用户未登入");
}
$request['user_id'] = $this->userId;
+ $game_id = I('request.game_id');
// 支付验证 是否让支付
$payCheck = pay_check($this->userId);
@@ -187,6 +188,14 @@ class PayH5Controller extends BaseController{
}
}
+ echo json_encode(['code' => 200, 'url' => U('spend/paycallback', array(
+ 'sdk_version' => $request['sdk_version'],
+ 'paytype' => 'alipay',
+ 'orderno' => $orderno,
+ 'game_id' => $game_id,
+ 'gopay' => 1 // 立即支付
+ ))]);
+ exit;
}
/**
*ios移动支付
From d4696b20b7caea0905a865eced9e8b0f5759a4c5 Mon Sep 17 00:00:00 2001
From: tpingzhang <635929049@qq.com>
Date: Wed, 6 Nov 2019 14:42:50 +0800
Subject: [PATCH 03/10] =?UTF-8?q?=E5=B9=B3=E5=8F=B0=E5=B8=81=E5=85=85?=
=?UTF-8?q?=E5=80=BC?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Application/Sdk/Controller/PayH5Controller.class.php | 1 +
1 file changed, 1 insertion(+)
diff --git a/Application/Sdk/Controller/PayH5Controller.class.php b/Application/Sdk/Controller/PayH5Controller.class.php
index e6657579..fc3d104a 100644
--- a/Application/Sdk/Controller/PayH5Controller.class.php
+++ b/Application/Sdk/Controller/PayH5Controller.class.php
@@ -138,6 +138,7 @@ class PayH5Controller extends BaseController{
])->save([
'pay_url' => $json_data['url']
]);
+ $orderno = $request['pay_order_number'];
//redirect($json_data['url']);
//echo json_encode(['code'=>200,'msg'=>'','data'=>['url'=>$json_data['url'],'wap'=>1]]);
From defa8114caf641444ab0a83ac9032624388680db Mon Sep 17 00:00:00 2001
From: tpingzhang <635929049@qq.com>
Date: Wed, 6 Nov 2019 14:51:07 +0800
Subject: [PATCH 04/10] =?UTF-8?q?=E5=B9=B3=E5=8F=B0=E5=B8=81=E5=85=85?=
=?UTF-8?q?=E5=80=BC?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Application/Sdk/View/default/UserH/platform_pay.html | 2 ++
1 file changed, 2 insertions(+)
diff --git a/Application/Sdk/View/default/UserH/platform_pay.html b/Application/Sdk/View/default/UserH/platform_pay.html
index 7497368a..55907ecf 100644
--- a/Application/Sdk/View/default/UserH/platform_pay.html
+++ b/Application/Sdk/View/default/UserH/platform_pay.html
@@ -81,6 +81,8 @@ $(function(){
url:url,
success:function(result) {
if(result.code==200) {
+ window.location.href = result.url;
+ return ;
var data = result.data;
if(data.wap==1) {
/* if () {
From 136d11a0a2128094462b01505818a052a7cf198d Mon Sep 17 00:00:00 2001
From: tpingzhang <635929049@qq.com>
Date: Wed, 6 Nov 2019 14:54:29 +0800
Subject: [PATCH 05/10] =?UTF-8?q?order=5Fstatus=20=E8=AE=A2=E5=8D=95?=
=?UTF-8?q?=E6=9F=A5=E8=AF=A2=20=E4=B8=8D=E5=81=9A=E9=AA=8C=E8=AF=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Application/Sdk/Controller/BaseController.class.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Application/Sdk/Controller/BaseController.class.php b/Application/Sdk/Controller/BaseController.class.php
index 8af0c5c2..0e32ac64 100644
--- a/Application/Sdk/Controller/BaseController.class.php
+++ b/Application/Sdk/Controller/BaseController.class.php
@@ -19,7 +19,7 @@ class BaseController extends RestController{
protected $noNeedToken = [
'Changyan', 'Exchange', 'FengHuoApi', 'File', 'Game', 'GameGift', 'GameNotify', 'Info', 'ios-wap-Pay',
'Jpush', 'LoginNotify', 'Notice', 'OA', 'OTP', 'OTPServer', 'Pay', 'Payios', 'PointShop', 'Spend',
- 'User', 'WapPay', 'Wechat', 'XinJiApi', 'Notice', 'init_sdk',
+ 'User', 'WapPay', 'Wechat', 'XinJiApi', 'Notice', 'init_sdk', 'order_status',
// 'test',
];
protected $userId;
From 3e8dd133789ac416b27e6f44bf1485d0835fd990 Mon Sep 17 00:00:00 2001
From: tpingzhang <635929049@qq.com>
Date: Wed, 6 Nov 2019 14:56:09 +0800
Subject: [PATCH 06/10] =?UTF-8?q?order=5Fstatus=20=E8=AE=A2=E5=8D=95?=
=?UTF-8?q?=E6=9F=A5=E8=AF=A2=20=E4=B8=8D=E5=81=9A=E9=AA=8C=E8=AF=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Application/Sdk/Controller/BaseController.class.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Application/Sdk/Controller/BaseController.class.php b/Application/Sdk/Controller/BaseController.class.php
index 0e32ac64..dc64b3c5 100644
--- a/Application/Sdk/Controller/BaseController.class.php
+++ b/Application/Sdk/Controller/BaseController.class.php
@@ -11,7 +11,7 @@ class BaseController extends RestController{
'Apple.apple_platform_pay','Spend.notice','Apple.apple_union_pay','WapPay.wap_shortcut_pay',
'WapPay.shortcut_pay','WapPay.android_shortcut_pay','WapPay.wap_shortcut_pay','WapPay.wap_shortcut_pay',
'Apple.apple_weixin_pay','Ipa365','User.user_login','platform_coin_deduction','get_user_money',
- 'file_pay','pay','GameGiftPage','UserH', 'PayH5','init_sdk',
+ 'file_pay','pay','GameGiftPage','UserH', 'PayH5','init_sdk','order_status'
// 'test','Game.get_suspend',
];
From f3a9e70330e21563ef80e150a279831a49e84e73 Mon Sep 17 00:00:00 2001
From: tpingzhang <635929049@qq.com>
Date: Wed, 6 Nov 2019 15:04:43 +0800
Subject: [PATCH 07/10] =?UTF-8?q?=E5=B9=B3=E5=8F=B0=E5=B8=81=E5=85=85?=
=?UTF-8?q?=E5=80=BC?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Application/Sdk/Controller/SpendController.class.php | 1 +
Application/Sdk/View/default/Spend/paycallback.html | 4 +++-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/Application/Sdk/Controller/SpendController.class.php b/Application/Sdk/Controller/SpendController.class.php
index d769c327..65da041c 100644
--- a/Application/Sdk/Controller/SpendController.class.php
+++ b/Application/Sdk/Controller/SpendController.class.php
@@ -306,6 +306,7 @@ ADD COLUMN `pay_url` varchar(255) NOT NULL DEFAULT '' AFTER `check_sign`;
$this->assign("sdk_version", $result['sdk_version']?:0);
$this->assign ('Scheme', $Scheme);
$this->assign ('gopay', $gopay);
+ $this->assign ('user_token', $userToken);
$this->assign ('gopay_url', $gopayUrl);
$this->assign ('paystatus', $result ['pay_status']);
diff --git a/Application/Sdk/View/default/Spend/paycallback.html b/Application/Sdk/View/default/Spend/paycallback.html
index 38061e67..3ac1654b 100644
--- a/Application/Sdk/View/default/Spend/paycallback.html
+++ b/Application/Sdk/View/default/Spend/paycallback.html
@@ -18,6 +18,7 @@
+