Merge branch 'skia/et_autoanswer' into 'master'

eboutic: change HTTP return code to avoid blaming the bank's service

See merge request ae/Sith!295
This commit is contained in:
Skia 2022-02-10 12:32:43 +00:00
commit d8fd0adf47
2 changed files with 8 additions and 6 deletions

View File

@ -191,10 +191,10 @@ class EbouticTest(TestCase):
)
response = self.generate_bank_valid_answer_from_page_content(response.content)
self.assertTrue(response.status_code == 400)
self.assertTrue(
"Payment failed with error: SuspiciousOperation('Basket total and amount do not match'"
in response.content.decode("utf-8")
self.assertEqual(response.status_code, 500)
self.assertIn(
"Basket processing failed with error: SuspiciousOperation('Basket total and amount do not match'",
response.content.decode("utf-8"),
)
def test_buy_refill_product_with_credit_card(self):

View File

@ -301,9 +301,11 @@ class EtransactionAutoAnswer(View):
i.validate()
b.delete()
except Exception as e:
return HttpResponse("Payment failed with error: " + repr(e), status=400)
return HttpResponse(
"Basket processing failed with error: " + repr(e), status=500
)
return HttpResponse()
else:
return HttpResponse(
"Payment failed with error: " + request.GET["Error"], status=400
"Payment failed with error: " + request.GET["Error"], status=202
)