fix: update recept

This commit is contained in:
2026-05-09 11:22:44 +03:00
parent ea0ca899ac
commit 3dfde69a3e
3 changed files with 26 additions and 24 deletions

View File

@@ -49,7 +49,7 @@ class CreatePaymentCloudkassirCommand:
email = str(user.email or '').strip()
if not email:
raise ApplicationException(status_code=400, message='User email missing')
supplier_name = ' '.join(
customer_info = ' '.join(
part
for part in (
str(user.last_name or '').strip(),
@@ -58,12 +58,14 @@ class CreatePaymentCloudkassirCommand:
)
if part
)
if not supplier_name:
if not customer_info:
raise ApplicationException(status_code=400, message='User full name missing')
supplier_inn = str(user.inn or '').strip()
if not supplier_inn:
customer_inn = str(user.inn or '').strip()
if not customer_inn:
raise ApplicationException(status_code=400, message='User inn missing')
phone = str(user.phone or '').strip() or None
if user.birth_date is None:
raise ApplicationException(status_code=400, message='User birth date missing')
customer_birthday = user.birth_date.isoformat()
paid_total = _parse_money(payment.amount)
if paid_total is None:
@@ -115,9 +117,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,
customer_info=customer_info,
customer_inn=customer_inn,
customer_birthday=customer_birthday,
request_id=str(ULID()),
)
receipt_model = receipt_response.get('Model')

View File

@@ -14,9 +14,9 @@ class IReceipt(ABC):
total_amount: Decimal,
principal_amount: Decimal,
service_fee: Decimal,
phone: str | None = None,
supplier_name: str = '',
supplier_inn: str = '',
customer_info: str = '',
customer_inn: str = '',
customer_birthday: str = '',
success_url: str | None = None,
fail_url: str | None = None,
request_id: str | None = None,