Merge pull request #943 from woocommerce/PCP-942-payment-source-cannot-be-used-error-for-pay-upon-invoice-when-ship-to-a-different-address-country-different-then-germany

`PAYMENT_SOURCE_CANNOT_BE_USED` error for pay upon invoice when ship to a different address country different then Germany (942)
This commit is contained in:
Emili Castells 2022-11-02 17:04:57 +01:00 committed by GitHub
commit 902e92c685
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -60,6 +60,12 @@ class PayUponInvoiceHelper {
return false;
}
// phpcs:ignore WordPress.Security.NonceVerification.Missing
$shipping_country = wc_clean( wp_unslash( $_POST['s_country'] ?? '' ) );
if ( $shipping_country && 'DE' !== $shipping_country ) {
return false;
}
if ( ! $this->is_valid_currency() ) {
return false;
}