WordPress at a glance
function is not described

Automattic\WooCommerce\Admin\Features

Onboarding::overwrite_square_redirect() public WC 1.0

Instead of redirecting back to the payment settings page, we will redirect back to the payments task list with our status.

{} It's a method of the class: Onboarding{}

No Hooks.

Return

String. URL of redirect.

Usage

$Onboarding = new Onboarding();
$Onboarding->overwrite_square_redirect( $location, $status );
$location(string) (required)
URL of redirect.
$status(int) (required)
HTTP response status code.

Code of Onboarding::overwrite_square_redirect() WC 5.3.0

<?php
public function overwrite_square_redirect( $location, $status ) {
	$settings_page = 'page=wc-settings&tab=square';
	if ( substr( $location, -strlen( $settings_page ) ) === $settings_page ) {
		return wc_admin_url( '&task=payments&method=square&square-connect=1' );
	}
	return $location;
}