From 5a7de9731a91cd7330e6b1bcd524af21324e93a9 Mon Sep 17 00:00:00 2001 From: Egor Date: Sat, 20 Sep 2025 02:08:10 +0300 Subject: [PATCH 1/3] Add missing subscription checkout localization --- app/localization/locales/en.json | 1 + app/localization/locales/ru.json | 1 + 2 files changed, 2 insertions(+) diff --git a/app/localization/locales/en.json b/app/localization/locales/en.json index 81963f10..ca3657af 100644 --- a/app/localization/locales/en.json +++ b/app/localization/locales/en.json @@ -35,6 +35,7 @@ "ERROR_TRY_AGAIN": "❌ An error occurred. Please try again.", "ERROR_RULES_RETRY": "An error occurred. Please try accepting the rules again:", "GO_TO_BALANCE_TOP_UP": "💳 Go to balance top up", + "RETURN_TO_SUBSCRIPTION_CHECKOUT": "⬅️ Return to subscription checkout", "INSUFFICIENT_BALANCE": "❌ Insufficient balance.\n\nTop up {amount} and try again.", "LANGUAGE_SELECTED": "🌐 Interface language set: English", "LOADING": "⏳ Loading...", diff --git a/app/localization/locales/ru.json b/app/localization/locales/ru.json index 704932b8..d6164852 100644 --- a/app/localization/locales/ru.json +++ b/app/localization/locales/ru.json @@ -71,6 +71,7 @@ "ERROR_TRY_AGAIN": "❌ Произошла ошибка. Попробуйте еще раз.", "ERROR_RULES_RETRY": "Произошла ошибка. Попробуйте принять правила еще раз:", "GO_TO_BALANCE_TOP_UP": "💳 Перейти к пополнению баланса", + "RETURN_TO_SUBSCRIPTION_CHECKOUT": "⬅️ Вернуться к оформлению подписки", "INSUFFICIENT_BALANCE": "❌ Недостаточно средств на балансе. \n \n Пополните баланс на {amount} и попробуйте снова.\n ", "INVALID_AMOUNT": "❌ Неверная сумма", "LANGUAGE_SELECTED": "🌐 Язык интерфейса установлен: Русский", From 21e5af9e9ed394bb8fde7ae6d4a8c113eb21a620 Mon Sep 17 00:00:00 2001 From: Egor Date: Sat, 20 Sep 2025 02:15:38 +0300 Subject: [PATCH 2/3] Fix subscription checkout resume callbacks registration --- app/handlers/subscription.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/app/handlers/subscription.py b/app/handlers/subscription.py index 798cf4df..3e263b7b 100644 --- a/app/handlers/subscription.py +++ b/app/handlers/subscription.py @@ -4152,6 +4152,21 @@ def register_handlers(dp: Dispatcher): F.data == "subscription_confirm", SubscriptionStates.confirming_purchase ) + + dp.callback_query.register( + resume_subscription_checkout, + F.data == "subscription_resume_checkout", + ) + + dp.callback_query.register( + return_to_saved_cart, + F.data == "return_to_saved_cart", + ) + + dp.callback_query.register( + clear_saved_cart, + F.data == "clear_saved_cart", + ) dp.callback_query.register( handle_autopay_menu, From ee65e651088baaee8869aa3e9c71b30f24847c34 Mon Sep 17 00:00:00 2001 From: Egor Date: Sat, 20 Sep 2025 02:23:20 +0300 Subject: [PATCH 3/3] Fix missing texts initialization in manage countries keyboard --- app/keyboards/inline.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/keyboards/inline.py b/app/keyboards/inline.py index e6306396..52afee68 100644 --- a/app/keyboards/inline.py +++ b/app/keyboards/inline.py @@ -1015,14 +1015,16 @@ def get_reset_traffic_confirm_keyboard(price_kopeks: int, language: str = DEFAUL ]) def get_manage_countries_keyboard( - countries: List[dict], - selected: List[str], + countries: List[dict], + selected: List[str], current_subscription_countries: List[str], language: str = DEFAULT_LANGUAGE, subscription_end_date: datetime = None ) -> InlineKeyboardMarkup: from app.utils.pricing_utils import get_remaining_months - + + texts = get_texts(language) + months_multiplier = 1 if subscription_end_date: months_multiplier = get_remaining_months(subscription_end_date)