Browse Source

fix:支付宝的

super-yimizi 2 weeks ago
parent
commit
956dc6e08c

+ 8 - 1
application/api/controller/Pay.php

@@ -201,7 +201,14 @@ class Pay extends Base
             Log::error('PayService创建失败: ' . $errorMessage);
             $this->error('支付服务初始化失败' . (config('app_debug') ? ":" . $errorMessage : ',请重试'));
         }
-        
+        if (in_array($platform, [ChannelEnum::CHANNEL_ANDROID_APP, ChannelEnum::CHANNEL_IOS_APP])) {
+            if (in_array($payment, ['wechat', 'alipay'])) {
+                // Yansongda\Supports\Collection,可当数组,可当字符串,这里不用处理
+            } else {
+                // Guzzle
+                $result = $result->getBody()->getContents();
+            }
+        }        
         $this->success('', [
             'pay_data' => $result,
         ]);

+ 2 - 2
application/common/Service/Pay/Provider/Alipay.php

@@ -229,8 +229,8 @@ class Alipay extends Base
         $config['alipay_root_cert_path'] = ROOT_PATH . 'public' . $config['alipay_root_cert_path'];
 
         // 兼容 epay
-        $config['app_cert_public_key'] = $config['app_public_cert_path'];
-        $config['alipay_root_cert'] = $config['alipay_root_cert_path'];
+        // $config['app_cert_public_key'] = $config['app_public_cert_path'];
+        // $config['alipay_root_cert'] = $config['alipay_root_cert_path'];
 
         return $config;
     }