WC_Tracker::get_active_payment_gateways()
Get a list of all active payment gateways.
Метод класса: WC_Tracker{}
Хуков нет.
Возвращает
Массив
.
Использование
$result = WC_Tracker::get_active_payment_gateways();
Код 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; }