Skip to content

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

Fix billing braintree issue

Jakub Draganek08a4cafecb4f
diff --git a/saleor/payment/gateways/braintree/__init__.py b/saleor/payment/gateways/braintree/__init__.py
index 65d70244ff..583725342a 100644
--- a/saleor/payment/gateways/braintree/__init__.py
+++ b/saleor/payment/gateways/braintree/__init__.py
@@ -53,7 +53,9 @@ def get_customer_data(payment_information: PaymentData) -> Dict:
"locality": billing.city,
"region": billing.country_area,
"country_code_alpha2": billing.country,
- },
+ }
+ if billing
+ else {},
"risk_data": {"customer_ip": payment_information.customer_ip_address or ""},
"customer": {"email": payment_information.customer_email},
}