Class Mage_Sales_Model_Order_Payment_Transaction

Description

Payment transaction model Tracks transaction history, allows to build transactions hierarchy By default transactions are saved as closed.

Located in /Sales/Model/Order/Payment/Transaction.php (line 32)

Varien_Object
   |
   --Mage_Core_Model_Abstract
      |
      --Mage_Sales_Model_Order_Payment_Transaction
Class Constant Summary
RAW_DETAILS = 'raw_details_info'
TYPE_AUTH = 'authorization'
TYPE_CAPTURE = 'capture'
TYPE_ORDER = 'order'
TYPE_PAYMENT = 'payment'
TYPE_REFUND = 'refund'
TYPE_VOID = 'void'
Variable Summary
Method Summary
Mage_Sales_Model_Order_Payment_Transaction close ([bool $shouldSave = true])
Mage_Sales_Model_Order_Payment_Transaction|false closeAuthorization ([bool $shouldSave = true], [bool $dryRun = false])
void closeCapture ([unknown_type $shouldSave = true])
array|null|mixed getAdditionalInformation ([string $key = null])
Mage_Sales_Model_Order_Payment_Transaction|array|null getChildTransactions ([array|string $types = null], [string $txnId = null], [bool $recursive = false])
int|null getOrderId ()
bool|Mage_Sales_Model_Order_Payment_Transaction hasChildTransaction ([bool $whetherHasChild = null])
void isFailsafe ([ $setFailsafe = null], bool $failsafe)
bool isVoided ()
Mage_Sales_Model_Order_Payment_Transaction setParentTxnId (string $parentTxnId, [string $txnId = null])
void _construct ()
bool _isVoided ()
void _loadChildren ()
Mage_Sales_Model_Order_Payment|null|false _verifyPaymentObject ([bool $dryRun = false])
void _verifyTxnId (string $txnId)
void _verifyTxnType ([string $txnType = null])
Variables
array $_children = null (line 75)

Child transactions, assoc array of transaction_id => instance

  • access: protected
string $_eventObject = 'order_payment_transaction' (line 118)

Event object prefix

  • see: Mage_Core_Model_Absctract::$_eventObject
  • access: protected

Redefinition of:
Mage_Core_Model_Abstract::$_eventObject
Parameter name in event
string $_eventPrefix = 'sales_order_payment_transaction' (line 110)

Event object prefix

  • see: Mage_Core_Model_Absctract::$_eventPrefix
  • access: protected

Redefinition of:
Mage_Core_Model_Abstract::$_eventPrefix
Prefix of model events names
bool $_hasChild = null (line 102)

Whether transaction has children

  • access: protected
array $_identifiedChildren = null (line 83)

Child transactions, assoc array of txn_id => instance

Filled only in case when all child transactions have txn_id Used for quicker search of child transactions using isset() as oposite to foreaching $_children

  • access: protected
bool $_isFailsafe = false (line 96)

Whether to throw exceptions on different operations

  • access: protected
Mage_Sales_Model_Order_Payment $_order = null (line 63)

Order instance

  • access: protected
int $_orderWebsiteId = null (line 125)

Order website id

  • access: protected
Mage_Sales_Model_Order_Payment_Transaction $_parentTransaction = null (line 69)

Parent transaction instance

  • access: protected
Mage_Sales_Model_Order_Payment $_paymentObject = null (line 55)

Payment instance. Required for most transaction writing and search operations

  • access: protected
bool $_transactionsAutoLinking = true (line 89)

Whether to perform automatic actions on transactions, such as auto-closing and putting as a parent

  • access: protected

Inherited Variables

Inherited from Mage_Core_Model_Abstract

Mage_Core_Model_Abstract::$_cacheTag
Mage_Core_Model_Abstract::$_dataSaveAllowed
Mage_Core_Model_Abstract::$_isObjectNew
Mage_Core_Model_Abstract::$_resource
Mage_Core_Model_Abstract::$_resourceCollectionName
Mage_Core_Model_Abstract::$_resourceName
Methods
canVoidAuthorizationCompletely (line 355)

