Browse Source

订单退款

gorden 6 months ago
parent
commit
bbbcafcdab
1 changed files with 5 additions and 1 deletions
  1. 5 1
      app/admin/controller/order/RefundController.php

+ 5 - 1
app/admin/controller/order/RefundController.php

@@ -586,13 +586,17 @@ class RefundController extends Curd
             ];
             $res = Pay::wechat(config('payment.wxpay'))->refund($data);
             $resArray = json_decode($res, true);
-            if (!$resArray['result_code'] == 'SUCCESS' || !$resArray['return_code'] == 'SUCCESS') {
+            if ($resArray['result_code'] != 'SUCCESS' || $resArray['return_code'] != 'SUCCESS') {
                 Log::channel('pay')->error('WXPAY_REFUND_FAIL', $resArray);
                 throw new BusinessException("退款失败");
             }
 
+            Log::info("退款响应", $resArray);
+
             return $resArray;
         } catch (\Exception $e) {
+            Log::error("微信退款失败", ['msg' => $e->getMessage()]);
+
             throw new BusinessException("退款失败");
         }
     }