fix(payments): hardcode RUB in user payment handlers

This commit is contained in:
kavore
2026-02-09 00:19:59 +03:00
parent 7622537961
commit 2c618c7a6a
6 changed files with 7 additions and 7 deletions
+2 -2
View File
@@ -98,7 +98,7 @@ async def process_successful_payment(session: AsyncSession, bot: Bot,
session, session,
user_id=user_id, user_id=user_id,
amount=payment_value, amount=payment_value,
currency=amount_data.get("currency", settings.DEFAULT_CURRENCY_SYMBOL), currency=amount_data.get("currency", "RUB"),
months=months_for_record or 1, months=months_for_record or 1,
description=payment_info_from_webhook.get( description=payment_info_from_webhook.get(
"description") or f"Auto-renewal for {months_for_record or subscription_months} months", "description") or f"Auto-renewal for {months_for_record or subscription_months} months",
@@ -471,7 +471,7 @@ async def process_successful_payment(session: AsyncSession, bot: Bot,
await notification_service.notify_payment_received( await notification_service.notify_payment_received(
user_id=user_id, user_id=user_id,
amount=payment_value, amount=payment_value,
currency=settings.DEFAULT_CURRENCY_SYMBOL, currency="RUB",
months=int(subscription_months) if sale_mode != "traffic" else 0, months=int(subscription_months) if sale_mode != "traffic" else 0,
payment_provider="yookassa", # This is specifically for YooKassa webhook payment_provider="yookassa", # This is specifically for YooKassa webhook
username=user.username if user else None, username=user.username if user else None,
+1 -1
View File
@@ -63,7 +63,7 @@ async def display_subscription_options(
await event.answer(err_msg) await event.answer(err_msg)
return return
currency_symbol_val = settings.DEFAULT_CURRENCY_SYMBOL currency_symbol_val = "RUB"
traffic_packages = getattr(settings, "traffic_packages", {}) or {} traffic_packages = getattr(settings, "traffic_packages", {}) or {}
stars_traffic_packages = getattr(settings, "stars_traffic_packages", {}) or {} stars_traffic_packages = getattr(settings, "stars_traffic_packages", {}) or {}
traffic_mode = bool(getattr(settings, "traffic_sale_mode", False) or stars_traffic_packages) traffic_mode = bool(getattr(settings, "traffic_sale_mode", False) or stars_traffic_packages)
@@ -67,7 +67,7 @@ async def pay_fk_callback_handler(
if sale_mode == "traffic" if sale_mode == "traffic"
else get_text("payment_description_subscription", months=int(months)) else get_text("payment_description_subscription", months=int(months))
) )
currency_code = getattr(freekassa_service, "default_currency", None) or settings.DEFAULT_CURRENCY_SYMBOL or "RUB" currency_code = getattr(freekassa_service, "default_currency", None) or "RUB"
# Price is already discounted at payments_subscription.py stage # Price is already discounted at payments_subscription.py stage
# Service will handle discount metadata if needed # Service will handle discount metadata if needed
@@ -67,7 +67,7 @@ async def pay_platega_callback_handler(
if sale_mode == "traffic" if sale_mode == "traffic"
else get_text("payment_description_subscription", months=int(months)) else get_text("payment_description_subscription", months=int(months))
) )
currency_code = settings.DEFAULT_CURRENCY_SYMBOL or "RUB" currency_code = "RUB"
# Price is already discounted at payments_subscription.py stage # Price is already discounted at payments_subscription.py stage
# Service will handle discount metadata if needed # Service will handle discount metadata if needed
@@ -66,7 +66,7 @@ async def pay_severpay_callback_handler(
if sale_mode == "traffic" if sale_mode == "traffic"
else get_text("payment_description_subscription", months=int(months)) else get_text("payment_description_subscription", months=int(months))
) )
currency_code = settings.DEFAULT_CURRENCY_SYMBOL or "RUB" currency_code = "RUB"
# Price is already discounted at payments_subscription.py stage # Price is already discounted at payments_subscription.py stage
# Service will handle discount metadata if needed # Service will handle discount metadata if needed
@@ -49,7 +49,7 @@ async def select_subscription_period_callback_handler(
price_rub = price_source.get(months) price_rub = price_source.get(months)
stars_price = stars_price_source.get(months) stars_price = stars_price_source.get(months)
currency_symbol_val = settings.DEFAULT_CURRENCY_SYMBOL currency_symbol_val = "RUB"
# Check for active discount and apply if exists # Check for active discount and apply if exists
discount_text = "" discount_text = ""