From 194295d34c2c69abd901e95b159c549eb0690552 Mon Sep 17 00:00:00 2001 From: kavore <161734431+kavore@users.noreply.github.com> Date: Mon, 9 Feb 2026 00:04:05 +0300 Subject: [PATCH] fix(payments): add cancel button for Telegram Stars flow --- .../user/subscription/payments_stars.py | 22 ++++++++++++++----- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/bot/handlers/user/subscription/payments_stars.py b/bot/handlers/user/subscription/payments_stars.py index df6bef5..519b974 100644 --- a/bot/handlers/user/subscription/payments_stars.py +++ b/bot/handlers/user/subscription/payments_stars.py @@ -78,12 +78,22 @@ async def pay_stars_callback_handler( months=int(months), traffic_gb=human_value, ), - reply_markup=InlineKeyboardMarkup(inline_keyboard=[ - [InlineKeyboardButton( - text=get_text("back_to_payment_methods_button"), - callback_data=f"subscribe_period:{human_value}", - )] - ]), + reply_markup=InlineKeyboardMarkup( + inline_keyboard=[ + [ + InlineKeyboardButton( + text=get_text("back_to_payment_methods_button"), + callback_data=f"subscribe_period:{human_value}", + ) + ], + [ + InlineKeyboardButton( + text=get_text("cancel_button"), + callback_data="main_action:subscribe", + ) + ], + ] + ), ) except Exception as e_edit: logging.warning(f"Stars payment: failed to show invoice info message ({e_edit})")