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

WooPaymentsService::clear_onboarding_step_blockedprivateWC 1.0

Clear the blocked status of an onboarding step.

Method of the class: WooPaymentsService{}

No Hooks.

Returns

true|false. Whether the onboarding step was cleared from blocked status. Returns false if the step was not blocked.

Usage

// private - for code of main (parent) class only
$result = $this->clear_onboarding_step_blocked( $step_id, $location ): bool;
$step_id(string) (required)
The ID of the onboarding step.
$location(string) (required)
The location for which we are onboarding. This is an ISO 3166-1 alpha-2 country code.

WooPaymentsService::clear_onboarding_step_blocked() code WC 10.7.0

private function clear_onboarding_step_blocked( string $step_id, string $location ): bool {
	if ( ! $this->is_onboarding_step_blocked( $step_id, $location ) ) {
		return false;
	}

	// Clear any error for the step.
	$this->save_nox_profile_onboarding_step_data_entry( $step_id, $location, 'error', array() );

	$statuses = (array) $this->get_nox_profile_onboarding_step_entry( $step_id, $location, 'statuses' );

	// Clear the blocked status.
	unset( $statuses[ self::ONBOARDING_STEP_STATUS_BLOCKED ] );

	// Store the updated step data.
	return $this->save_nox_profile_onboarding_step_entry( $step_id, $location, 'statuses', $statuses );
}