fix: fix menus and modal views after payment providers refactor

This commit is contained in:
3252a8
2026-05-18 11:01:32 +03:00
parent 51c9c8b4f0
commit 960754c54e
13 changed files with 482 additions and 62 deletions
@@ -7,7 +7,10 @@ from typing import Optional
from aiogram import types
from sqlalchemy.ext.asyncio import AsyncSession
from bot.keyboards.inline.user_keyboards import get_payment_url_keyboard
from bot.keyboards.inline.user_keyboards import (
get_payment_url_keyboard,
payment_methods_back_callback,
)
from bot.middlewares.i18n import JsonI18n
from db.dal import payment_dal
from db.models import Payment
@@ -155,7 +158,9 @@ async def render_payment_link(
payment_url,
current_lang,
i18n,
back_callback=f"subscribe_period:{parts.human_value}",
back_callback=payment_methods_back_callback(
parts.human_value, parts.sale_mode, parts.price
),
back_text_key=back_text_key,
)
await edit_or_answer(
@@ -123,7 +123,9 @@ def sale_mode_is_hwid_devices(sale_mode: str) -> bool:
def sale_mode_tariff_key(sale_mode: str) -> Optional[str]:
return str(sale_mode or "").split("@", 1)[1] if "@" in str(sale_mode or "") else None
if "@" not in str(sale_mode or ""):
return None
return str(sale_mode).split("@", 1)[1].split("|", 1)[0] or None
def format_number_for_payload(value: Any) -> str: