Class Mage_Sales_Model_Order_Payment_Transaction
Payment transaction model Tracks transaction history, allows to build transactions hierarchy By default transactions are saved as closed.
- Varien_Object
- Mage_Core_Model_Abstract
- Mage_Sales_Model_Order_Payment_Transaction
Category: Mage
Copyright: Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
License: Open Software License (OSL 3.0)
Author: Magento Core Team <core@magentocommerce.com>
Located at code/core/Mage/Sales/Model/Order/Payment/Transaction.php
protected
|
|
public
|
|
public
|
|
public
|
#
setParentTxnId( string $parentTxnId, string $txnId = null )
Parent transaction ID setter Can set the transaction id as well |
public
|
|
public
|
#
getParentTransaction( boolean $shouldLoad = true )
Parent transaction getter May attempt to load it. |
public
|
#
getChildTransactions( array|string $types = null, string $txnId = null, boolean $recursive = false )
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 |
public
|
#
closeAuthorization( boolean $shouldSave = true, boolean $dryRun = false )
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 |
public
|
#
closeCapture( unknown_type $shouldSave = true )
Close a capture transaction Logic is similar to closeAuthorization(), but for a capture transaction |
public
boolean
|
#
canVoidAuthorizationCompletely( )
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 |
public
boolean|
|
#
hasChildTransaction( boolean $whetherHasChild = null )
Getter/Setter of whether current transaction has a child transaction |
protected
|
|
public
|
#
loadByTxnId( string $txnId )
Load self by specified transaction ID. Requires the valid payment object to be set |
protected
|
|
public
|
#
setAdditionalInformation( string $key, mixed $value )
Additional information setter Updates data inside the 'additional_information' array Doesn't allow to set arrays |
public
array|null|mixed
|
#
getAdditionalInformation( string $key = null )
Getter for entire additional_information value or one of its element by key |
public
|
#
unsAdditionalInformation( string $key = null )
Unsetter for entire additional_information value or one of its element by key |
public
|
|
public
|
#
getOrderPaymentObject( boolean $shouldLoad = true )
Order Payment instance getter Will attempt to load by payment_id if it is set in data |
public
integer|null
|
#
getOrderId( )
Order ID getter Attempts to get ID from set order payment object, if any, or from data by key 'order_id' |
public
|
|
public
|
#
setOrder(
Set order instance for transaction depends on transaction behavior If $order equals to true, method isn't loading new order instance. |
public
|
#
isFailsafe( boolean $setFailsafe = null )
Setter/Getter whether transaction is supposed to prevent exceptions on saving |
protected
|
|
protected
|
|
protected
boolean
|
|
public
boolean
|
|
public
array
|
|
public
integer
|
|
protected
|
#
_verifyTxnType( string $txnType = null )
Check whether specified or set transaction type is supported |
protected
|
#
_verifyPaymentObject( boolean $dryRun = false )
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 |
protected
|
|
protected
|
#
_verifyThisTransactionExists( )
Make sure this object is a valid transaction TODO for more restriction we can check for data consistency |
string |
TYPE_PAYMENT
|
'payment' |
#
Supported transaction types |
string |
TYPE_ORDER
|
'order' |
|
string |
TYPE_AUTH
|
'authorization' |
|
string |
TYPE_CAPTURE
|
'capture' |
|
string |
TYPE_VOID
|
'void' |
|
string |
TYPE_REFUND
|
'refund' |
|
string |
RAW_DETAILS
|
'raw_details_info' |
#
Raw details key in additional info |
protected
|
$_paymentObject | null |
#
Payment instance. Required for most transaction writing and search operations |
protected
|
$_order | null |
#
Order instance |
protected
|
$_parentTransaction | null |
#
Parent transaction instance |
protected
array
|
$_children | null |
#
Child transactions, assoc array of transaction_id => instance |
protected
array
|
$_identifiedChildren | null |
#
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 |
protected
boolean
|
$_transactionsAutoLinking | true |
#
Whether to perform automatic actions on transactions, such as auto-closing and putting as a parent |
protected
boolean
|
$_isFailsafe | false |
#
Whether to throw exceptions on different operations |
protected
boolean
|
$_hasChild | null |
#
Whether transaction has children |
protected
string
|
$_eventPrefix | 'sales_order_payment_transaction' |
#
Event object prefix |
protected
string
|
$_eventObject | 'order_payment_transaction' |
#
Event object prefix |
protected
integer
|
$_orderWebsiteId | null |
#
Order website id |
$_cacheTag,
$_dataSaveAllowed,
$_isObjectNew,
$_resource,
$_resourceCollectionName,
$_resourceName
|