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


PHP Mage_Payment_Model_Info::getQuote方法代码示例

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


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

示例1: setAliasToPayment

 /**
  * saves the alias and if given the cvc to the payment information
  *
  * @param Mage_Payment_Model_Info $payment - the payment which should be updated
  * @param array                   $aliasData - the data we will update
  * @param boolean                 $userIsRegistering - is registering method in checkout
  * @param boolean                 $paymentSave - is it necessary to save the payment afterwards
  */
 public function setAliasToPayment(Mage_Payment_Model_Info $payment, array $aliasData, $userIsRegistering = false, $paymentSave = false)
 {
     if (array_key_exists('alias', $aliasData) && 0 < strlen(trim($aliasData['alias']))) {
         $payment->setAdditionalInformation('alias', trim($aliasData['alias']));
         $payment->setAdditionalInformation('userIsRegistering', $userIsRegistering);
         if (array_key_exists('CVC', $aliasData)) {
             $payment->setAdditionalInformation('cvc', $aliasData['CVC']);
             $this->setCardHolderToAlias($payment->getQuote(), $aliasData);
         }
         $payment->setDataChanges(true);
         if ($paymentSave === true) {
             $payment->save();
         }
     } else {
         Mage::helper('ops/data')->log('did not save alias due to empty alias');
         Mage::helper('ops/data')->log($aliasData);
     }
 }
开发者ID:roshu1980,项目名称:add-computers,代码行数:26,代码来源:Alias.php

示例2: _validateCountry

 /**
  * Validate payment method is allowed for the customer's billing address country.
  * @param Mage_Payment_Model_Info $info
  * @return self
  */
 protected function _validateCountry(Mage_Payment_Model_Info $info)
 {
     /**
      * Get the order when dealing with an order payment, quote otherwise.
      * @see Mage_Payment_Model_Method_Abstract
      */
     if ($info instanceof Mage_Sales_Model_Order_Payment) {
         $billingCountry = $info->getOrder()->getBillingAddress()->getCountryId();
     } else {
         $billingCountry = $info->getQuote()->getBillingAddress()->getCountryId();
     }
     if (!$this->canUseForCountry($billingCountry)) {
         throw Mage::exception('EbayEnterprise_CreditCard', $this->_helper->__(self::METHOD_NOT_ALLOWED_FOR_COUNTRY));
     }
     return $this;
 }
开发者ID:WinstonN,项目名称:magento-retail-order-management,代码行数:21,代码来源:Ccpayment.php


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