Skip to content

Commit

Permalink
search for upe element within the dom
Browse files Browse the repository at this point in the history
  • Loading branch information
Timur Karimov authored and Timur Karimov committed Jan 11, 2025
1 parent 30dd8be commit fea511e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion client/checkout/utils/upe.js
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,9 @@ export const togglePaymentMethodForCountry = ( upeElement ) => {
const billingCountry =
billingInput?.value || window?.wcpayCustomerData?.billing_country || '';

const upeContainer = upeElement?.closest( '.wc_payment_method' );
const upeContainer = document.querySelector(
'.payment_method_woocommerce_payments_' + paymentMethodType
);
if ( supportedCountries.includes( billingCountry ) ) {
upeContainer.style.removeProperty( 'display' );
} else {
Expand Down

0 comments on commit fea511e

Please sign in to comment.