Ver código fonte

fix(sixshop-wechatpay): 修复调试模式下特殊订单报备逻辑并添加日志记录- 将 isDebug() 方法替换为直接访问 debug 属性
- 在特殊订单报备成功时添加信息日志
- 优化错误日志格式,使用占位符插入订单号

runphp 6 meses atrás
pai
commit
47f5abffec
1 arquivos alterados com 3 adições e 2 exclusões
  1. 3 2
      src/Hook/SpecialOrderHook.php

+ 3 - 2
src/Hook/SpecialOrderHook.php

@@ -22,11 +22,12 @@ class SpecialOrderHook
     #[Hook(PaymentSuccessEvent::class)]
     public function debugMode(PaymentSuccessEvent $event): void
     {
-        if ($this->config->isDebug()) {
+        if ($this->config->debug) {
             try {
                 $this->opSpecialOrder($event->orderNo, 2);
+                Log::info('特殊订单报备成功{order_no}', ['order_no' => $event->orderNo]);
             } catch (\Exception $e) {
-                Log::error('特殊订单报备失败', ['order_no' => $event->orderNo, 'msg' => $e->getMessage()]);
+                Log::error('特殊订单报备失败{order_no}', ['order_no' => $event->orderNo, 'msg' => $e->getMessage()]);
             }
         }
     }