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


PHP Mage_Payment_Model_Method_Abstract类代码示例

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

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

示例1: _getMethodConfigData

 /**
  * Return system config value by key for specified payment method
  *
  * @param string $key
  * @param Mage_Payment_Model_Method_Abstract $method
  * @param int $storeId
  *
  * @return string
  */
 protected function _getMethodConfigData($key, Mage_Payment_Model_Method_Abstract $method, $storeId = null)
 {
     if (!$method->getCode()) {
         return null;
     }
     return Mage::getStoreConfig("payment/{$method->getCode()}/{$key}", $storeId);
 }
开发者ID:evinw,项目名称:project_bloom_magento,代码行数:16,代码来源:Observer.php


示例2: getPaymentMethodInstance

 /**
  * Retreive payment method instance
  *
  * @return Mage_Payment_Model_Method_Abstract
  */
 public function getPaymentMethodInstance()
 {
     if (is_null($this->_paymentMethodInstance)) {
         $this->_paymentMethodInstance = Mage::helper('payment')->getMethodInstance($this->getMethodCode());
     }
     $this->_paymentMethodInstance->setStore($this->getStoreId());
     return $this->_paymentMethodInstance;
 }
开发者ID:jpbender,项目名称:mage_virtual,代码行数:13,代码来源:AgreementAbstract.php


示例3: getPaymentMethodInstance

 /**
  * Retreive payment method instance
  *
  * @return Mage_Payment_Model_Method_Abstract
  */
 public function getPaymentMethodInstance()
 {
     if (is_null($this->_paymentMethodInstance)) {
         $this->_paymentMethodInstance = Mage::helper('Mage_Payment_Helper_Data')->getMethodInstance($this->getMethodCode());
     }
     if ($this->_paymentMethodInstance) {
         $this->_paymentMethodInstance->setStore($this->getStoreId());
     }
     return $this->_paymentMethodInstance;
 }
开发者ID:natxetee,项目名称:magento2,代码行数:15,代码来源:AgreementAbstract.php


示例4: isAvailable

 /**
  * Check whether payment method can be used
  *
  * @param Mage_Sales_Model_Quote $quote
  * @return bool
  */
 public function isAvailable($quote = null)
 {
     if (!(Mage_Payment_Model_Method_Abstract::isAvailable($quote) && $this->_pro->getConfig()->isMethodAvailable())) {
         return false;
     }
     return $this->_commonMethod->isAvailable($quote);
 }
开发者ID:xiaoguizhidao,项目名称:bb,代码行数:13,代码来源:Direct.php


示例5: getConfigPaymentAction

 /**
  * Get config peyment action
  *
  * @return string
  */
 public function getConfigPaymentAction()
 {
     if ('pending' == $this->getConfigData('order_status')) {
         return Mage_Payment_Model_Method_Abstract::ACTION_AUTHORIZE;
     }
     return parent::getConfigPaymentAction();
 }
开发者ID:evinw,项目名称:project_bloom_magento,代码行数:12,代码来源:Free.php


示例6: getMethodInstance

 /**
  * Return payment method instance
  *
  * @return Mage_Payment_Model_Method_Abstract
  */
 protected function getMethodInstance()
 {
     if (!$this->_methodInstance) {
         $this->setMethodInstance(Mage::helper('payment')->getMethodInstance($this->getMethodCode()));
     }
     $this->_methodInstance->setStore($this->getStoreId());
     return $this->_methodInstance;
 }
开发者ID:blazeriaz,项目名称:youguess,代码行数:13,代码来源:Profile.php


示例7: isAvailable

 /**
  * Check whether payment method can be used
  *
  * @param Mage_Sales_Model_Quote $quote
  * @return bool
  */
 public function isAvailable($quote = null)
 {
     $storeId = Mage::app()->getStore($this->getStore())->getId();
     $config = Mage::getModel('paypal/config')->setStoreId($storeId);
     if (!(Mage_Payment_Model_Method_Abstract::isAvailable($quote) && $config->isMethodAvailable($this->getCode()))) {
         return false;
     }
     return $this->_commonMethod->isAvailable($quote);
 }
开发者ID:xiaoguizhidao,项目名称:bb,代码行数:15,代码来源:Payflow.php


示例8: validate

 /**
  * Validate data before save
  *
  * @return Mage_Payment_Model_Billing_Agreement
  */
 public function validate()
 {
     if (is_null($this->_paymentMethodInstance) || !$this->_paymentMethodInstance->getCode() || !$this->getCustomerId() || !$this->getReferenceId() || !$this->getStatus()) {
         throw new Mage_Core_Exception('Not enough data to save billing agreement instance.');
     }
     return $this;
 }
