schon/payments/utils/__init__.py
Egor fureunoir Gorbunov a33be30098 Features: 1) Added vendor, product tag, category tag models and metadata; 2) Introduced proper noinspection comments for Mypy warnings; 3) Extended Markdown linting rules.
Fixes: 1) Corrected `ForeignKey` type assertions across models; 2) Resolved typos and formatting inconsistencies in `.env` and README; 3) Fixed explicit boolean checks in user manager methods.

Extra: Updated type hints in multiple models, serializers, and views.
2025-06-18 15:58:49 +03:00

15 lines
438 B
Python

from django.utils.translation import gettext_lazy as _
from payments.utils.cbr import get_rates as get_rates_cbr
def get_rates(provider: str):
if not provider:
raise ValueError(_("a provider to get rates from is required"))
# noinspection PyUnreachableCode
match provider:
case "cbr":
return get_rates_cbr()
case _:
raise ValueError(_(f"couldn't find provider {provider}"))