From 1f8dc1b6eaf705fb486a73e251b9daeaa442de8a Mon Sep 17 00:00:00 2001 From: tpingzhang <635929049@qq.com> Date: Mon, 4 Nov 2019 15:32:41 +0800 Subject: [PATCH 1/2] gopay --- .../Sdk/Controller/PayH5Controller.class.php | 7 +- .../Sdk/Controller/SpendController.class.php | 7 +- .../Sdk/View/default/Spend/paycallback.html | 64 +++++++++++++++++-- 3 files changed, 69 insertions(+), 9 deletions(-) diff --git a/Application/Sdk/Controller/PayH5Controller.class.php b/Application/Sdk/Controller/PayH5Controller.class.php index 4fa18b6b..80b70899 100644 --- a/Application/Sdk/Controller/PayH5Controller.class.php +++ b/Application/Sdk/Controller/PayH5Controller.class.php @@ -1290,7 +1290,12 @@ ADD COLUMN `pay_url` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL AFTER $json_data['url']='http://'.$_SERVER ['HTTP_HOST']; } } - redirect($json_data['url']); + redirect(U('spend/paycallback', array( + 'orderno' => $request['pay_order_number'], + 'game_id' => $game_id, + 'gopay' => 1 // 立即支付 + ))); +// redirect($json_data['url']); } diff --git a/Application/Sdk/Controller/SpendController.class.php b/Application/Sdk/Controller/SpendController.class.php index 09f22109..5976b7f4 100644 --- a/Application/Sdk/Controller/SpendController.class.php +++ b/Application/Sdk/Controller/SpendController.class.php @@ -248,7 +248,9 @@ ADD COLUMN `pay_url` varchar(255) NOT NULL DEFAULT '' AFTER `check_sign`; $pay_where = substr($orderno, 0, 2); $Scheme = file_get_contents("./Application/Sdk/Scheme/" . $_GET ['game_id'] . ".txt"); $map ['pay_order_number'] = $orderno; - $type = I('request.type', 0); // 1 直接唤起支付 + $paytype = I('request.paytype', 0); // 支付方式 weixin alipay + $gopay = I('request.gopay'); + switch ($pay_where) { case 'SP' : $result = M('Spend', 'tab_')->field ("*")->where ($map)->find(); @@ -287,10 +289,11 @@ ADD COLUMN `pay_url` varchar(255) NOT NULL DEFAULT '' AFTER `check_sign`; // pp($gopayUrl); $this->assign("orderno", $orderno); - $this->assign("type", $type); + $this->assign("paytype", $paytype); $this->assign ('pay_url', $result['pay_url']); $this->assign("device", $result['sdk_version']?:0); $this->assign ('Scheme', $Scheme); + $this->assign ('gopay', $gopay); $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 df5709bd..77d5f5d0 100644 --- a/Application/Sdk/View/default/Spend/paycallback.html +++ b/Application/Sdk/View/default/Spend/paycallback.html @@ -14,6 +14,9 @@ + + +