当前位置: 首页>>代码示例>>PHP>>正文


PHP Mage_Sales_Model_Order_Payment::setIsTransactionPending方法代码示例

本文整理汇总了PHP中Mage_Sales_Model_Order_Payment::setIsTransactionPending方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Sales_Model_Order_Payment::setIsTransactionPending方法的具体用法?PHP Mage_Sales_Model_Order_Payment::setIsTransactionPending怎么用?PHP Mage_Sales_Model_Order_Payment::setIsTransactionPending使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Mage_Sales_Model_Order_Payment的用法示例。


在下文中一共展示了Mage_Sales_Model_Order_Payment::setIsTransactionPending方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: processResponseToRedirect

 /**
  *
  * @param Allopass_Hipay_Model_Api_Response_Gateway $gatewayResponse
  * @param Mage_Sales_Model_Order_Payment $payment
  * @param float $amount
  */
 public function processResponseToRedirect($gatewayResponse, $payment, $amount)
 {
     $order = $payment->getOrder();
     $customer = Mage::getModel('customer/customer')->load($order->getCustomerId());
     switch ($this->getConfigPaymentAction()) {
         case Mage_Payment_Model_Method_Abstract::ACTION_AUTHORIZE:
             $requestType = self::OPERATION_AUTHORIZATION;
             $newTransactionType = Mage_Sales_Model_Order_Payment_Transaction::TYPE_AUTH;
             $defaultExceptionMessage = Mage::helper('hipay')->__('Payment authorization error.');
             break;
         case Mage_Payment_Model_Method_Abstract::ACTION_AUTHORIZE_CAPTURE:
             $requestType = self::OPERATION_SALE;
             $newTransactionType = Mage_Sales_Model_Order_Payment_Transaction::TYPE_CAPTURE;
             $defaultExceptionMessage = Mage::helper('hipay')->__('Payment capturing error.');
             break;
     }
     $urlAdmin = Mage::getUrl('adminhtml/sales_order/index');
     if (Mage::getSingleton('admin/session')->isAllowed('sales/order/actions/view')) {
         $urlAdmin = Mage::getUrl('adminhtml/sales_order/view', array('order_id' => $order->getId()));
     }
     switch ($gatewayResponse->getState()) {
         case self::STATE_COMPLETED:
             return $this->isAdmin() ? $urlAdmin : Mage::getUrl('checkout/onepage/success');
         case self::STATE_FORWARDING:
             $payment->setIsTransactionPending(1);
             $order->save();
             return $gatewayResponse->getForwardUrl();
         case self::STATE_PENDING:
             if ($this->getConfigData('re_add_to_cart')) {
                 $this->getHelper()->reAddToCart($order->getIncrementId());
             }
             return $this->isAdmin() ? $urlAdmin : Mage::getUrl($this->getConfigData('pending_redirect_page'));
         case self::STATE_DECLINED:
             if ($this->getConfigData('re_add_to_cart')) {
                 $this->getHelper()->reAddToCart($order->getIncrementId());
             }
             return $this->isAdmin() ? $urlAdmin : Mage::getUrl('checkout/onepage/failure');
         case self::STATE_ERROR:
         default:
             if ($this->getConfigData('re_add_to_cart')) {
                 $this->getHelper()->reAddToCart($order->getIncrementId());
             }
             $this->_getCheckout()->setErrorMessage($defaultExceptionMessage);
             return $this->isAdmin() ? $urlAdmin : Mage::getUrl('checkout/onepage/failure');
     }
 }
开发者ID:hipay,项目名称:hipay-fullservice-sdk-magento1,代码行数:52,代码来源:Abstract.php


注:本文中的Mage_Sales_Model_Order_Payment::setIsTransactionPending方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。