Automattic\WooCommerce\Admin\Features\OnboardingTasks\Tasks

Payments::is_woopayments_onboardedprivateWC 1.0

Check if WooPayments is completely onboarded.

Method of the class: Payments{}

No Hooks.

Returns

bool.

Usage

// private - for code of main (parent) class only
$result = $this->is_woopayments_onboarded(): bool;

Payments::is_woopayments_onboarded() code WC 11.0.1

private function is_woopayments_onboarded(): bool {
	if ( ! $this->is_woopayments_active() ) {
		return false;
	}

	$woopayments_provider = $this->get_woopayments_provider();
	// We should have the WooPayments provider, but if not, return false.
	if ( ! $woopayments_provider ) {
		return false;
	}

	// Check the provider's state to determine if it is onboarded.
	if ( ! empty( $woopayments_provider['onboarding']['state']['completed'] ) ) {
		return true;
	}

	return false;
}