diff --git a/modules/ppcp-api-client/src/Helper/DccApplies.php b/modules/ppcp-api-client/src/Helper/DccApplies.php index 6d694536c..b13399423 100644 --- a/modules/ppcp-api-client/src/Helper/DccApplies.php +++ b/modules/ppcp-api-client/src/Helper/DccApplies.php @@ -77,6 +77,18 @@ class DccApplies { return $applies; } + /** + * Returns whether WooCommerce Payments plugin is available for the store country. + * + * @return bool + */ + public function for_wc_payments(): bool { + $countries = array_keys( $this->allowed_country_currency_matrix ); + array_push( $countries, 'AT', 'BE', 'HK', 'IE', 'NL', 'PL', 'PT', 'SG', 'CH' ); + + return in_array( $this->country, $countries, true ); + } + /** * Returns credit cards, which can be used. * diff --git a/modules/ppcp-wc-gateway/services.php b/modules/ppcp-wc-gateway/services.php index bae874f7e..c8d07afa9 100644 --- a/modules/ppcp-wc-gateway/services.php +++ b/modules/ppcp-wc-gateway/services.php @@ -358,7 +358,7 @@ return array( $dcc_applies = $container->get( 'api.helpers.dccapplies' ); assert( $dcc_applies instanceof DccApplies ); - $is_shop_supports_dcc = $dcc_applies->for_country_currency(); + $is_shop_supports_dcc = $dcc_applies->for_country_currency() || $dcc_applies->for_wc_payments(); $onboarding_options_renderer = $container->get( 'onboarding.render-options' ); assert( $onboarding_options_renderer instanceof OnboardingOptionsRenderer );