From ad180fc5bfe545104cfa04096d0ce1649c668cf6 Mon Sep 17 00:00:00 2001 From: Ankush Menat Date: Thu, 31 Mar 2022 15:39:35 +0530 Subject: [PATCH 1/2] fix: capture curency code from order data --- ecommerce_integrations/unicommerce/order.py | 1 + 1 file changed, 1 insertion(+) diff --git a/ecommerce_integrations/unicommerce/order.py b/ecommerce_integrations/unicommerce/order.py index ff3629bb..71ae0990 100644 --- a/ecommerce_integrations/unicommerce/order.py +++ b/ecommerce_integrations/unicommerce/order.py @@ -198,6 +198,7 @@ def _create_order(order: UnicommerceOrder, customer) -> None: "tax_category": get_dummy_tax_category(), "company_address": company_address, "dispatch_address_name": dispatch_address, + "currency": order.get("currencyCode"), } ) From aa9e1fd980016d36e57bb7f8e8a93466fc5f9724 Mon Sep 17 00:00:00 2001 From: Ankush Menat Date: Thu, 31 Mar 2022 16:00:54 +0530 Subject: [PATCH 2/2] fix: better error message in case of HTTPError --- ecommerce_integrations/unicommerce/api_client.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ecommerce_integrations/unicommerce/api_client.py b/ecommerce_integrations/unicommerce/api_client.py index 845baea9..8bb5336e 100644 --- a/ecommerce_integrations/unicommerce/api_client.py +++ b/ecommerce_integrations/unicommerce/api_client.py @@ -56,6 +56,8 @@ def request( response = requests.request( url=url, method=method, headers=headers, json=body, params=params, files=files ) + # unicommerce gives useful info in response text, show it in error logs + response.reason = cstr(response.reason) + cstr(response.text) response.raise_for_status() except Exception: create_unicommerce_log(status="Error", make_new=True)