开发者ID:codercv,项目名称:urbansurprisedev,代码行数:12,代码来源:Agreement.php


示例9: isAvailable

 public function isAvailable($quote = null)
 {
     if (!Mage::helper('magenotification')->checkLicenseKey('Giftvoucher')) {
         return false;
     }
     return parent::isAvailable($quote);
 }
开发者ID:CherylMuniz,项目名称:fashion,代码行数:7,代码来源:Giftvoucher.php


示例10: isAvailable

 public function isAvailable($quote = null)
 {
     $showBase = parent::isAvailable($quote);
     $configuredMethod = Mage::getStoreConfig('payment/payonpickup/shippingmethod_method');
     return $showBase && $quote && $configuredMethod && $quote->getShippingAddress() && $quote->getShippingAddress()->getShippingMethod() && $quote->getShippingAddress()->getShippingMethod() == $configuredMethod;
     // Check if the specified method is available
 }
开发者ID:RapidCommerceBV,项目名称:MagentoStorePickup,代码行数:7,代码来源:Payonpickup.php


示例11: assignData

 public function assignData($data)
 {
     $logger = Mage::helper('worldpay/logger');
     parent::assignData($data);
     $session = Mage::getSingleton('core/session');
     $session->setData('payment_token', $data->token);
     $session->setData('saved_card', false);
     $persistent = Mage::getStoreConfig('payment/worldpay_cc/card_on_file', Mage::app()->getStore()->getStoreId());
     // If token is persistent save in db
     if ($persistent && (Mage::getSingleton('customer/session')->isLoggedIn() || Mage::app()->getStore()->isAdmin())) {
         if (Mage::app()->getStore()->isAdmin()) {
             $customerData = Mage::getSingleton('adminhtml/session_quote')->getCustomer();
         } else {
             $customerData = Mage::getSingleton('customer/session')->getCustomer();
         }
         if ($data->token) {
             if ($data->savecard) {
                 $token_exists = Mage::getModel('worldpay/payment')->getCollection()->addFieldToFilter('customer_id', $customerData->getId())->addFieldToFilter('token', $data->token)->getFirstItem();
                 if (empty($token_exists['token'])) {
                     $data = array('token' => $data->token, 'customer_id' => $customerData->getId());
                     $collection = Mage::getModel('worldpay/payment')->setData($data)->save();
                 }
             }
         } else {
             if ($data->savedcard) {
                 // Customer has chosen a saved card
                 $session->setData('payment_token', $data->savedcard);
                 $session->setData('saved_card', true);
             }
         }
     }
     return $this;
 }
开发者ID:jozefjgm,项目名称:worldpay-magento,代码行数:33,代码来源:Abstract.php


示例12: __construct

 public function __construct()
 {
     if ($this->isWeixinBrowser()) {
         $this->_canUseCheckout = false;
     }
     parent::__construct();
 }
开发者ID:guohuadeng,项目名称:stampApp,代码行数:7,代码来源:Payment.php


示例13: __construct

 public function __construct()
 {
     parent::__construct();
     if ($this->pm_id) {
         $this->_code = $this->_code . '_' . str_replace('_', '', $this->pm_id);
     }
 }
开发者ID:payssion,项目名称:plugin_magento,代码行数:7,代码来源:Payssion.php


示例14: validate

 public function validate()
 {
     $errorMsg = '';
     parent::validate();
     $info = $this->getInfoInstance();
     if (!$info->getBankDate()) {
         $errorCode = 'invalid_data';
         $errorMsg = $this->_getHelper()->__("Date is a required field.\n");
     }
     if (!$info->getUserName()) {
         $errorCode = 'invalid_data';
         $errorMsg .= $this->_getHelper()->__('Name is a required field.');
     }
     if (!$info->getBankName()) {
         $errorCode = 'invalid_data';
         $errorMsg .= $this->_getHelper()->__('Bank Name is a required field.');
     }
     if (!$info->getDepositNumber()) {
         $errorCode = 'invalid_data';
         $errorMsg .= $this->_getHelper()->__('Deposit Number is a required field.');
     }
     if ($errorMsg) {
         Mage::throwException($errorMsg);
     }
     return $this;
 }
开发者ID:sajalsoni,项目名称:Btransfer,代码行数:26,代码来源:Paymentmethod.php


示例15: isAvailable

 public function isAvailable($quote = null)
 {
     $result = $this->isBillMemberAvailable();
     if ($result === true) {
         return parent::isAvailable();
     }
     return false;
 }
开发者ID:ankita-parashar,项目名称:magento,代码行数:8,代码来源:ICC_BillMember_Model_BillMember.php



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