Backend: invoice uses external payment_id (not db id) / api exposes payment_id. Frontend: fullwidth qr+hint in cyber-mono partner card / render full partner conditions (mode/levels/min payout/methods).

This commit is contained in:
Vladless
2026-05-07 18:41:02 +00:00
parent 075ad515af
commit 8bc9f3ba0e
+6 -3
View File
@@ -242,6 +242,7 @@ async def auth_summary(
class MyPaymentItem(BaseModel):
id: int
payment_id: str | None
amount: float
currency: str
status: str
@@ -288,6 +289,7 @@ async def my_payments(
items.append(
MyPaymentItem(
id=int(p.id),
payment_id=str(p.payment_id) if p.payment_id else None,
amount=float(p.amount or 0),
currency=str(p.currency or "RUB"),
status=str(p.status or ""),
@@ -345,11 +347,12 @@ async def get_my_payment_invoice(
status_label = "ОПЛАЧЕН" if status_norm in {"completed", "success", "paid"} else "ОЖИДАЕТ" if status_norm in {"pending", "processing"} else "ОТКЛОНЁН"
provider = str(payment.payment_system or "").upper() or ""
user_label = identity.email or (f"tg · {identity.tg_id}" if identity.tg_id else identity.id)
payment_identifier = str(payment.payment_id or payment.id)
html = f"""<!DOCTYPE html>
<html lang=\"ru\">
<head>
<meta charset=\"utf-8\" />
<title>Квитанция #{_esc(payment.id)}</title>
<title>Квитанция {_esc(payment_identifier)}</title>
<style>
@page {{ size: A4; margin: 18mm; }}
body {{ font-family: 'JetBrains Mono', ui-monospace, monospace; color: #111; background: #fff; max-width: 720px; margin: 0 auto; padding: 24px; }}
@@ -368,7 +371,7 @@ async def get_my_payment_invoice(
</head>
<body>
<button class=\"print-btn no-print\" onclick=\"window.print()\">Сохранить PDF</button>
<h1>Квитанция #{_esc(payment.id)}</h1>
<h1>Квитанция {_esc(payment_identifier)}</h1>
<div class=\"sub\">// {_esc(created)}</div>
<div class=\"amount\">{amount_value:,.2f} {_esc(currency)}</div>
<span class=\"badge\">{_esc(status_label)}</span>
@@ -377,7 +380,7 @@ async def get_my_payment_invoice(
<tr><td class=\"k\">Провайдер</td><td class=\"v\">{_esc(provider)}</td></tr>
<tr><td class=\"k\">Дата</td><td class=\"v\">{_esc(created)}</td></tr>
<tr><td class=\"k\">Получатель</td><td class=\"v\">{_esc(user_label)}</td></tr>
<tr><td class=\"k\">Идентификатор платежа</td><td class=\"v\" style=\"font-size:11px;color:#666\">{_esc(payment.id)}</td></tr>
<tr><td class=\"k\">Идентификатор платежа</td><td class=\"v\" style=\"font-size:11px;color:#666\">{_esc(payment_identifier)}</td></tr>
</table>
<div class=\"footer\">Документ сгенерирован автоматически. Не требует подписи и печати.</div>
</body>