简体   繁体   English

Woocommerce:限制自定义支付方式的支付网关重定向,并在结账时创建弹出模式以处理支付

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

I just started my career as a web developer and started learning wordpress and woocommerce development.我刚刚开始我的职业生涯,作为 web 开发人员,开始学习 wordpress 和 woocommerce 开发。 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 .每当客户在结帐时通过选择特定的付款方式点击下订单按钮时,在创建订单后我需要将订单数据提交给第三方 API 端点并返回响应数据以打开弹出模式而不重定向到支付网关并留在结帐页面 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.弹出脚本应该能够使用订单数据以及 API 响应数据。

I referred the woocommerce official documentation https://woocommerce.com/document/payment-gateway-api/ .我参考了 woocommerce 官方文档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.还检查了各种 woocommerce 挂钩来实现,限制支付网关重定向并在客户 select 特定付款方式时停留在结帐页面。

I also referred https://stackoverflow.com/a/55436084 .我还提到了 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.但不确定如何通过打开弹出模式来留在结帐中,重要的是不会重定向到默认情况下由 woocommerce 完成的支付网关。

Here https://stackoverflow.com/a/64277593 they added a popup to place order.在这里https://stackoverflow.com/a/64277593他们添加了一个弹出窗口来下订单。 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但是我需要在下订单后打开弹出窗口,并通过订单数据和上面提到的 api 响应数据打开弹出模式来处理付款

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?我需要知道的是,是否有任何标准化的 woocommerce 方法可以通过停留在结帐页面来限制支付网关重定向并打开弹出模式?

Sorry for the long description.抱歉,描述太长了。

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.我不确定您的托管服务提供商是谁,但 codex.wordpress.org 和 woocommerce 中的帮助文章可能不会提供您寻求的结果。 This link should help you out greatly:此链接应该对您有很大帮助:

GoDaddy Help for Payment Method Gateways supported by WooCommerce WooCommerce 支持的支付方式网关的 GoDaddy 帮助

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM