Browse Source

fix:测试

super-yimizi 1 month ago
parent
commit
c1db9cc66f

+ 3 - 2
application/api/controller/Pay.php

@@ -142,12 +142,13 @@ class Pay extends Base
         ];
         // 微信公众号,小程序支付,必须有 openid
         if ($payment == 'wechat') {
-
-
             // 如果传了 code
             if (!empty($logincode)) {
                 $json = (new \app\common\library\Wechat\Service())->getWechatSession($logincode);
                 $openid = $json['openid'] ?? '';
+                if(empty($openid)){
+                    $this->error('未获取到openidid');
+                }
                 $order_data['payer']['openid'] = $openid;
             }else{
                 if (in_array($platform, ['WechatOfficialAccount', 'WechatMiniProgram'])) {

+ 4 - 2
application/common/Service/Pay/Provider/Base.php

@@ -177,13 +177,15 @@ class Base
                 'WechatOfficialAccount' => 'mp',        //公众号支付 Collection
                 'WechatMiniProgram' => 'mini',       //小程序支付 Collection 
                 'H5' => 'wap',                      //手机网站支付 Response
-                'App' => 'app'                      // APP 支付 JsonResponse
+                'IOSApp' => 'app',                      // APP 支付 JsonResponse
+                'AndroidApp' => 'app',                      // APP 支付 JsonResponse
             ],
             'alipay' => [
                 'WechatOfficialAccount' => 'wap',       //手机网站支付 Response
                 'WechatMiniProgram' => 'wap',           //小程序支付
                 'H5' => 'wap',                      //手机网站支付 Response
-                'App' => 'app'                      //APP 支付 JsonResponse
+                'IOSApp' => 'app',                      // APP 支付 JsonResponse
+                'AndroidApp' => 'app',                      // APP 支付 JsonResponse
             ],
             'douyin' => [
                 'DouyinMiniProgram' => 'mini',       //小程序支付 Collection