WC_Payment_Gateways::get_available_payment_gateways()
Get available gateways.
Метод класса: WC_Payment_Gateways{}
Хуки из метода
Возвращает
Массив
.
Использование
$WC_Payment_Gateways = new WC_Payment_Gateways(); $WC_Payment_Gateways->get_available_payment_gateways();
Код WC_Payment_Gateways::get_available_payment_gateways() WC Payment Gateways::get available payment gateways WC 9.2.3
public function get_available_payment_gateways() { $_available_gateways = array(); foreach ( $this->payment_gateways as $gateway ) { if ( $gateway->is_available() ) { if ( ! is_add_payment_method_page() ) { $_available_gateways[ $gateway->id ] = $gateway; } elseif ( $gateway->supports( 'add_payment_method' ) || $gateway->supports( 'tokenization' ) ) { $_available_gateways[ $gateway->id ] = $gateway; } } } return array_filter( (array) apply_filters( 'woocommerce_available_payment_gateways', $_available_gateways ), array( $this, 'filter_valid_gateway_class' ) ); }