fix: update recept
This commit is contained in:
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user