【发布时间】: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