Check whether authorization in current hierarchy can be voided completely

Basically checks whether the authorization exists and it is not affected by a capture or void

  • access: public
bool canVoidAuthorizationCompletely ()
close (line 493)

Close this transaction

  • throws: Mage_Core_Exception
  • access: public
Mage_Sales_Model_Order_Payment_Transaction close ([bool $shouldSave = true])
  • bool $shouldSave
closeAuthorization (line 295)

Close an authorization transaction This method can be invoked from any child transaction of the transaction to be closed Returns the authorization transaction on success. Otherwise false.

$dryRun = true prevents actual closing, it just allows to check whether this operation is possible

  • throws: Exception
  • access: public
Mage_Sales_Model_Order_Payment_Transaction|false closeAuthorization ([bool $shouldSave = true], [bool $dryRun = false])
  • bool $shouldSave
  • bool $dryRun
closeCapture (line 332)

Close a capture transaction

Logic is similar to closeAuthorization(), but for a capture transaction

  • see: self::closeAuthorization()
  • access: public
void closeCapture ([unknown_type $shouldSave = true])
  • unknown_type $shouldSave
getAdditionalInformation (line 457)

Getter for entire additional_information value or one of its element by key

  • access: public
array|null|mixed getAdditionalInformation ([string $key = null])
  • string $key
getChildTransactions (line 238)

Child transaction(s) getter

Will attempt to load them first Can be filtered by types and/or transaction_id Returns transaction object if transaction_id is specified, otherwise - array TODO: $recursive is not implemented

  • access: public
Mage_Sales_Model_Order_Payment_Transaction|array|null getChildTransactions ([array|string $types = null], [string $txnId = null], [bool $recursive = false])
  • array|string $types
  • string $txnId
  • bool $recursive
getOrder (line 561)

Retrieve order instance

  • access: public
getOrderId (line 543)

Order ID getter

Attempts to get ID from set order payment object, if any, or from data by key 'order_id'

  • access: public
int|null getOrderId ()
getOrderPaymentObject (line 526)

Order Payment instance getter

Will attempt to load by payment_id if it is set in data

  • access: public
Mage_Sales_Model_Order_Payment getOrderPaymentObject ([bool $shouldLoad = true])
  • bool $shouldLoad
getOrderWebsiteId (line 729)

Retrieve order website id

  • access: public
int getOrderWebsiteId ()
getParentTransaction (line 201)

Parent transaction getter May attempt to load it.

  • access: public
Mage_Sales_Model_Order_Payment_Transaction|false getParentTransaction ([bool $shouldLoad = true])
  • bool $shouldLoad
getTransactionTypes (line 713)

Retrieve transaction types

  • access: public
array getTransactionTypes ()
hasChildTransaction (line 374)

Getter/Setter of whether current transaction has a child transaction

  • access: public
bool|Mage_Sales_Model_Order_Payment_Transaction hasChildTransaction ([bool $whetherHasChild = null])
  • bool $whetherHasChild
isFailsafe (line 601)

Setter/Getter whether transaction is supposed to prevent exceptions on saving

  • access: public
void isFailsafe ([ $setFailsafe = null], bool $failsafe)
  • bool $failsafe
  • $setFailsafe
isVoided (line 703)

Check whether this transaction is voided

  • access: public
bool isVoided ()
loadByTxnId (line 407)

Load self by specified transaction ID. Requires the valid payment object to be set

  • access: public
Mage_Sales_Model_Order_Payment_Transaction loadByTxnId (string $txnId)
  • string $txnId
setAdditionalInformation (line 439)

Additional information setter Updates data inside the 'additional_information' array Doesn't allow to set arrays

  • throws: Mage_Core_Exception
  • access: public
