After installing the Stripe gateway, and enabling additional payment methods such as SOFORT or iDEA, the admin section might start showing message like the following:
The store base currency should be set to <currency>
The message appear due to a premature check performed by the payment gateways, which is caused by an incorrect assumption made when the gateways were developed.
Root cause
The gateways assume that the shop can only have one currency, at any time. Due to that, they perform a check in the backend, to verify that the currency is the one that they expect. For example, Bancontact can only handle EUR, therefore it checks if shop's currency is EUR. When it finds out that it's not EUR, it assumes that "shop base currency is not EUR -> Checkout will not be in EUR -> The gateway can't work properly". This logic is incorrect, as the shop's base currency is not necessarily the one that will be used at checkout.
To remove the messages permanently, those checks should be skipped altogether in the admin section, as they are based on the incorrect assumption that WooCommerce is strictly a "single currency" ecommerce. The statement "the store base currency should be set to EUR" is incorrect as well, and it's misleading. A more correct statement would be that "gateway <gateway name> can only be used at checkout for <currency>".
Technical information
You can find the source of this issue in function get_environment_warning() in the files that implement the additional gateways provided by Stripe (e.g. class-wc-gateway-stripe-ideal.php or class-wc-gateway-stripe-sofort.php). In both cases, the gateway performs the following check while in the Admin area, where it's superfluous:
if ( 'yes' === $this->enabled && ! in_array( get_woocommerce_currency(), $this->get_supported_currency() ) ) { $message = __( 'SOFORT is enabled - it requires store currency to be set to Euros.', 'woocommerce-gateway-stripe' ); return $message; }
That check is what shows the warnings in the Admin section. It won't stop the gateway from working, it will just be a nuisance. In our opinion, based on extensive experience, that check should be removed altogether, as the gateway already disables itself at checkout when the currency is not the correct one. That's something that the Stripe plugin's developers would have to do, directly in in the Stripe plugin.
Workaround
An easy workaround to remove the messages is to "trick" the gateways into thinking that the active currency is supported, whatever it is. Here's an example of how to do that for Sofort and iDEAL, by using a filter that you can add to your functions.php file:
function custom_supported_currencies($currencies) { $currencies[] = get_woocommerce_currency(); return $currencies; } // Call the filter for each gateway, as needed. The hook name will be // wc_stripe_<gateway ID>_supported_currencies // // You can find some IDs below // - sepa // - bancontact // - sofort // - giropay // - eps // - ideal // - alipay // - p24 // - multibanco // // Examples // ID: sofort add_filter('wc_stripe_sofort_supported_currencies', 'custom_supported_currencies'); // ID: ideal add_filter('wc_stripe_ideal_supported_currencies', 'custom_supported_currencies');
Important
The above will prevent the gateways from hiding themselves if the currency at checkout is not supported. You can still hide them for unsupported currencies by going to Currency Switcher > Payment Gateways, by enabling the gateways only for the appropriate ones.
You can purchase the Currency Switcher from our online shop.