WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
функция не описана

Automattic\WooCommerce\Admin\Features\PaymentGatewaySuggestions

PaymentGatewaysController::handle_successfull_connection() public WC 1.0

Handle a successful gateway connection.

{} Это метод класса: PaymentGatewaysController{}

Хуков нет.

Возвращает

null. Ничего.

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

$result = PaymentGatewaysController::handle_successfull_connection( $gateway_id );
$gateway_id(строка) (обязательный)
Gateway ID.

Код PaymentGatewaysController::handle_successfull_connection() WC 5.7.1

public static function handle_successfull_connection( $gateway_id ) {
	// phpcs:disable WordPress.Security.NonceVerification
	if ( ! isset( $_GET['success'] ) || 1 !== intval( $_GET['success'] ) ) {
		return;
	}
	// phpcs:enable WordPress.Security.NonceVerification

	$payment_gateways = WC()->payment_gateways()->payment_gateways();
	$payment_gateway  = isset( $payment_gateways[ $gateway_id ] ) ? $payment_gateways[ $gateway_id ] : null;

	if ( ! $payment_gateway ) {
		return;
	}

	$payment_gateway->update_option( 'enabled', 'yes' );

	TransientNotices::add(
		array(
			'user_id' => get_current_user_id(),
			'id'      => 'payment-gateway-connection-return-' . str_replace( ',', '-', $gateway_id ),
			'status'  => 'success',
			'content' => sprintf(
				/* translators: the title of the payment gateway */
				__( '%s connected successfully', 'woocommerce' ),
				$payment_gateway->method_title
			),
		)
	);

	wc_admin_record_tracks_event(
		'tasklist_payment_connect_method',
		array(
			'payment_method' => $gateway_id,
		)
	);

	wp_safe_redirect( wc_admin_url() );
}