ソースを参照

fix(notify): 转账回调无法判断状态时跳过更新,避免DEALING覆盖SUCCESS

alphah 2 週間 前
コミット
41e248b434

+ 3 - 2
backend/app/plugin/module_payment/notification/handlers/bill_handler.py

@@ -84,8 +84,9 @@ class BillHandler(BaseHandler[dict]):
             elif "FAIL" in reason:
                 status = TransferStatusEnum.FAIL.value
             else:
-                status = TransferStatusEnum.DEALING.value
-                log.warning(f"转账状态无法判断: pay_no={data.pay_no}, notify_reason={data.notify_reason}")
+                # 无法判断状态时不更新(避免把已成功的状态改成DEALING)
+                log.warning(f"转账状态无法判断,跳过更新: pay_no={data.pay_no}, notify_reason={data.notify_reason}")
+                return True
 
             await AccountService.update_transfer_status_service(
                 auth, data.pay_no, status, data.model_dump(exclude_none=True)