Automattic\WooCommerce\Internal\Admin\Settings\PaymentsProviders\WooPayments

WooPaymentsService::is_onboarding_lockedprivateWC 1.0

Check if the onboarding is locked.

Method of the class: WooPaymentsService{}

No Hooks.

Returns

true|false. Whether the onboarding is locked.

Usage

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

WooPaymentsService::is_onboarding_locked() code WC 10.8.1

private function is_onboarding_locked(): bool {
	$lock_timestamp = (int) $this->proxy->call_function(
		'absint',
		$this->proxy->call_function( 'get_option', self::NOX_ONBOARDING_LOCKED_KEY, 0 )
	);

	if ( 0 === $lock_timestamp ) {
		return false;
	}

	$now = $this->proxy->call_function( 'time' );

	// If the lock timestamp is older than the TTL, consider it unlocked and self-heal.
	if ( $lock_timestamp < ( $now - self::NOX_ONBOARDING_LOCKED_TTL_SECONDS ) ) {
		$this->clear_onboarding_lock();

		return false;
	}

	return true;
}