mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 12:25:15 +08:00
Add wc payments plugin available countries
This commit is contained in:
parent
32905cbf9d
commit
a036c9956c
2 changed files with 13 additions and 1 deletions
|
@ -77,6 +77,18 @@ class DccApplies {
|
||||||
return $applies;
|
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.
|
* Returns credit cards, which can be used.
|
||||||
*
|
*
|
||||||
|
|
|
@ -358,7 +358,7 @@ return array(
|
||||||
$dcc_applies = $container->get( 'api.helpers.dccapplies' );
|
$dcc_applies = $container->get( 'api.helpers.dccapplies' );
|
||||||
assert( $dcc_applies instanceof 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' );
|
$onboarding_options_renderer = $container->get( 'onboarding.render-options' );
|
||||||
assert( $onboarding_options_renderer instanceof OnboardingOptionsRenderer );
|
assert( $onboarding_options_renderer instanceof OnboardingOptionsRenderer );
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue