Automattic\WooCommerce\Blocks\BlockTypes
Checkout::get_enabled_payment_gateways()
Get payment methods that are enabled in settings.
Method of the class: Checkout{}
No Hooks.
Return
Array
.
Usage
// protected - for code of main (parent) or child class $result = $this->get_enabled_payment_gateways();
Checkout::get_enabled_payment_gateways() Checkout::get enabled payment gateways code WC 9.4.2
protected function get_enabled_payment_gateways() { $payment_gateways = WC()->payment_gateways->payment_gateways(); return array_filter( $payment_gateways, function ( $payment_gateway ) { return 'yes' === $payment_gateway->enabled; } ); }