refactor: payments providers

This commit is contained in:
3252a8
2026-05-18 10:29:00 +03:00
parent fff7e90e14
commit 51c9c8b4f0
63 changed files with 7480 additions and 6843 deletions
+22
View File
@@ -358,6 +358,28 @@ class WebAppAssetTests(unittest.IsolatedAsyncioTestCase):
self.assertEqual(methods, [])
def test_serialize_payment_methods_includes_provider_presentation(self):
settings = Settings(
_env_file=None,
BOT_TOKEN="token",
POSTGRES_USER="app_user",
POSTGRES_PASSWORD="app_password",
TARIFFS_CONFIG_PATH="missing-tariffs.json",
PAYMENT_METHODS_ORDER="yookassa",
YOOKASSA_ENABLED=True,
PAYMENT_YOOKASSA_WEBAPP_LABEL_RU="Карта",
PAYMENT_YOOKASSA_WEBAPP_LABEL_EN="Bank card",
PAYMENT_YOOKASSA_WEBAPP_ICON="WalletCards",
)
app = {"yookassa_service": SimpleNamespace(configured=True)}
methods = subscription_webapp._serialize_payment_methods(settings, app, "en")
self.assertEqual(
methods,
[{"id": "yookassa", "name": "Bank card", "icon": "WalletCards"}],
)
def test_serialize_plans_includes_stars_only_subscription_options(self):
settings = Settings(
_env_file=None,