Class Mage_Sales_Model_Recurring_Profile

Description

Sales implementation of recurring payment profiles

Implements saving and manageing profiles

Located in /Sales/Model/Recurring/Profile.php (line 31)

Varien_Object
   |
   --Mage_Core_Model_Abstract
      |
      --Mage_Payment_Model_Recurring_Profile
         |
         --Mage_Sales_Model_Recurring_Profile
Class Constant Summary
PAYMENT_TYPE_INITIAL = 'initial'
PAYMENT_TYPE_REGULAR = 'regular'
PAYMENT_TYPE_TRIAL = 'trial'
STATE_ACTIVE = 'active'
STATE_CANCELED = 'canceled'
STATE_EXPIRED = 'expired'
STATE_PENDING = 'pending'
STATE_SUSPENDED = 'suspended'
STATE_UNKNOWN = 'unknown'
Variable Summary
array $_workflow
Method Summary
void activate ()
Mage_Sales_Model_Recurring_Profile addOrderRelation ( $orderId, int $recurringProfileId)
bool canActivate ()
bool canCancel ()
void cancel ()
void canFetchUpdate ()
bool canSuspend ()
void fetchUpdate ()
array getAllStates ([bool $withLabels = true])
array getChildOrderIds ()
string|null getFieldComment (string $field)
string|null getFieldLabel (string $field)
mixed|null getInfoValue (string $infoKey, string $infoValueKey)
string getStateLabel (string $state)
bool isValid ()
Mage_Sales_Model_Order loadByInternalReferenceId ( $internalReferenceId, string $incrementId)
mixed renderData (string $key)
void submit ()
void suspend ()
void _addAdditionalOptionToItem ( $item, array $option, Mage_Sales_Model_Order_Item $itemInfo)
bool _checkWorkflow (string $againstState, [bool $soft = true])
void _construct ()
Mage_Sales_Model_Order_Item _getInitialItem (Varien_Object $itemInfo)
Mage_Sales_Model_Order_Item _getItem (Varien_Object $itemInfo)
Mage_Sales_Model_Order_Item _getRegularItem (Varien_Object $itemInfo)
Mage_Sales_Model_Order_Item _getTrialItem (Varien_Object $itemInfo)
void _initWorkflow ()
Variables
Methods
activate (line 95)

Activate the suspended profile

  • access: public
void activate ()
addOrderRelation (line 587)

Add order relation to recurring profile

  • access: public
Mage_Sales_Model_Recurring_Profile addOrderRelation ( $orderId, int $recurringProfileId)
  • int $recurringProfileId
  • $orderId
canActivate (line 109)

Check whether the workflow allows to activate the profile

  • access: public
bool canActivate ()
canCancel (line 153)

Check whether the workflow allows to cancel the profile

  • access: public
bool canCancel ()
cancel (line 139)

Cancel active or suspended profile

  • access: public
void cancel ()
canFetchUpdate (line 176)
  • access: public
void canFetchUpdate ()
canSuspend (line 131)

Check whether the workflow allows to suspend the profile

  • access: public
bool canSuspend ()
createOrder (line 218)

Initialize new order based on profile data

Takes arbitrary number of Varien_Object instances to be treated as items for new order

  • access: public
Mage_Sales_Model_Order createOrder ()
fetchUpdate (line 158)
  • access: public
void fetchUpdate ()
getAllStates (line 428)

Getter for all available states

  • access: public
array getAllStates ([bool $withLabels = true])
  • bool $withLabels
getChildOrderIds (line 572)

Return recurring profile child orders Ids

  • access: public
array getChildOrderIds ()
getFieldComment (line 412)

Getter for sales-related field comments

  • access: public
string|null getFieldComment (string $field)
  • string $field

Redefinition of:
Mage_Payment_Model_Recurring_Profile::getFieldComment()
Getter for field comments
getFieldLabel (line 390)

Getter for sales-related field labels

  • access: public
string|null getFieldLabel (string $field)
  • string $field

Redefinition of:
Mage_Payment_Model_Recurring_Profile::getFieldLabel()
Getter for field label
getInfoValue (line 486)

