Пример #1
0
 /**
  * Check whether customer should be asked confirmation whether to sign a billing agreement
  *
  * @param Mage_Paypal_Model_Config $config
  * @param int $customerId
  * @return bool
  */
 public function shouldAskToCreateBillingAgreement(Ebcomm_PaypalMx_Model_Config $config, $customerId)
 {
     if (null === self::$_shouldAskToCreateBillingAgreement) {
         self::$_shouldAskToCreateBillingAgreement = false;
         if ($customerId && $config->shouldAskToCreateBillingAgreement()) {
             if (Mage::getModel('sales/billing_agreement')->needToCreateForCustomer($customerId)) {
                 self::$_shouldAskToCreateBillingAgreement = true;
             }
         }
     }
     return self::$_shouldAskToCreateBillingAgreement;
 }
Пример #2
0
 /**
  * Log debug data to file
  *
  * @param mixed $debugData
  */
 protected function _debug()
 {
     if ($this->_config && $this->_config->debug) {
         $file = $this->_config->getMethodCode() ? "payment_{$this->_config->getMethodCode()}.log" : self::DEFAULT_LOG_FILE;
         Mage::getModel('core/log_adapter', $file)->log($this->_debugData);
     }
 }
Пример #3
0
 /**
  * Don't show CC type for non-CC methods
  *
  * @return string|null
  */
 public function getCcTypeName()
 {
     if (Ebcomm_PaypalMx_Model_Config::getIsCreditCardMethod($this->getInfo()->getMethod())) {
         return parent::getCcTypeName();
     }
 }
Пример #4
0
 /**
  * Log debug data to file
  *
  * @param mixed $debugData
  */
 protected function _debug($debugData)
 {
     if ($this->getDebugFlag()) {
         Mage::getModel('core/log_adapter', 'payment_' . $this->_config->getMethodCode() . '.log')->setFilterDataKeys($this->_debugReplacePrivateDataKeys)->log($debugData);
     }
 }