WC_Gateway_Paypal::is_valid_for_use
Check if this gateway is available in the user's country based on currency.
Method of the class: WC_Gateway_Paypal{}
Hooks from the method
Returns
true|false.
Usage
$WC_Gateway_Paypal = new WC_Gateway_Paypal(); $WC_Gateway_Paypal->is_valid_for_use();
WC_Gateway_Paypal::is_valid_for_use() WC Gateway Paypal::is valid for use code WC 10.7.0
public function is_valid_for_use() {
if ( $this->should_use_orders_v2() ) {
$valid_currencies = PayPalConstants::SUPPORTED_CURRENCIES;
} else {
$valid_currencies = array( 'AUD', 'BRL', 'CAD', 'MXN', 'NZD', 'HKD', 'SGD', 'USD', 'EUR', 'JPY', 'TRY', 'NOK', 'CZK', 'DKK', 'HUF', 'ILS', 'MYR', 'PHP', 'PLN', 'SEK', 'CHF', 'TWD', 'THB', 'GBP', 'RMB', 'RUB', 'INR' );
}
return in_array(
get_woocommerce_currency(),
apply_filters(
'woocommerce_paypal_supported_currencies',
$valid_currencies
),
true
);
}