Mage_Sales_Model_Quote_Payment Class Reference

Inheritance diagram for Mage_Sales_Model_Quote_Payment:

Mage_Payment_Model_Info Mage_Core_Model_Abstract Varien_Object

List of all members.

Public Member Functions

 setQuote (Mage_Sales_Model_Quote $quote)
 getQuote ()
 importData (array $data)
 getCheckoutRedirectUrl ()
 getOrderPlaceRedirectUrl ()

Protected Member Functions

 _construct ()
 _beforeSave ()

Protected Attributes

 $_eventPrefix = 'sales_quote_payment'
 $_eventObject = 'payment'
 $_quote


Detailed Description

Quote payment information

Definition at line 30 of file Payment.php.


Member Function Documentation

_beforeSave (  )  [protected]

Prepare object for save

Returns:
Mage_Sales_Model_Quote_Payment

Reimplemented from Mage_Core_Model_Abstract.

Definition at line 101 of file Payment.php.

00102     {
00103         try {
00104             $method = $this->getMethodInstance();
00105         } catch (Mage_Core_Exception $e) {
00106             return parent::_beforeSave();
00107         }
00108         $method->prepareSave();
00109         if ($this->getQuote()) {
00110             $this->setParentId($this->getQuote()->getId());
00111         }
00112         return parent::_beforeSave();
00113     }

_construct (  )  [protected]

Initialize resource model

Reimplemented from Varien_Object.

Definition at line 40 of file Payment.php.

00041     {
00042         $this->_init('sales/quote_payment');
00043     }

getCheckoutRedirectUrl (  ) 

Definition at line 115 of file Payment.php.

00116     {
00117         $method = $this->getMethodInstance();
00118 
00119         return $method ? $method->getCheckoutRedirectUrl() : false;
00120     }

getOrderPlaceRedirectUrl (  ) 

Definition at line 122 of file Payment.php.

00123     {
00124         $method = $this->getMethodInstance();
00125 
00126         return $method ? $method->getOrderPlaceRedirectUrl() : false;
00127     }

getQuote (  ) 

Retrieve quote model instance

Returns:
Mage_Sales_Model_Quote

Definition at line 63 of file Payment.php.

00064     {
00065         return $this->_quote;
00066     }

importData ( array data  ) 

Import data

Parameters:
array $data
Returns:
Mage_Sales_Model_Quote_Payment

Definition at line 74 of file Payment.php.

00075     {
00076         $data = new Varien_Object($data);
00077         Mage::dispatchEvent(
00078             $this->_eventPrefix . '_import_data_before',
00079             array(
00080                 $this->_eventObject=>$this,
00081                 'input'=>$data,
00082             )
00083         );
00084 
00085         $this->setMethod($data->getMethod());
00086         $method = $this->getMethodInstance();
00087 
00088         $method->assignData($data);
00089         /*
00090         * validating the payment data
00091         */
00092         $method->validate();
00093         return $this;
00094     }

setQuote ( Mage_Sales_Model_Quote quote  ) 

Declare quote model instance

Parameters:
Mage_Sales_Model_Quote $quote
Returns:
Mage_Sales_Model_Quote_Payment

Definition at line 51 of file Payment.php.

00052     {
00053         $this->_quote = $quote;
00054         $this->setQuoteId($quote->getId());
00055         return $this;
00056     }


Member Data Documentation

$_eventObject = 'payment' [protected]

Reimplemented from Mage_Core_Model_Abstract.

Definition at line 33 of file Payment.php.

$_eventPrefix = 'sales_quote_payment' [protected]

Reimplemented from Mage_Core_Model_Abstract.

Definition at line 32 of file Payment.php.

$_quote [protected]

Definition at line 35 of file Payment.php.


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

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