From d81ab4137d82e472b7a32fa8dbe7799ebd2a6475 Mon Sep 17 00:00:00 2001 From: machka-pasla Date: Tue, 19 Aug 2025 12:26:56 +0300 Subject: [PATCH] Update payment processing logic to disable skipping active subscriptions - Modified the payment processing functions across multiple services to set skip_if_active_before_payment to False, ensuring that active subscriptions are not skipped during payment processing. - This change enhances the handling of user subscriptions and improves overall payment logic consistency. --- bot/handlers/user/payment.py | 2 +- bot/services/crypto_pay_service.py | 2 +- bot/services/stars_service.py | 2 +- bot/services/tribute_service.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bot/handlers/user/payment.py b/bot/handlers/user/payment.py index fcb479d..050ace8 100644 --- a/bot/handlers/user/payment.py +++ b/bot/handlers/user/payment.py @@ -127,7 +127,7 @@ async def process_successful_payment(session: AsyncSession, bot: Bot, user_id, subscription_months, current_payment_db_id=payment_db_id, - skip_if_active_before_payment=True, + skip_if_active_before_payment=False, ) applied_referee_bonus_days_from_referral: Optional[int] = None if referral_bonus_info and referral_bonus_info.get( diff --git a/bot/services/crypto_pay_service.py b/bot/services/crypto_pay_service.py index cdf0d78..718f0c2 100644 --- a/bot/services/crypto_pay_service.py +++ b/bot/services/crypto_pay_service.py @@ -146,7 +146,7 @@ class CryptoPayService: user_id, months, current_payment_db_id=payment_db_id, - skip_if_active_before_payment=True, + skip_if_active_before_payment=False, ) await session.commit() except Exception as e: diff --git a/bot/services/stars_service.py b/bot/services/stars_service.py index a6327ee..eaf36cc 100644 --- a/bot/services/stars_service.py +++ b/bot/services/stars_service.py @@ -100,7 +100,7 @@ class StarsService: message.from_user.id, months, current_payment_db_id=payment_db_id, - skip_if_active_before_payment=True, + skip_if_active_before_payment=False, ) await session.commit() diff --git a/bot/services/tribute_service.py b/bot/services/tribute_service.py index 8019263..a7d4403 100644 --- a/bot/services/tribute_service.py +++ b/bot/services/tribute_service.py @@ -161,7 +161,7 @@ class TributeService: int(user_id), months, current_payment_db_id=payment_record.payment_id, - skip_if_active_before_payment=True, + skip_if_active_before_payment=False, ) await session.commit()