Mage_Payment_Block_Form_Cc Class Reference

Inheritance diagram for Mage_Payment_Block_Form_Cc:

Mage_Payment_Block_Form Mage_Core_Block_Template Mage_Core_Block_Abstract Varien_Object Mage_Payment_Block_Form_Ccsave Mage_PaypalUk_Block_Direct_Form

List of all members.

Public Member Functions

 getCcAvailableTypes ()
 getCcMonths ()
 getCcYears ()
 hasVerification ()

Protected Member Functions

 _construct ()
 _getConfig ()


Detailed Description

Definition at line 28 of file Cc.php.


Member Function Documentation

_construct (  )  [protected]

Internal constructor, that is called from real constructor

Please override this one instead of overriding real __construct constructor

Please override this one instead of overriding real __construct constructor

Reimplemented from Mage_Core_Block_Abstract.

Reimplemented in Mage_Payment_Block_Form_Ccsave, and Mage_PaypalUk_Block_Direct_Form.

Definition at line 30 of file Cc.php.

00031     {
00032         parent::_construct();
00033         $this->setTemplate('payment/form/cc.phtml');
00034     }

_getConfig (  )  [protected]

Retrieve payment configuration object

Returns:
Mage_Payment_Model_Config

Definition at line 41 of file Cc.php.

00042     {
00043         return Mage::getSingleton('payment/config');
00044     }

getCcAvailableTypes (  ) 

Retrieve availables credit card types

Returns:
array

Reimplemented in Mage_PaypalUk_Block_Direct_Form.

Definition at line 51 of file Cc.php.

00052     {
00053         $types = $this->_getConfig()->getCcTypes();
00054         if ($method = $this->getMethod()) {
00055             $availableTypes = $method->getConfigData('cctypes');
00056             if ($availableTypes) {
00057                 $availableTypes = explode(',', $availableTypes);
00058                 foreach ($types as $code=>$name) {
00059                     if (!in_array($code, $availableTypes)) {
00060                         unset($types[$code]);
00061                     }
00062                 }
00063             }
00064         }
00065         return $types;
00066     }

getCcMonths (  ) 

Retrieve credit card expire months

Returns:
array

Definition at line 73 of file Cc.php.

00074     {
00075         $months = $this->getData('cc_months');
00076         if (is_null($months)) {
00077             $months[0] =  $this->__('Month');
00078             $months = array_merge($months, $this->_getConfig()->getMonths());
00079             $this->setData('cc_months', $months);
00080         }
00081         return $months;
00082     }

getCcYears (  ) 

Retrieve credit card expire years

Returns:
array

Definition at line 89 of file Cc.php.

00090     {
00091         $years = $this->getData('cc_years');
00092         if (is_null($years)) {
00093             $years = $this->_getConfig()->getYears();
00094             $years = array(0=>$this->__('Year'))+$years;
00095             $this->setData('cc_years', $years);
00096         }
00097         return $years;
00098     }

hasVerification (  ) 

Retrive has verification configuration

Returns:
boolean

Definition at line 105 of file Cc.php.

00106     {
00107         if ($this->getMethod()) {
00108             $configData = $this->getMethod()->getConfigData('useccv');
00109             if(is_null($configData)){
00110                 return true;
00111             }
00112             return (bool) $configData;
00113         }
00114         return true;
00115     }


The documentation for this class was generated from the following file:

Generated on Sat Jul 4 17:24:31 2009 for Magento by  doxygen 1.5.8