fix: remove PayKilla redirect fields
This commit is contained in:
+5
-15
@@ -218,6 +218,7 @@ class PaykillaServiceTests(unittest.TestCase):
|
||||
)
|
||||
service.settings = SimpleNamespace(
|
||||
WEBHOOK_BASE_URL="https://shop.example",
|
||||
WEBAPP_TITLE="/minishop",
|
||||
trusted_proxies=["127.0.0.1"],
|
||||
)
|
||||
service._default_return_url = "test_bot"
|
||||
@@ -245,6 +246,7 @@ class PaykillaServiceTests(unittest.TestCase):
|
||||
|
||||
def test_invoice_body_uses_english_purpose_and_description(self):
|
||||
service = self._make_service()
|
||||
service.settings.WEBAPP_TITLE = "Tunnel Shop"
|
||||
|
||||
body = service._invoice_body(
|
||||
payment_db_id=556,
|
||||
@@ -253,15 +255,13 @@ class PaykillaServiceTests(unittest.TestCase):
|
||||
description="Оплата подписки на 1 мес. - тариф «Базовый» ✅",
|
||||
)
|
||||
|
||||
self.assertEqual(body["purpose"], "Minishop payment 556")
|
||||
self.assertEqual(body["purpose"], "Tunnel Shop payment 556")
|
||||
self.assertEqual(body["description"], body["purpose"])
|
||||
self.assertRegex(body["purpose"], r"^[A-Za-z0-9_\s.,]+$")
|
||||
self.assertNotIn("urls", body)
|
||||
|
||||
def test_invoice_body_includes_only_explicit_redirect_urls(self):
|
||||
def test_invoice_body_omits_redirect_urls(self):
|
||||
service = self._make_service()
|
||||
service.config.SUCCESS_URL = "https://shop.example/pay/success"
|
||||
service.config.RETURN_URL = "https://shop.example/pay/return"
|
||||
|
||||
body = service._invoice_body(
|
||||
payment_db_id=556,
|
||||
@@ -270,17 +270,7 @@ class PaykillaServiceTests(unittest.TestCase):
|
||||
description="ignored",
|
||||
)
|
||||
|
||||
self.assertEqual(
|
||||
body["urls"],
|
||||
[
|
||||
{
|
||||
"type": "SUCCESS",
|
||||
"url": "https://shop.example/pay/success",
|
||||
"autoRedirect": True,
|
||||
},
|
||||
{"type": "RETURN", "url": "https://shop.example/pay/return"},
|
||||
],
|
||||
)
|
||||
self.assertNotIn("urls", body)
|
||||
|
||||
def test_verify_webhook_signature_accepts_raw_body_signature(self):
|
||||
service = self._make_service()
|
||||
|
||||
Reference in New Issue
Block a user