Automattic\WooCommerce\Admin\Features\OnboardingTasks\Tasks

Payments::has_gateways()public staticWC 1.0

Check if the store has any enabled gateways.

Method of the class: Payments{}

No Hooks.

Return

true|false.

Usage

$result = Payments::has_gateways();

Payments::has_gateways() code WC 7.1.1

public static function has_gateways() {
	$gateways         = WC()->payment_gateways->get_available_payment_gateways();
	$enabled_gateways = array_filter(
		$gateways,
		function( $gateway ) {
			return 'yes' === $gateway->enabled && 'woocommerce_payments' !== $gateway->id;
		}
	);

	return ! empty( $enabled_gateways );
}