Getter for additional information value It is assumed that the specified additional info is an object or associative array

  • access: public
mixed|null getInfoValue (string $infoKey, string $infoValueKey)
  • string $infoKey
  • string $infoValueKey
getStateLabel (line 449)

Get state label based on the code

  • access: public
string getStateLabel (string $state)
  • string $state
importQuote (line 324)

Import quote information to the profile

  • access: public
  • Mage_Sales_Model_Quote_ $quote
importQuoteItem (line 358)

Import quote item information to the profile

  • access: public
isValid (line 306)

Validate states

  • access: public
bool isValid ()

Redefinition of:
Mage_Payment_Model_Recurring_Profile::isValid()
Check whether the object data is valid Returns true if valid.
loadByInternalReferenceId (line 67)

Load order by system increment identifier

  • access: public
Mage_Sales_Model_Order loadByInternalReferenceId ( $internalReferenceId, string $incrementId)
  • string $incrementId
  • $internalReferenceId
renderData (line 468)

Render state as label

  • access: public
mixed renderData (string $key)
  • string $key

Redefinition of:
Mage_Payment_Model_Recurring_Profile::renderData()
Transform some specific data for output
submit (line 76)

Submit a recurring profile right after an order is placed

  • access: public
void submit ()
suspend (line 117)

Suspend active profile

  • access: public
void suspend ()
_addAdditionalOptionToItem (line 711)

Add additional options suboption into itev

  • access: protected
void _addAdditionalOptionToItem ( $item, array $option, Mage_Sales_Model_Order_Item $itemInfo)
_checkWorkflow (line 554)

Check whether profile can be changed to specified state

  • throws: Mage_Core_Exception
  • access: protected
bool _checkWorkflow (string $againstState, [bool $soft = true])
  • string $againstState
  • bool $soft
_construct (line 508)

Initialize resource model

  • access: protected
void _construct ()
_filterValues (line 518)

Automatically set "unknown" state if not defined

  • access: protected

Redefinition of:
Mage_Payment_Model_Recurring_Profile::_filterValues()
Filter self data to make sure it can be validated properly
_getInitialItem (line 673)

Create and return new order item based on profile item data and $itemInfo for initial payment

  • access: protected
Mage_Sales_Model_Order_Item _getInitialItem (Varien_Object $itemInfo)
  • Varien_Object $itemInfo
_getItem (line 599)

Create and return new order item based on profile item data and $itemInfo

  • access: protected
Mage_Sales_Model_Order_Item _getItem (Varien_Object $itemInfo)
  • Varien_Object $itemInfo
_getRegularItem (line 621)

Create and return new order item based on profile item data and $itemInfo for regular payment

  • access: protected
Mage_Sales_Model_Order_Item _getRegularItem (Varien_Object $itemInfo)
  • Varien_Object $itemInfo
_getTrialItem (line 648)

Create and return new order item based on profile item data and $itemInfo for trial payment

  • access: protected
Mage_Sales_Model_Order_Item _getTrialItem (Varien_Object $itemInfo)
  • Varien_Object $itemInfo
_initWorkflow (line 532)

Initialize the workflow reference

  • access: protected
void _initWorkflow ()

Inherited Methods

Inherited From Mage_Payment_Model_Recurring_Profile

Mage_Payment_Model_Recurring_Profile::exportScheduleInfo()
Mage_Payment_Model_Recurring_Profile::exportStartDatetime()
Mage_Payment_Model_Recurring_Profile::getAllPeriodUnits()
Mage_Payment_Model_Recurring_Profile::getFieldComment()
Mage_Payment_Model_Recurring_Profile::getFieldLabel()
Mage_Payment_Model_Recurring_Profile::getMethodInstance()
Mage_Payment_Model_Recurring_Profile::getPeriodUnitLabel()
Mage_Payment_Model_Recurring_Profile::getValidationErrors()
Mage_Payment_Model_Recurring_Profile::importBuyRequest()
Mage_Payment_Model_Recurring_Profile::importProduct()
Mage_Payment_Model_Recurring_Profile::isValid()
Mage_Payment_Model_Recurring_Profile::renderData()
Mage_Payment_Model_Recurring_Profile::setLocale()
Mage_Payment_Model_Recurring_Profile::setMethodInstance()
Mage_Payment_Model_Recurring_Profile::setNearestStartDatetime()
Mage_Payment_Model_Recurring_Profile::setStore()
Mage_Payment_Model_Recurring_Profile::_beforeSave()
Mage_Payment_Model_Recurring_Profile::_ensureLocaleAndStore()
Mage_Payment_Model_Recurring_Profile::_filterValues()
Mage_Payment_Model_Recurring_Profile::_renderSchedule()
Mage_Payment_Model_Recurring_Profile::_validateBeforeSave()
Mage_Payment_Model_Recurring_Profile::_validatePeriodFrequency()

