diff --git a/modules/ppcp-wc-gateway/src/Helper/PayUponInvoiceHelper.php b/modules/ppcp-wc-gateway/src/Helper/PayUponInvoiceHelper.php index 823caf611..b91eca8a0 100644 --- a/modules/ppcp-wc-gateway/src/Helper/PayUponInvoiceHelper.php +++ b/modules/ppcp-wc-gateway/src/Helper/PayUponInvoiceHelper.php @@ -56,14 +56,14 @@ class PayUponInvoiceHelper { } // phpcs:ignore WordPress.Security.NonceVerification.Missing - $billing_country = wc_clean( wp_unslash( $_POST['country'] ?? '' ) ); - if ( $billing_country && 'DE' !== $billing_country ) { + $billing_country = WC()->customer->get_billing_country(); + if ( empty( $billing_country ) || 'DE' !== $billing_country ) { return false; } // phpcs:ignore WordPress.Security.NonceVerification.Missing - $shipping_country = wc_clean( wp_unslash( $_POST['s_country'] ?? '' ) ); - if ( $shipping_country && 'DE' !== $shipping_country ) { + $shipping_country = WC()->customer->get_shipping_country(); + if ( empty( $shipping_country ) || 'DE' !== $shipping_country ) { return false; }