[英]getOrderPlaceRedirectUrl not redirecting after payment process
我在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硬編碼為測試,但似乎無法正常工作。
我沒有收到任何錯誤或異常,只是沒有重定向。
我找到了解決方案。
在此過程中,我鏈接到許多不同的自定義類。 處理響應的報告並構建要發送到支付網關的初始支付對象。
在這些方法中,我發現我正在打印/記錄一些變量。 刪除這些問題解決了我的問題!
似乎以這種方式進行打印/記錄可能會中斷重定向過程。
通常,這將告訴我“報頭已經發送”,但是根本沒有錯誤報告,因此很難調試。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.