Automattic\WooCommerce\Admin\Features\PaymentGatewaySuggestions
DefaultPaymentGateways::get_rules_for_wcpay_activated
Get default rules for the WooPayments plugin being installed and activated.
Method of the class: DefaultPaymentGateways{}
No Hooks.
Returns
Object. Rules to match.
Usage
$result = DefaultPaymentGateways::get_rules_for_wcpay_activated( $should_be );
- $should_be(true|false) (required)
- Whether WooPayments should be activated.
DefaultPaymentGateways::get_rules_for_wcpay_activated() DefaultPaymentGateways::get rules for wcpay activated code WC 10.7.0
public static function get_rules_for_wcpay_activated( $should_be ) {
$active_rule = (object) array(
'type' => 'plugins_activated',
'plugins' => array( 'woocommerce-payments' ),
);
if ( $should_be ) {
return $active_rule;
}
return (object) array(
'type' => 'not',
'operand' => array( $active_rule ),
);
}