Automattic\WooCommerce\Admin\Features\PaymentGatewaySuggestions

DefaultPaymentGateways::get_rules_for_wcpay_activated()public staticWC 1.0

Get default rules for the WooPayments plugin being installed and activated.

Method of the class: DefaultPaymentGateways{}

No Hooks.

Return

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() code WC 9.7.1

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 ),
	);
}