Woocommerce: Restrict payment gateway redirection for custom payment method and create popup modal at checkout to process payment

409 views Asked by At

I just started my career as a web developer and started learning wordpress and woocommerce development. I have created different payment methods with payment gateway configuration. Whenever customer hit the place order button by selecting specific payment method at checkout, after order creation I need to submit the order data to the 3rd party API end point and get back with the response data to open a popup modal without redirecting to the payment gateway and stay in the checkout page. The pop up will have buttons to handle the payment redirection or terminate the payment process. The popup script should be able to use the order data as well the API responded data.

I referred the woocommerce official documentation https://woocommerce.com/document/payment-gateway-api/. But I couldn't be able to get the exact solution.

Also checked various woocommerce hooks to achieve, restrict payment gateway redirection and stay in the checkout page when customer select that specific payment method.

I also referred https://stackoverflow.com/a/55436084. but not sure how to stay in the checkout by having popup modal opened and importantly not get redirected to the payment gateway which is done by woocommerce by default.

Here https://stackoverflow.com/a/64277593 they added a popup to place order. But I need to open popup after order placed and open popup modal by having order data and Above mentioned api responded data to process the payment

All I need to know is, Is there any standardised woocommerce way to achieve to restrict payment gate way redirection and open a pop up modal by staying at the checkout page?

Sorry for the long description.

1

There are 1 answers

0
J. Breneman On

I am not sure who your hosting provider is, but help articles within codex.wordpress.org and woocommerce may not net the results you seek. This link should help you out greatly:

GoDaddy Help for Payment Method Gateways supported by WooCommerce