Browse Source

微信扫码支付

lizhen_gitee 3 năm trước cách đây
mục cha
commit
f4a2403ff6

+ 6 - 4
addons/epay/library/Service.php

@@ -68,9 +68,10 @@ class Service
             if ($method == 'web') {
                 //如果是微信环境或后台配置PC使用扫码支付
                 if ($isWechat || $config['scanpay']) {
-                    Session::set("alipayorderdata", $params);
+                    /*Session::set("alipayorderdata", $params);
                     $url = addon_url('epay/api/alipay', [], true, true);
-                    return RedirectResponse::create($url);
+                    return RedirectResponse::create($url);*/
+                    abort(500,'不能在微信浏览器打开');
                 } elseif ($request->isMobile()) {
                     $method = 'wap';
                 }
@@ -114,9 +115,10 @@ class Service
                 if ($request->isMobile() && !$isWechat) {
                     $method = 'wap';
                 } else {
-                    Session::set("wechatorderdata", $params);
+                    /*Session::set("wechatorderdata", $params);
                     $url = addon_url('epay/api/wechat', [], true, true);
-                    return RedirectResponse::create($url);
+                    return RedirectResponse::create($url);*/
+                    abort(500,'不能在微信浏览器打开');
                 }
             }
 

+ 2 - 2
application/index/controller/Recharge.php

@@ -87,9 +87,9 @@ class Recharge extends Frontend
             'returnurl' => $this->request->root(true) . '/index/recharge',
         ];
         $res = Service::submitOrder($params);
-
         if($pay_type == 'wechat'){
-            exit;
+            $code_url = $res['cod_url'];
+            $code_img = \EasyWeChat\OfficialAccount\Card\createQrCode();
         }else{
             return $res;
         }