I’m integrating a payment gateway using Wocoomerce. The problem I have is that the bank requires to open a pop-up to continue with the payment process.
What I want is to avoid the redirection to the “Thank You page” and keep the checkout page and open the modal there.
My current solution was to redirect to the last step of the checkout and send two parameters. The “id” of my order to identify it and the “gateway” which would be the bank I use. Then through AJAX I get the information from the backend.
This does not solve the redirection issue, but it allows me to open the pop-up.
I don’t know how to prevent the redirection from occurring since Woocommerce forces me to place the “redirect” property in the response. If I set it to false, omit it or set it to null it gives me an error.
I would like to know what Woocommerce hook I can use to avoid this redirection when pressing the pay button.
I tried removing the redirect property and using Woocommerce events from the front. I finally came up with this idea of sending the data via AJAX and watching for the change in the URL.
What I need to know is what hook I can use to disable this redirection.