fix: agent 4 to 6
This commit is contained in:
@@ -35,7 +35,8 @@ class Payment(Base, UlidPrimaryKeyMixin, AuditTimestampsMixin):
|
||||
default=PaymentStatus.PENDING,
|
||||
)
|
||||
|
||||
receipt_cloudekassir_link: Mapped[str] = mapped_column(nullable=True)
|
||||
receipt_cloudekassir_id: Mapped[str | None] = mapped_column(String(64), nullable=True)
|
||||
receipt_cloudekassir_link: Mapped[str | None] = mapped_column(nullable=True)
|
||||
|
||||
itpay_payment_id: Mapped[str | None] = mapped_column(String(64), nullable=True)
|
||||
itpay_paid_amount: Mapped[Decimal | None] = mapped_column(Numeric(38, 2), nullable=True)
|
||||
|
||||
@@ -28,6 +28,7 @@ class PaymentRepository(IPaymentRepository):
|
||||
user_id=user_id,
|
||||
order_id=order_id,
|
||||
status=PaymentStatus.PENDING,
|
||||
receipt_cloudekassir_id=None,
|
||||
receipt_cloudekassir_link=None,
|
||||
itpay_payment_id=itpay_payment_id,
|
||||
itpay_paid_amount=paid_amount_dec,
|
||||
@@ -39,3 +40,14 @@ class PaymentRepository(IPaymentRepository):
|
||||
await self._session.flush()
|
||||
return
|
||||
|
||||
|
||||
async def update_receipt(self,*,order_id:str,receipt_cloudekassir_id:str|None,receipt_cloudekassir_link:str|None) -> None:
|
||||
stmt=select(Payment).where(Payment.order_id==order_id)
|
||||
model=await self._session.scalar(stmt)
|
||||
if model is None:
|
||||
return
|
||||
model.receipt_cloudekassir_id=receipt_cloudekassir_id
|
||||
model.receipt_cloudekassir_link=receipt_cloudekassir_link
|
||||
await self._session.flush()
|
||||
return
|
||||
|
||||
|
||||
Reference in New Issue
Block a user