Automattic\WooCommerce\Admin\Features\OnboardingTasks\Tasks

Payments::is_woopayments_supported_country │ private │ WC 1.0

Check if the store is in a WooPayments-supported geography.

Метод класса: Payments{}

Хуков нет.

Возвращает

bool. Whether the country is supported by WooPayments.

Использование

// private - только в коде основоного (родительского) класса
$result = $this->is_woopayments_supported_country( $country_code ): bool;
$country_code(строка) (обязательный)
Country code to check. If not provided, uses store base country.

Код Payments::is_woopayments_supported_country() WC 11.3.0

private function is_woopayments_supported_country( string $country_code ): bool {
	if ( class_exists( '\WC_Payments_Utils' ) && is_callable( array( '\WC_Payments_Utils', 'supported_countries' ) ) ) {
		$supported_countries = array_keys( \WC_Payments_Utils::supported_countries() );
		return in_array( $country_code, $supported_countries, true );
	}

	// WooPayments is not installed and active, use core's list of supported countries.
	$supported_countries = DefaultPaymentGateways::get_wcpay_countries();
	return in_array( $country_code, $supported_countries, true );
}