Site icon Hip-Hop Website Design and Development

WOOCOOMERCE: Run operate earlier than fee gateway (paying)

In WooCommerce I create orders and customers by code and on the ‘order-pay’ endpoint a consumer is created by kind + ajax. The ‘proceed to checkout’ button is disabled by jQuery till the consumer is created. Now I wish to create a server facet verify. So attempting to run a operate after submit however earlier than the redirect to the fee gateway.

I’ve tried these hooks however all of them do not work for me on this case (do nothing).

add_action( 'woocommerce_before_checkout_process', 'is_user_created' , 1, 1 );
add_action( 'woocommerce_new_order', 'is_user_created' , 1, 1 );
add_action( 'woocommerce_checkout_process', 'is_user_created' , 1, 1 );
add_action( 'woocommerce_checkout_order_processed', 'is_user_created' , 1, 1 );
add_action( 'woocommerce_check_cart_items', 'is_user_created' , 1, 1 );
add_action( 'woocommerce_review_order_after_submit', 'is_user_created' , 1, 1 );

The operate used to check is:

operate is_user_created( $order_id ){
    die ('No account created');
}

Any concepts?