Disable Pay Upon Invoice if billing/shipping country not set

This commit is contained in:
George Burduli 2024-05-29 17:44:28 +04:00
parent a0d0375ec0
commit b1bfa2940b
No known key found for this signature in database
GPG key ID: 572A97DFDA3D2E5C

View file

@ -57,13 +57,13 @@ class PayUponInvoiceHelper {
// phpcs:ignore WordPress.Security.NonceVerification.Missing
$billing_country = wc_clean( wp_unslash( $_POST['country'] ?? '' ) );
if ( $billing_country && 'DE' !== $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 ) {
if ( empty( $shipping_country ) || 'DE' !== $shipping_country ) {
return false;
}