Browse Source

付款码轮询

gorden 6 months ago
parent
commit
ab4235ee17
1 changed files with 11 additions and 7 deletions
  1. 11 7
      app/admin/service/order/OrderService.php

+ 11 - 7
app/admin/service/order/OrderService.php

@@ -216,15 +216,17 @@ class OrderService
                 'auth_code' => $params['qrcode_nbr'],
             ];
             try {
-//                Pay::wechat(config('payment.wxpay'))->pos($payData);
-                $result = self::findWxpay('OD20240816110857N900IC', 0);
+                Pay::wechat(config('payment.wxpay'))->pos($payData);
+                $result = self::findWxpay($params['orderGroupId'], 0);
                 dump("微信返回",$result);
             } catch (\Exception $e) {
                 $log->error("WXPAY", ['msg' => $e->getMessage()]);
                 throw new BusinessException("支付失败");
             }
+            try{
+                $log->info("WXPAY_RETURN", json_decode(json_encode($result), true));
+            }catch (\Exception $e){}
 
-            $log->info("WXPAY_RETURN", json_decode(json_encode($result), true));
 
         } else if (in_array($prefix, [25, 26, 27, 28, 29, 30])) {
             $payData = [
@@ -234,15 +236,17 @@ class OrderService
                 'auth_code' => $params['qrcode_nbr'],
             ];
             try {
-                Pay::alipay(config('payment.alipay'))->pos($payData);
-                $result = self::findAlipay($params['orderGroupId'], 0);
+//                Pay::alipay(config('payment.alipay'))->pos($payData);
+//                $result = self::findAlipay($params['orderGroupId'], 0);
+                $result = self::findAlipay('OD20240805165613RA12N5', 0);
             } catch (\Exception $e) {
                 $log->error("ALIPAY", ['msg' => $e->getMessage()]);
                 throw new BusinessException("支付失败");
             }
 
-            $log->info("ALIPAY_RETURN", json_decode(json_encode($result), true));
-
+            try{
+                $log->info("ALIPAY_RETURN", json_decode(json_encode($result), true));
+            }catch (\Exception $e){}
         } else {
             throw new BusinessException("二维码无效");
         }