Automattic\WooCommerce\Admin\Features\OnboardingTasks\Tasks

Payments::has_woopayments_live_account_in_progressprivateWC 1.0

Check if WooPayments has a live account onboarding in progress.

Method of the class: Payments{}

No Hooks.

Returns

true|false.

Usage

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

Payments::has_woopayments_live_account_in_progress() code WC 10.3.6

private function has_woopayments_live_account_in_progress() {
	if ( $this->is_woopayments_onboarded() ) {
		return false;
	}

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

	// If we have a test account, we are not in live account onboarding.
	if ( $this->has_woopayments_test_account() ) {
		return false;
	}

	// Check the provider's state to determine if a live account onboarding is started.
	if ( ! empty( $woopayments_provider['onboarding']['state']['started'] ) ) {
		return true;
	}

	return false;
}