style: ruff format kassa_ai files
This commit is contained in:
@@ -1854,6 +1854,7 @@ class Settings(BaseSettings):
|
||||
|
||||
def get_riopay_display_name_html(self) -> str:
|
||||
return html.escape(self.get_riopay_display_name())
|
||||
|
||||
def is_kassa_ai_sbp_enabled(self) -> bool:
|
||||
return self.KASSA_AI_SBP_ENABLED and self.is_kassa_ai_enabled()
|
||||
|
||||
|
||||
@@ -420,9 +420,7 @@ async def start_kassa_ai_sbp_topup(
|
||||
display_name = settings.get_kassa_ai_sbp_display_name()
|
||||
|
||||
keyboard = InlineKeyboardMarkup(
|
||||
inline_keyboard=[
|
||||
[InlineKeyboardButton(text=texts.t('BACK_BUTTON', '◀️ Назад'), callback_data='menu_balance')]
|
||||
]
|
||||
inline_keyboard=[[InlineKeyboardButton(text=texts.t('BACK_BUTTON', '◀️ Назад'), callback_data='menu_balance')]]
|
||||
)
|
||||
|
||||
await callback.message.edit_text(
|
||||
@@ -528,9 +526,7 @@ async def start_kassa_ai_card_topup(
|
||||
display_name = settings.get_kassa_ai_card_display_name()
|
||||
|
||||
keyboard = InlineKeyboardMarkup(
|
||||
inline_keyboard=[
|
||||
[InlineKeyboardButton(text=texts.t('BACK_BUTTON', '◀️ Назад'), callback_data='menu_balance')]
|
||||
]
|
||||
inline_keyboard=[[InlineKeyboardButton(text=texts.t('BACK_BUTTON', '◀️ Назад'), callback_data='menu_balance')]]
|
||||
)
|
||||
|
||||
await callback.message.edit_text(
|
||||
|
||||
@@ -135,7 +135,9 @@ async def route_payment_by_method(
|
||||
from .kassa_ai import process_kassa_ai_payment_amount
|
||||
|
||||
async with AsyncSessionLocal() as db:
|
||||
await process_kassa_ai_payment_amount(message, db_user, db, amount_kopeks, state, payment_method=payment_method)
|
||||
await process_kassa_ai_payment_amount(
|
||||
message, db_user, db, amount_kopeks, state, payment_method=payment_method
|
||||
)
|
||||
return True
|
||||
|
||||
if payment_method == 'riopay':
|
||||
|
||||
@@ -97,7 +97,9 @@ class KassaAiPaymentMixin:
|
||||
amount=amount_rubles,
|
||||
currency=currency,
|
||||
email=email,
|
||||
payment_system_id=payment_system_id if payment_system_id is not None else settings.KASSA_AI_PAYMENT_SYSTEM_ID,
|
||||
payment_system_id=payment_system_id
|
||||
if payment_system_id is not None
|
||||
else settings.KASSA_AI_PAYMENT_SYSTEM_ID,
|
||||
)
|
||||
|
||||
payment_url = result.get('location')
|
||||
@@ -119,7 +121,9 @@ class KassaAiPaymentMixin:
|
||||
currency=currency,
|
||||
description=description,
|
||||
payment_url=payment_url,
|
||||
payment_system_id=payment_system_id if payment_system_id is not None else settings.KASSA_AI_PAYMENT_SYSTEM_ID,
|
||||
payment_system_id=payment_system_id
|
||||
if payment_system_id is not None
|
||||
else settings.KASSA_AI_PAYMENT_SYSTEM_ID,
|
||||
expires_at=expires_at,
|
||||
metadata_json=metadata,
|
||||
)
|
||||
|
||||
@@ -672,6 +672,7 @@ class PaymentService(
|
||||
return None
|
||||
|
||||
from app.services.kassa_ai_service import KASSA_AI_SUB_METHODS
|
||||
|
||||
sub = KASSA_AI_SUB_METHODS.get(payment_method)
|
||||
ps_id = sub['payment_system_id'] if sub else None
|
||||
|
||||
|
||||
Reference in New Issue
Block a user