fix: reconcile Huihui payment callbacks after provider confirmation

This commit is contained in:
stefanfeng
2026-10-20 14:27:49 +08:00
parent 23d9a33a6d
commit 5c992729c4
6 changed files with 220 additions and 21 deletions
+18
View File
@@ -437,6 +437,24 @@ class PaymentTransaction(Base):
}
class HuihuiOrgPaymentNotice(Base):
"""Signed success notice awaiting independent confirmation from Huihui."""
__tablename__ = "huihui_org_payment_notices"
order_no = Column(String, primary_key=True)
payment_no = Column(String, nullable=False)
amount_cents = Column(Integer, nullable=False)
product_id = Column(String, nullable=False)
status = Column(String, nullable=False, default="awaiting_provider", index=True)
attempts = Column(Integer, nullable=False, default=0)
next_check_at = Column(DateTime, index=True)
last_provider_status = Column(String, default="")
last_error = Column(String, default="")
created_at = Column(DateTime, server_default=func.now())
updated_at = Column(DateTime, server_default=func.now(), onupdate=func.now())
class PaymentRefund(Base):
__tablename__ = "payment_refunds"