Magento Paypal Payflow Link总是拒绝付款

时间:2015-01-23 22:03:33

标签: magento magento-1.8

运行Magento 1.8.0.0

当用户使用Paypal PayFlow Link结账时,它会返回一个弹出窗口:

付款遭拒。请再试一次。

查看Paypal调试日志,它会报告信用卡已获得授权。

所以我去看控制器: 应用/代码/核心/法师/贝宝/控制器/ PayflowController.php

我可以从下面的代码中看到,允许的订单状态为false,因此取消了订单。

    /**
 * When a customer return to website from payflow gateway.
 */
public function returnUrlAction()
{
    $redirectBlock = $this->_getIframeBlock()
        ->setTemplate('paypal/payflowlink/redirect.phtml');

    $session = $this->_getCheckout();
    if ($session->getLastRealOrderId()) {
        $order = Mage::getModel('sales/order')->loadByIncrementId($session->getLastRealOrderId());

        if ($order && $order->getIncrementId() == $session->getLastRealOrderId()) {
            $allowedOrderStates = array(
                Mage_Sales_Model_Order::STATE_PROCESSING,
                Mage_Sales_Model_Order::STATE_COMPLETE
            );
            if (in_array($order->getState(), $allowedOrderStates)) {
                $session->unsLastRealOrderId();
                $redirectBlock->setGotoSuccessPage(true);
            } else {
                $gotoSection = $this->_cancelPayment(strval($this->getRequest()->getParam('RESPMSG')));
                $redirectBlock->setGotoSection($gotoSection);
                $redirectBlock->setErrorMsg($this->__('Payment has been declined. Please try again.'));
            }
        }
    }

    $this->getResponse()->setBody($redirectBlock->toHtml());
}

退回的订单状态为: pending_payment

我需要帮助找出错误设置订单状态的原因。

0 个答案:

没有答案