WC_Payment_Gateway::is_available
Check if the gateway is available for use.
Method of the class: WC_Payment_Gateway{}
No Hooks.
Returns
true|false.
Usage
$WC_Payment_Gateway = new WC_Payment_Gateway(); $WC_Payment_Gateway->is_available();
WC_Payment_Gateway::is_available() WC Payment Gateway::is available code WC 10.5.0
public function is_available() {
$is_available = ( 'yes' === $this->enabled );
if ( WC()->cart && 0 < $this->get_order_total() && 0 < $this->max_amount && $this->max_amount < $this->get_order_total() ) {
$is_available = false;
}
return $is_available;
}