WC_Tracker::get_active_payment_gateways()private staticWC 1.0

Get a list of all active payment gateways.

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

Хуков нет.

Возвращает

Массив.

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

$result = WC_Tracker::get_active_payment_gateways();

Код WC_Tracker::get_active_payment_gateways() WC 9.4.2

private static function get_active_payment_gateways() {
	$active_gateways = array();
	$gateways        = WC()->payment_gateways->payment_gateways();
	foreach ( $gateways as $id => $gateway ) {
		if ( isset( $gateway->enabled ) && 'yes' === $gateway->enabled ) {
			$active_gateways[ $id ] = array(
				'title'    => $gateway->title,
				'supports' => $gateway->supports,
			);
		}
	}

	return $active_gateways;
}