feat: lots of stuff

This commit is contained in:
2024-03-24 20:04:02 +01:00
parent 22cea344a5
commit 7725247a3f
11 changed files with 360 additions and 75 deletions
+10
View File
@@ -104,6 +104,11 @@ class TestRedsysTPV(APITestCase):
assert response.status_code == status.HTTP_200_OK
response = self.client.get(
reverse("tpv:ok", kwargs={"order": order.hash})
)
assert response.status_code == status.HTTP_200_OK
def test_redsys_webhook_payment_error(self):
amount_to_pay = Decimal("10.00")
order = PaymentTPV.objects.create(amount=amount_to_pay)
@@ -167,3 +172,8 @@ class TestRedsysTPV(APITestCase):
order.refresh_from_db()
assert str(ERROR_CODES.get("0184")) in order.observations
assert order.status == PaymentTPV.StatusChoices.ERROR
response = self.client.get(
reverse("tpv:ko", kwargs={"order": order.hash})
)
assert response.status_code == status.HTTP_200_OK