From f94a95eab0ad853669a15a13ecf8a773c3acfb18 Mon Sep 17 00:00:00 2001 From: David Remer Date: Mon, 24 Aug 2020 09:20:20 +0300 Subject: [PATCH] make sure buyer-country is populated, when used --- modules.local/ppcp-button/src/Assets/SmartButton.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules.local/ppcp-button/src/Assets/SmartButton.php b/modules.local/ppcp-button/src/Assets/SmartButton.php index 4796c06cc..c537f5110 100644 --- a/modules.local/ppcp-button/src/Assets/SmartButton.php +++ b/modules.local/ppcp-button/src/Assets/SmartButton.php @@ -533,7 +533,7 @@ class SmartButton implements SmartButtonInterface 'intent' => ($this->settings->has('intent')) ? $this->settings->get('intent') : 'capture', ]; - if (defined('WP_DEBUG') && \WP_DEBUG && WC()->customer) { + if (defined('WP_DEBUG') && \WP_DEBUG && WC()->customer && WC()->customer->get_billing_country()) { $params['buyer-country'] = WC()->customer->get_billing_country(); } $payee = $this->payeeRepository->payee();