fix: update recept

This commit is contained in:
2026-05-09 10:57:02 +03:00
parent 195c0a8e53
commit ea0ca899ac
7 changed files with 59 additions and 37 deletions

View File

@@ -49,6 +49,21 @@ class CreatePaymentCloudkassirCommand:
email = str(user.email or '').strip()
if not email:
raise ApplicationException(status_code=400, message='User email missing')
supplier_name = ' '.join(
part
for part in (
str(user.last_name or '').strip(),
str(user.first_name or '').strip(),
str(user.middle_name or '').strip(),
)
if part
)
if not supplier_name:
raise ApplicationException(status_code=400, message='User full name missing')
supplier_inn = str(user.inn or '').strip()
if not supplier_inn:
raise ApplicationException(status_code=400, message='User inn missing')
phone = str(user.phone or '').strip() or None
paid_total = _parse_money(payment.amount)
if paid_total is None:
@@ -100,6 +115,9 @@ class CreatePaymentCloudkassirCommand:
total_amount=total_amount,
principal_amount=principal_amount,
service_fee=service_fee,
phone=phone,
supplier_name=supplier_name,
supplier_inn=supplier_inn,
request_id=str(ULID()),
)
receipt_model = receipt_response.get('Model')