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.

Method of the class: PaymentGatewaysController{}

Return

null. Nothing (null).

Usage

$result = PaymentGatewaysController::possibly_do_connection_return_action();

PaymentGatewaysController::possibly_do_connection_return_action() code WC 8.7.0

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 );
}