getOrderPlace重定向网址在付款过程后不重定向



我正在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 硬编码为测试,但它似乎不起作用。

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

我已经找到了解决方案。

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

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

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

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

最新更新