|
@@ -81,18 +81,18 @@ class BillHandler(BaseHandler[dict]):
|
|
|
reason = (data.notify_reason or "").upper()
|
|
reason = (data.notify_reason or "").upper()
|
|
|
if "SUCCESS" in reason:
|
|
if "SUCCESS" in reason:
|
|
|
status = TransferStatusEnum.SUCCESS.value
|
|
status = TransferStatusEnum.SUCCESS.value
|
|
|
|
|
+ await AccountService.update_transfer_status_service(
|
|
|
|
|
+ auth, data.pay_no, status, data.model_dump(exclude_none=True)
|
|
|
|
|
+ )
|
|
|
elif "FAIL" in reason:
|
|
elif "FAIL" in reason:
|
|
|
status = TransferStatusEnum.FAIL.value
|
|
status = TransferStatusEnum.FAIL.value
|
|
|
|
|
+ await AccountService.update_transfer_status_service(
|
|
|
|
|
+ auth, data.pay_no, status, data.model_dump(exclude_none=True)
|
|
|
|
|
+ )
|
|
|
else:
|
|
else:
|
|
|
- # 无法判断状态时不更新(避免把已成功的状态改成DEALING)
|
|
|
|
|
log.warning(f"转账状态无法判断,跳过更新: pay_no={data.pay_no}, notify_reason={data.notify_reason}")
|
|
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)
|
|
|
|
|
- )
|
|
|
|
|
-
|
|
|
|
|
- # 无论成功/失败都回调商户,告知最终结果
|
|
|
|
|
|
|
+ # 无论是否更新状态,都回调商户通知状态变化
|
|
|
await OpenTransferService.open_return_service(auth, data.pay_no)
|
|
await OpenTransferService.open_return_service(auth, data.pay_no)
|
|
|
|
|
|
|
|
else:
|
|
else:
|