• Resolved pollame78

    (@pollame78)


    The functionality to allow the payment method only on specific countries does not work. I select the countries where I want the payment method to be active, save. But if I try to reload the page, I get a popup asking me if I want to leave the page. At that point, if you update it anyway, the changes are not saved. I also tried a clean install.


    https://paste.pics/R8GWW

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Shameem R. a11n

    (@shameemreza)

    Hi @pollame78

    It doesn’t look like a default feature in either WooPayments or WooCommerce core. Could you tell me which plugin you’re using to restrict it by country? Also, are you using WooPayments for this instance?

    For better assistance, can you provide a video showing the issue on your end? For video, you may use https://loom.com or https://www.awesomescreenshot.com/. Please follow the instructions on that page and then paste the URL into this thread.

    Looking forward to hearing from you soon.

    Plugin Support Shameem R. a11n

    (@shameemreza)

    Hi @pollame78

    I’m marking this topic as “resolved” due to recent inactivity. If more assistance is needed, feel free to post back here or open a new topic.

    Thanks!

    Thread Starter pollame78

    (@pollame78)

    I am using the approach present below to enable the gateway only in certain countries. However, express gateways, such as Apple Pay and Google Pay, are still shown. Can you tell me the exact names of the gateway? Thank you.

    add_filter( 'woocommerce_available_payment_gateways', 'filter_payment_methods' );

    function filter_payment_methods( $gateways ) {
    $eu_countries = array(
    'AT', 'BE', 'BG', 'HR', 'CY', 'CZ', 'DK', 'EE', 'FI', 'FR', 'DE', 'GR', 'HU', 'IE',
    'IT', 'LV', 'LT', 'LU', 'MT', 'NL', 'PL', 'PT', 'RO', 'SK', 'SI', 'ES', 'SE', 'GB'
    );

    if ( WC()->customer ) {
    $billing_country = WC()->customer->get_billing_country();
    if ( $billing_country && ! in_array( $billing_country, $eu_countries ) ) {
    unset( $gateways['woocommerce_payments'] );
    }
    }

    return $gateways;
    }
    Plugin Support Shameem R. a11n

    (@shameemreza)

    Hi @pollame78

    For reference, this particular forum is meant for general support with the core functionality of WooPayments itself. For development and custom coding questions, it’s best to ask for insight related to those on either the WooCommerce Advanced Facebook group or the WooCommerce Community Slack. Many of our developers hang out there and will be able to offer insights into your question. You can also seek help from the following:

    I wish I could help more, but hopefully, this gets you going in the right direction to get some further insight/information.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Gateways for specific countries’ is closed to new replies.