【问题标题】:getOrderPlaceRedirectUrl not redirecting after payment process付款过程后getOrderPlaceRedirectUrl不重定向
【发布时间】:2014-03-27 11:32:17
【问题描述】:

我正在 Magento 中实现一种付款方式,在我的付款流程结束时,我已经包含了 getOrderPlaceRedirectUrl 方法。

public function authorize(Varien_Object $payment, $amount) {
    if ($amount <= 0) {
        Mage::throwException(Mage::helper('paygate')->__('Invalid amount for authorization.'));
    }
    $this->_auth_credentials[0] = Mage::getStoreConfig($this->_formDataInfo . 'username');
    $this->_auth_credentials[1] = Mage::getStoreConfig($this->_formDataInfo . 'vpnpwd');
    //The following _place method builds a request and returns the response from the payment gateway
    $this->_place($payment, $amount, $this->_auth_credentials);

    return $this;
}

public function getOrderPlaceRedirectUrl() {
    Mage::Log('Returning Redirect URL:: ' . Mage::getSingleton('customer/session')->getLocalRedirect());
    return Mage::getSingleton('customer/session')->getLocalRedirect();
}

URL 是在支付服务提供商成功返回数据后通过会话设置的。我没有在任何地方调用这个方法,它是按照正常的支付程序自动调用的。

日志显示正确的 URL Returning Redirect URL:: /payment/index/redirect,但随后流程在此处结束,无需进一步重定向。

我已尝试将 URL 硬编码为测试,但它似乎不起作用。

我没有收到任何错误或异常,只是没有重定向。

【问题讨论】:

    标签: php magento redirect payment-gateway


    【解决方案1】:

    我找到了解决办法。

    在此过程中,我链接到许多不同的自定义类;处理响应报告和构建要发送到支付网关的初始支付对象。

    在其中几种方法中,我发现我正在打印/记录一些变量。删除这些解决了我的问题!

    似乎以这种方式打印/记录可以中断重定向过程。

    通常这会告诉我“标头已发送”,但根本没有错误报告,因此很难调试。

    【讨论】:

      猜你喜欢
      • 2013-05-26
      • 1970-01-01
      • 2019-02-22
      • 2013-07-02
      • 2012-03-12
      • 2013-07-13
      • 2014-11-07
      • 1970-01-01
      • 2018-11-29
      相关资源
      最近更新 更多