dozoqn3347 2014-02-25 10:11
浏览 44
已采纳

getOrderPlaceRedirectUrl在付款过程后没有重定向

I'm implementing a payment method in Magento and at the end of my payment process, I've included the getOrderPlaceRedirectUrl method.

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();
}

The URL is set via a session upon a successful return of data from the payment service provider. I'm not calling this method anywhere, it's being called automatically as per the normal payment procedure.

The log displays the correct URL Returning Redirect URL:: /payment/index/redirect but then the process ends here without further redirection.

I've tried hardcoding the URL as a test, but it doesn't appear to work.

I'm not getting any errors or exceptions, just no redirect.

  • 写回答

1条回答 默认 最新

  • drvc63490 2014-02-27 09:24
    关注

    I've found the solution.

    During this process I link off to a number of different custom classes; to handle the reporting of responses and building of the initial payment object to be sent to the payment gateway.

    In a couple of these methods I found I was printing/logging some variables. Removing these fixed my issue!

    It seems that printing/logging in this way can interrupt the process of redirection.

    Normally this would tell me that the "headers have already been sent", but there was no error reporting at all, so it was difficult to debug.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 ue5运行的通道视频都会有白色锯齿
  • ¥20 用雷电模拟器安装百达屋apk一直闪退
  • ¥15 算能科技20240506咨询(拒绝大模型回答)
  • ¥15 自适应 AR 模型 参数估计Matlab程序
  • ¥100 角动量包络面如何用MATLAB绘制
  • ¥15 merge函数占用内存过大
  • ¥15 Revit2020下载问题
  • ¥15 使用EMD去噪处理RML2016数据集时候的原理
  • ¥15 神经网络预测均方误差很小 但是图像上看着差别太大
  • ¥15 单片机无法进入HAL_TIM_PWM_PulseFinishedCallback回调函数