fix: send tariff currency to PayKilla

This commit is contained in:
3252a8
2026-06-04 15:34:26 +03:00
parent 8d6f91b292
commit 69985e44dd
5 changed files with 24 additions and 16 deletions
+15 -1
View File
@@ -260,7 +260,7 @@ class PaykillaServiceTests(unittest.TestCase):
self.assertRegex(body["purpose"], r"^[A-Za-z0-9_\s.,]+$")
self.assertNotIn("urls", body)
def test_invoice_body_uses_configured_paykilla_currency(self):
def test_invoice_body_uses_payment_currency_before_configured_fallback(self):
service = self._make_service()
service.config.CURRENCY = "USD"
@@ -271,6 +271,20 @@ class PaykillaServiceTests(unittest.TestCase):
description="ignored",
)
self.assertEqual(body["currency"], "RUB")
self.assertEqual(body["type"], "FIAT_BASED")
def test_invoice_body_uses_configured_currency_as_fallback(self):
service = self._make_service()
service.config.CURRENCY = "USD"
body = service._invoice_body(
payment_db_id=556,
amount=100,
currency=None,
description="ignored",
)
self.assertEqual(body["currency"], "USD")
self.assertEqual(body["type"], "FIAT_BASED")