Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Add comment for 400 status code

Mateusz Grzyb3fd6edc5e104
diff --git a/saleor/payment/gateways/np_atobarai/api_helpers.py b/saleor/payment/gateways/np_atobarai/api_helpers.py
index 79d5d9c8de..0a05344916 100644
--- a/saleor/payment/gateways/np_atobarai/api_helpers.py
+++ b/saleor/payment/gateways/np_atobarai/api_helpers.py
@@ -52,6 +52,9 @@ def _request(
auth=HTTPBasicAuth(config.merchant_code, config.sp_code),
headers={"X-NP-Terminal-Id": config.terminal_id},
)
+ # NP Atobarai returns error codes with http status code 400
+ # Because we want to pass those errors to the end user,
+ # we treat 400 as valid response.
if 400 < response.status_code <= 600:
raise requests.HTTPError
return response