Inherited From Mage_Core_Model_Abstract

Mage_Core_Model_Abstract::afterCommitCallback()
Mage_Core_Model_Abstract::afterLoad()
Mage_Core_Model_Abstract::cleanModelCache()
Mage_Core_Model_Abstract::clearInstance()
Mage_Core_Model_Abstract::delete()
Mage_Core_Model_Abstract::getCacheIdTags()
Mage_Core_Model_Abstract::getCacheTags()
Mage_Core_Model_Abstract::getCollection()
Mage_Core_Model_Abstract::getEntityId()
Mage_Core_Model_Abstract::getId()
Mage_Core_Model_Abstract::getIdFieldName()
Mage_Core_Model_Abstract::getResource()
Mage_Core_Model_Abstract::getResourceCollection()
Mage_Core_Model_Abstract::getResourceName()
Mage_Core_Model_Abstract::isObjectNew()
Mage_Core_Model_Abstract::load()
Mage_Core_Model_Abstract::save()
Mage_Core_Model_Abstract::setId()
Mage_Core_Model_Abstract::_afterDelete()
Mage_Core_Model_Abstract::_afterDeleteCommit()
Mage_Core_Model_Abstract::_afterLoad()
Mage_Core_Model_Abstract::_afterSave()
Mage_Core_Model_Abstract::_afterSaveCommit()
Mage_Core_Model_Abstract::_beforeDelete()
Mage_Core_Model_Abstract::_beforeLoad()
Mage_Core_Model_Abstract::_beforeSave()
Mage_Core_Model_Abstract::_clearData()
Mage_Core_Model_Abstract::_clearReferences()
Mage_Core_Model_Abstract::_getEventData()
Mage_Core_Model_Abstract::_getResource()
Mage_Core_Model_Abstract::_hasModelChanged()
Mage_Core_Model_Abstract::_init()
Mage_Core_Model_Abstract::_protectFromNonAdmin()
Mage_Core_Model_Abstract::_setResourceModel()
Class Constants
PAYMENT_TYPE_INITIAL = 'initial' (line 52)
PAYMENT_TYPE_REGULAR = 'regular' (line 50)

Payment types

PAYMENT_TYPE_TRIAL = 'trial' (line 51)
STATE_ACTIVE = 'active' (line 40)
STATE_CANCELED = 'canceled' (line 42)
STATE_EXPIRED = 'expired' (line 43)
STATE_PENDING = 'pending' (line 39)
STATE_SUSPENDED = 'suspended' (line 41)
STATE_UNKNOWN = 'unknown' (line 38)

Available states

Inherited Constants

Inherited from Mage_Payment_Model_Recurring_Profile

Mage_Payment_Model_Recurring_Profile::BUY_REQUEST_START_DATETIME
Mage_Payment_Model_Recurring_Profile::PERIOD_UNIT_DAY
Mage_Payment_Model_Recurring_Profile::PERIOD_UNIT_MONTH
Mage_Payment_Model_Recurring_Profile::PERIOD_UNIT_SEMI_MONTH
Mage_Payment_Model_Recurring_Profile::PERIOD_UNIT_WEEK
Mage_Payment_Model_Recurring_Profile::PERIOD_UNIT_YEAR
Mage_Payment_Model_Recurring_Profile::PRODUCT_OPTIONS_KEY

Documentation generated on Fri, 11 Feb 2011 17:10:31 +0200 by phpDocumentor 1.4.3