fix: agent 4 to 6

This commit is contained in:
2026-05-09 10:42:25 +03:00
parent b6e4f8165f
commit 195c0a8e53
6 changed files with 33 additions and 6 deletions

View File

@@ -93,7 +93,7 @@ class CreatePaymentCloudkassirCommand:
if paid_total is not None and abs(total_amount - paid_total) > Decimal('0.02'):
raise ApplicationException(status_code=400, message='Receipt total does not match paid amount')
await self._receipt.create_receipt(
receipt_response = await self._receipt.create_receipt(
order_id=order_id,
user_id=user_id,
email=email,
@@ -102,3 +102,11 @@ class CreatePaymentCloudkassirCommand:
service_fee=service_fee,
request_id=str(ULID()),
)
receipt_model = receipt_response.get('Model')
if not isinstance(receipt_model, dict):
receipt_model = {}
await self._unit_of_work.payment_repository.update_receipt(
order_id=order_id,
receipt_cloudekassir_id=str(receipt_model.get('Id') or '') or None,
receipt_cloudekassir_link=str(receipt_model.get('ReceiptLocalUrl') or '') or None,
)