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.

Метод класса: Payments{}

Хуков нет.

Возвращает

true|false.

Использование

// private - только в коде основоного (родительского) класса
$result = $this->has_woopayments_live_account_in_progress();

Код Payments::has_woopayments_live_account_in_progress() WC 10.9.4

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