Log in
Model

Payment

Magento\Sales\Model\Order\Payment

What it does

The Payment class manages all payment-related operations for orders in Magento 2.

Developers use this class to handle payment authorization, capture, refund, void transactions, and track payment states.

It serves as the central model for processing payments through payment gateways and maintaining payment transaction history.

Public Methods

  • setOrder()
  • getOrder()
  • setTransactionId()
  • getTransactionId()
  • setIsTransactionClosed()
  • getParentTransactionId()
  • setParentTransactionId()
  • canCapture()
  • canRefund()
  • canRefundPartialPerInvoice()
  • canCapturePartial()
  • place()
  • capture()
  • registerCaptureNotification()
  • registerAuthorizationNotification()
  • pay()
  • cancelInvoice()
  • canVoid()
  • void()
  • registerVoidNotification()
  • setCreditmemo()
  • getCreditmemo()
  • refund()
  • registerRefundNotification()
  • cancelCreditmemo()
  • cancel()
  • canReviewPayment()
  • canFetchTransactionInfo()
  • accept()
  • deny()
  • update()
  • authorize()
  • addTransaction()
  • addTransactionCommentsToOrder()
  • importTransactionInfo()
  • prependMessage()
  • formatAmount()
  • formatPrice()
  • getAuthorizationTransaction()
  • isCaptureFinal()
  • isSameCurrency()
  • setTransactionAdditionalInfo()
  • getTransactionAdditionalInfo()
  • resetTransactionAdditionalInfo()
  • getAccountStatus()
  • getAdditionalData()
  • getAddressStatus()
  • getAmountAuthorized()
  • getAmountCanceled()
  • getAmountOrdered()
  • getAmountPaid()
  • getAmountRefunded()
  • getAnetTransMethod()
  • getBaseAmountAuthorized()
  • getBaseAmountCanceled()
  • getBaseAmountOrdered()
  • getBaseAmountPaid()
  • getBaseAmountPaidOnline()
  • getBaseAmountRefunded()
  • getBaseAmountRefundedOnline()
  • getBaseShippingAmount()
  • getBaseShippingCaptured()
  • getBaseShippingRefunded()
  • getCcApproval()
  • getCcAvsStatus()
  • getCcCidStatus()
  • getCcDebugRequestBody()
  • getCcDebugResponseBody()
  • getCcDebugResponseSerialized()
  • getCcExpMonth()
  • getCcExpYear()
  • getCcLast4()
  • getCcNumberEnc()
  • getCcOwner()
  • getCcSecureVerify()
  • getCcSsIssue()
  • getCcSsStartMonth()
  • getCcSsStartYear()
  • getCcStatus()
  • getCcStatusDescription()
  • getCcTransId()
  • getCcType()
  • getEcheckAccountName()
  • getEcheckAccountType()
  • getEcheckBankName()
  • getEcheckRoutingNumber()
  • getEcheckType()
  • getLastTransId()
  • getMethod()
  • getParentId()
  • getPoNumber()
  • getProtectionEligibility()
  • getQuotePaymentId()
  • getShippingAmount()
  • getShippingCaptured()
  • getShippingRefunded()
  • setParentId()
  • setBaseShippingCaptured()
  • setShippingCaptured()
  • setAmountRefunded()
  • setBaseAmountPaid()
  • setAmountCanceled()
  • setBaseAmountAuthorized()
  • setBaseAmountPaidOnline()
  • setBaseAmountRefundedOnline()
  • setBaseShippingAmount()
  • setShippingAmount()
  • setAmountPaid()
  • setAmountAuthorized()
  • setBaseAmountOrdered()
  • setBaseShippingRefunded()
  • setShippingRefunded()
  • setBaseAmountRefunded()
  • setAmountOrdered()
  • setBaseAmountCanceled()
  • setQuotePaymentId()
  • setAdditionalData()
  • setCcExpMonth()
  • setCcSsStartYear()
  • setEcheckBankName()
  • setMethod()
  • setCcDebugRequestBody()
  • setCcSecureVerify()
  • setProtectionEligibility()
  • setCcApproval()
  • setCcLast4()
  • setCustomAttribute()
  • setCcStatusDescription()
  • setEcheckType()
  • setCcDebugResponseSerialized()
  • setCcSsStartMonth()
  • setEcheckAccountType()
  • setLastTransId()
  • setCcCidStatus()
  • setCcOwner()
  • setCcType()
  • setPoNumber()
  • setCcExpYear()
  • setCcStatus()
  • setEcheckRoutingNumber()
  • setAccountStatus()
  • setAnetTransMethod()
  • setCcDebugResponseBody()
  • setCcSsIssue()
  • setEcheckAccountName()
  • setCcAvsStatus()
  • setCcNumberEnc()
  • setCcTransId()
  • setAddressStatus()
  • getExtensionAttributes()
  • setExtensionAttributes()
  • setIsTransactionPending()
  • getIsTransactionPending()
  • setIsFraudDetected()
  • getIsFraudDetected()
  • setShouldCloseParentTransaction()
  • getShouldCloseParentTransaction()