Mage_Payment_Model_Info Class Reference

Inheritance diagram for Mage_Payment_Model_Info:

Mage_Core_Model_Abstract Varien_Object Mage_Sales_Model_Order_Payment Mage_Sales_Model_Quote_Payment

List of all members.

Public Member Functions

 getData ($key='', $index=null)
 getMethodInstance ()
 encrypt ($data)
 decrypt ($data)


Detailed Description

Definition at line 34 of file Info.php.


Member Function Documentation

decrypt ( data  ) 

Decrypt data

Parameters:
string $data
Returns:
string

Definition at line 99 of file Info.php.

00100     {
00101         if ($data) {
00102             return Mage::helper('core')->decrypt($data);
00103         }
00104         return $data;
00105     }

encrypt ( data  ) 

Encrypt data

Parameters:
string $data
Returns:
string

Definition at line 85 of file Info.php.

00086     {
00087         if ($data) {
00088             return Mage::helper('core')->encrypt($data);
00089         }
00090         return $data;
00091     }

getData ( key = '',
index = null 
)

Retrieve data

Parameters:
string $key
mixed $index
Returns:
unknown

Reimplemented from Varien_Object.

Definition at line 43 of file Info.php.

00044     {
00045         if ('cc_number'===$key) {
00046             if (empty($this->_data['cc_number']) && !empty($this->_data['cc_number_enc'])) {
00047                 $this->_data['cc_number'] = $this->decrypt($this->getCcNumberEnc());
00048             }
00049         }
00050         if ('cc_cid'===$key) {
00051             if (empty($this->_data['cc_cid']) && !empty($this->_data['cc_cid_enc'])) {
00052                 $this->_data['cc_cid'] = $this->decrypt($this->getCcCidEnc());
00053             }
00054         }
00055         return parent::getData($key, $index);
00056     }

getMethodInstance (  ) 

Retrieve payment method model object

Returns:
Mage_Payment_Model_Method_Abstract

Definition at line 63 of file Info.php.

00064     {
00065         if (!$this->hasMethodInstance()) {
00066             if ($method = $this->getMethod()) {
00067                 if ($instance = Mage::helper('payment')->getMethodInstance($this->getMethod())) {
00068                     $instance->setInfoInstance($this);
00069                     $this->setMethodInstance($instance);
00070                     return $instance;
00071                 }
00072             }
00073         } else {
00074             return $this->_getData('method_instance');
00075         }
00076         Mage::throwException(Mage::helper('payment')->__('Can not retrieve payment method instance'));
00077     }


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

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