Mage_Sales_Model_Order_Payment_Transaction setAdditionalInformation (string $key, mixed $value)
  • string $key
  • mixed $value
setOrder (line 577)

Set order instance for transaction depends on transaction behavior If $order equals to true, method isn't loading new order instance.

  • access: public
Mage_Sales_Model_Order_Payment_Transaction setOrder ([Mage_Sales_Model_Order|null|boolean $order = null])
setOrderPaymentObject (line 141)

Payment instance setter

  • access: public
setParentTxnId (line 167)

Parent transaction ID setter

Can set the transaction id as well

  • throws: Mage_Core_Exception
  • access: public
Mage_Sales_Model_Order_Payment_Transaction setParentTxnId (string $parentTxnId, [string $txnId = null])
  • string $parentTxnId
  • string $txnId
setTxnId (line 153)

Transaction ID setter

  • access: public
Mage_Sales_Model_Order_Payment_Transaction setTxnId (string $txnId)
  • string $txnId
setTxnType (line 188)

Transaction type setter

  • access: public
Mage_Sales_Model_Order_Payment_Transaction setTxnType ($txnType $txnType)
  • $txnType $txnType
unsAdditionalInformation (line 474)

Unsetter for entire additional_information value or one of its element by key

  • access: public
Mage_Sales_Model_Order_Payment_Transaction unsAdditionalInformation ([string $key = null])
  • string $key
_afterLoadByTxnId (line 422)

Check object after loading by by specified transaction ID

  • access: protected
Mage_Sales_Model_Order_Payment_Transaction _afterLoadByTxnId ($txnId 0)
  • $txnId 0
_beforeLoadByTxnId (line 395)

Check object before loading by by specified transaction ID

  • access: protected
Mage_Sales_Model_Order_Payment_Transaction _beforeLoadByTxnId ($txnId $txnId)
  • $txnId $txnId
_beforeSave (line 615)

Verify data required for saving

  • throws: Mage_Core_Exception
  • access: protected

Redefinition of:
Mage_Core_Model_Abstract::_beforeSave()
Processing object before save data
_construct (line 130)

Initialize resource model

  • access: protected
void _construct ()
_isVoided (line 692)

Check whether this transaction is voided

TODO: implement that there should be only one void per authorization

  • access: protected
bool _isVoided ()
_loadChildren (line 638)

Load child transactions

  • throws: Mage_Core_Exception
  • access: protected
void _loadChildren ()
_verifyPaymentObject (line 767)

Check whether the payment object is set and it has order object or there is an order_id is set

$dryRun allows to not throw exception

  • throws: Mage_Core_Exception
  • access: protected
Mage_Sales_Model_Order_Payment|null|false _verifyPaymentObject ([bool $dryRun = false])
  • bool $dryRun
_verifyThisTransactionExists (line 794)

Make sure this object is a valid transaction

TODO for more restriction we can check for data consistency

  • throws: Mage_Core_Exception
  • access: protected
void _verifyThisTransactionExists ()
_verifyTxnId (line 782)

Check whether specified transaction ID is valid

  • throws: Mage_Core_Exception
  • access: protected
void _verifyTxnId (string $txnId)
  • string $txnId
_verifyTxnType (line 742)

Check whether specified or set transaction type is supported

  • throws: Mage_Core_Exception
  • access: protected
void _verifyTxnType ([string $txnType = null])
  • string $txnType

Inherited Methods

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
RAW_DETAILS = 'raw_details_info' (line 49)

Raw details key in additional info

TYPE_AUTH = 'authorization' (line 40)
TYPE_CAPTURE = 'capture' (line 41)
TYPE_ORDER = 'order' (line 39)
TYPE_PAYMENT = 'payment' (line 38)

Supported transaction types

TYPE_REFUND = 'refund' (line 43)
TYPE_VOID = 'void' (line 42)

Documentation generated on Fri, 11 Feb 2011 17:15:05 +0200 by phpDocumentor 1.4.3