mirror of
https://github.com/BEDOLAGA-DEV/remnawave-bedolaga-telegram-bot.git
synced 2026-04-29 01:00:03 +00:00
@@ -535,8 +535,8 @@ class Pal24PaymentMixin:
|
||||
"""Преобразует нормализованный метод оплаты в значение для Pal24 API."""
|
||||
|
||||
api_mapping = {
|
||||
"sbp": "fast_payment",
|
||||
"card": "bank_card",
|
||||
"sbp": "SBP",
|
||||
"card": "BANK_CARD",
|
||||
}
|
||||
|
||||
return api_mapping.get(normalized_payment_method)
|
||||
|
||||
@@ -70,13 +70,15 @@ async def test_create_bill_success(monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
ttl_seconds=600,
|
||||
custom_payload={"extra": "value"},
|
||||
payer_email="user@example.com",
|
||||
payment_method="card",
|
||||
payment_method="BANK_CARD",
|
||||
)
|
||||
|
||||
assert result["bill_id"] == "BILL42"
|
||||
assert client.calls and client.calls[0]["amount"] == Decimal("500.00")
|
||||
assert client.calls[0]["shop_id"] == "shop42"
|
||||
assert client.calls[0]["description"] == "Пополнение"
|
||||
assert client.calls[0]["custom"] == json.dumps({"extra": "value"}, ensure_ascii=False, separators=(",", ":"))
|
||||
assert client.calls[0]["payment_method"] == "BANK_CARD"
|
||||
|
||||
|
||||
@pytest.mark.anyio("asyncio")
|
||||
|
||||
@@ -104,7 +104,7 @@ async def test_create_pal24_payment_success(monkeypatch: pytest.MonkeyPatch) ->
|
||||
assert result["payment_method"] == "card"
|
||||
assert result["link_url"] == "https://pal24/sbp"
|
||||
assert result["card_url"] == "https://pal24/card"
|
||||
assert stub.calls and stub.calls[0]["payment_method"] == "bank_card"
|
||||
assert stub.calls and stub.calls[0]["payment_method"] == "BANK_CARD"
|
||||
assert stub.calls and stub.calls[0]["amount_kopeks"] == 50000
|
||||
assert "links" in captured_args["metadata"]
|
||||
|
||||
@@ -137,7 +137,7 @@ async def test_create_pal24_payment_default_method(monkeypatch: pytest.MonkeyPat
|
||||
)
|
||||
|
||||
assert result is not None
|
||||
assert stub.calls and stub.calls[0]["payment_method"] == "fast_payment"
|
||||
assert stub.calls and stub.calls[0]["payment_method"] == "SBP"
|
||||
assert result["payment_method"] == "sbp"
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user