make sure buyer-country is populated, when used

This commit is contained in:
David Remer 2020-08-24 09:20:20 +03:00
parent 60e7ff2b44
commit f94a95eab0

View file

@ -533,7 +533,7 @@ class SmartButton implements SmartButtonInterface
'intent' => ($this->settings->has('intent')) ? 'intent' => ($this->settings->has('intent')) ?
$this->settings->get('intent') : 'capture', $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(); $params['buyer-country'] = WC()->customer->get_billing_country();
} }
$payee = $this->payeeRepository->payee(); $payee = $this->payeeRepository->payee();