Log in
Model

Transaction

Magento\Sales\Model\Order\Payment\Transaction

What it does

This class manages payment transaction records in Magento 2, tracking the hierarchy and relationships between different transaction types (authorization, capture, void, refund).

Developers use this class to create, retrieve, and manage payment transactions, including operations like closing authorizations, checking if transactions can be voided, and storing additional transaction information.

It's essential when working with payment processing, order management, or building custom payment integrations.

Public Methods

  • setTxnId()
  • setParentTxnId()
  • setTxnType()
  • getParentTransaction()
  • getChildTransactions()
  • closeAuthorization()
  • closeCapture()
  • canVoidAuthorizationCompletely()
  • hasChildTransaction()
  • setAdditionalInformation()
  • getAdditionalInformation()
  • unsAdditionalInformation()
  • close()
  • getOrderId()
  • getOrder()
  • setOrder()
  • isFailsafe()
  • beforeSave()
  • isVoided()
  • getTransactionTypes()
  • getOrderWebsiteId()
  • getTransactionId()
  • setTransactionId()
  • getMethod()
  • getIncrementId()
  • getParentId()
  • getPaymentId()
  • getTxnId()
  • getHtmlTxnId()
  • getParentTxnId()
  • getTxnType()
  • getIsClosed()
  • getCreatedAt()
  • setCreatedAt()
  • setParentId()
  • setOrderId()
  • setPaymentId()
  • setIsClosed()
  • getExtensionAttributes()
  • setExtensionAttributes()