Automattic\WooCommerce\Admin\Features\PaymentGatewaySuggestions

PaymentGatewaysController::possibly_do_connection_return_action()public staticWC 1.0

Call an action after a gating has been successfully returned.

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

Return

null. Nothing.

Usage

$result = PaymentGatewaysController::possibly_do_connection_return_action();

Code of PaymentGatewaysController::possibly_do_connection_return_action() WC 6.6.1

public static function possibly_do_connection_return_action() {
	if (
		! isset( $_GET['page'] ) ||
		'wc-admin' !== $_GET['page'] ||
		! isset( $_GET['task'] ) ||
		'payments' !== $_GET['task'] ||
		! isset( $_GET['connection-return'] ) ||
		! isset( $_GET['_wpnonce'] ) ||
		! wp_verify_nonce( wc_clean( wp_unslash( $_GET['_wpnonce'] ) ), 'connection-return' )
	) {
		return;
	}

	$gateway_id = sanitize_text_field( wp_unslash( $_GET['connection-return'] ) );

	do_action( 'woocommerce_admin_payment_gateway_connection_return', $gateway_id );
}