dongqing8765 2016-07-15 03:34
浏览 160

如何从woocommerce自定义支付网关中的process_payment函数执行POST重定向?

I wish to do a redirect from the process_payment in my custom payment gateway for Wordpress/Woocommerce.

To do a GET redirect you would do:

function process_payment( $order_id ) {
    //some code here
    //CPN is a value entered by user from custom payment field
    $cpn = $_POST['cpn'];

    return array(
        'result'   => 'success',
        'redirect' => 'https://www.sandbox.bankserver.com/cgi-bin/webscr?test_ipn=1&CPN='. $cpn
    );
}

The values received from the user in custom payment fields are security sensitive so the bank does not want to receive them via GET. How can I do a POST?

I will POST to the bank URI...which will allow the user to enter CVV on the bank page and then redirect back to my Wordpress site.

  • 写回答

1条回答 默认 最新

  • dongying6896 2016-07-16 05:58
    关注

    In short, I found a better way to do this. I did the request to the 3d secure server and stored the details in the SESSION. I could then access these from the woocommerce_receipt_ page which I then created a form on and POSTED to the bank URI.

    评论

报告相同问题?

悬赏问题

  • ¥15 如何获取烟草零售终端数据
  • ¥15 数学建模招标中位数问题
  • ¥15 phython路径名过长报错 不知道什么问题
  • ¥15 深度学习中模型转换该怎么实现
  • ¥15 HLs设计手写数字识别程序编译通不过
  • ¥15 Stata外部命令安装问题求帮助!
  • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
  • ¥15 TYPCE母转母,插入认方向
  • ¥15 如何用python向钉钉机器人发送可以放大的图片?
  • ¥15 matlab(相关搜索:紧聚焦)