From 071b9f2b25b1f271114cb6d9f8f05876b4f56a46 Mon Sep 17 00:00:00 2001 From: 3252a8 <3252a8@proton.me> Date: Sun, 17 May 2026 09:46:48 +0300 Subject: [PATCH] fix: add missing _PROVIDER_LABELS to PaymentContextMixin --- .../services/subscription_service_impl/payments.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/backend/bot/services/subscription_service_impl/payments.py b/backend/bot/services/subscription_service_impl/payments.py index fc817c2..d9f2df6 100644 --- a/backend/bot/services/subscription_service_impl/payments.py +++ b/backend/bot/services/subscription_service_impl/payments.py @@ -3,6 +3,19 @@ from ._runtime import * # noqa: F403,F405 class PaymentContextMixin: + # Human-readable provider names rendered in payment-success emails. + # Keys are the lowercased value persisted in ``subscriptions.provider`` + # (see the call sites in lifecycle.py / traffic.py); missing keys produce + # no row in the email rather than raising. + _PROVIDER_LABELS = { + "yookassa": "YooKassa", + "freekassa": "FreeKassa", + "platega": "Platega", + "severpay": "SeverPay", + "cryptopay": "Crypto Pay", + "telegram_stars": "Telegram Stars", + } + async def _record_payment_context( self, session: AsyncSession,