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


PHP Mage_Sales_Model_Order_Payment::setIsTransactionClosed方法代码示例

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


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

示例1: doCancel

 /**
  * Call Cancel API, the transaction must be Authorized beforehand
  *
  * @param Mage_Sales_Model_Order_Payment $payment
  * @return Eway_Rapid31_Model_Request_Direct
  */
 public function doCancel(Mage_Sales_Model_Order_Payment $payment)
 {
     // Empty Varien_Object's data
     $this->unsetData();
     $transactionId = $payment->getLastTransId();
     $this->setTransactionId($transactionId);
     $response = $this->_doRapidAPI('CancelAuthorisation');
     if ($response->isSuccess()) {
         $payment->setTransactionId($response->getTransactionID());
         $payment->setIsTransactionClosed(1);
         return $this;
     } else {
         Mage::throwException(Mage::helper('ewayrapid')->__('An error occurred while doing the cancel. Please try again. (Error message: %s)', $response->getMessage()));
     }
 }
开发者ID:programmerrahul,项目名称:vastecom,代码行数:21,代码来源:Direct.php

示例2: setPaymentTransactionInformation

 /**
  * Set Payment Transaction Information
  *
  * @param Mage_Sales_Model_Order_Payment $payment Sales Payment Model
  * @param array $params Request params
  * @param string $action Action (accept|cancel|decline|wait|exception)
  */
 protected function setPaymentTransactionInformation(Mage_Sales_Model_Order_Payment $payment, $params, $action)
 {
     $payment->setTransactionId($params['PAYID']);
     $code = $payment->getMethodInstance()->getCode();
     $isInline = false;
     /* In authorize mode we still have no authorization transaction for CC and DirectDebit payments,
      * so capture or cancel won't work. So we need to create a new authorization transaction for them
      * when a payment was accepted by Barclaycard
      *
      * In exception-case we create the authorization-transaction too because some exception-cases can turn into accepted
      */
     if (('accept' === $action || 'exception' === $action) && in_array($code, array('ops_cc', 'ops_directDebit'))) {
         $payment->setIsTransactionClosed(false);
         $isInline = $this->isInlinePayment($payment);
         /* create authorization transaction for non-inline pms */
         if (false === $isInline || (array_key_exists('HTML_ANSWER', $params) || 0 < strlen($payment->getAdditionalInformation('HTML_ANSWER')))) {
             $payment->addTransaction("authorization", null, true, $this->__("Process outgoing transaction"));
         }
         $payment->setLastTransId($params['PAYID']);
     }
     /* Barclaycard sends parameter HTML_ANSWER to trigger 3D secure redirection */
     if (isset($params['HTML_ANSWER']) && 'ops_cc' == $code) {
         $payment->setAdditionalInformation('HTML_ANSWER', $params['HTML_ANSWER']);
         $payment->setIsTransactionPending(true);
     }
     $payment->setAdditionalInformation('paymentId', $params['PAYID']);
     $payment->setAdditionalInformation('status', $params['STATUS']);
     if (array_key_exists('ACCEPTANCE', $params) && 0 < strlen(trim($params['ACCEPTANCE']))) {
         $payment->setAdditionalInformation('acceptance', $params['ACCEPTANCE']);
     }
     if (array_key_exists('BRAND', $params) && 'ops_cc' == $code && 0 < strlen(trim($params['BRAND']))) {
         $payment->setAdditionalInformation('CC_BRAND', $params['BRAND']);
     }
     if (false === $isInline || array_key_exists('HTML_ANSWER', $params)) {
         $payment->setIsTransactionClosed(true);
     }
     $payment->setDataChanges(true);
     $payment->save();
 }
开发者ID:roshu1980,项目名称:add-computers,代码行数:46,代码来源:Payment.php

示例3: setTransaction

 /**
  * @param Mage_Sales_Model_Order_Payment $payment
  * @return bool
  */
 public function setTransaction(Mage_Sales_Model_Order_Payment $payment)
 {
     $payment->setTransactionId(Mage::getSingleton('core/session')->getTransactionId());
     $payment->setIsTransactionClosed(0);
     return $payment;
 }
开发者ID:programmerrahul,项目名称:vastecom,代码行数:10,代码来源:Transparent.php

示例4: setPaymentTransactionInformation

 /**
  * Set Payment Transaction Information
  *
  * @param Mage_Sales_Model_Order_Payment $payment Sales Payment Model
  * @param array                  $params Request params
  */
 protected function setPaymentTransactionInformation($payment, $params)
 {
     $payment->setTransactionId($params['PAYID']);
     $code = $payment->getMethodInstance()->getCode();
     if (in_array($code, array('postfinance_cc', 'postfinance_directDebit'))) {
         $payment->setIsTransactionClosed(false);
         $payment->addTransaction("authorization", null, true, $this->__("Process outgoing transaction"));
         $payment->setLastTransId($params['PAYID']);
         if (isset($params['HTML_ANSWER'])) {
             $payment->setAdditionalInformation('HTML_ANSWER', $params['HTML_ANSWER']);
         }
     }
     $payment->setAdditionalInformation('paymentId', $params['PAYID']);
     $payment->setAdditionalInformation('status', $params['STATUS']);
     $payment->setIsTransactionClosed(true);
     $payment->setDataChanges(true);
     $payment->save();
 }
开发者ID:nomade-it,项目名称:MagentoPostFinance,代码行数:24,代码来源:Payment.php


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