Class PaymentTransactionImpl

java.lang.Object
org.broadleafcommerce.core.payment.domain.PaymentTransactionImpl
All Implemented Interfaces:
Serializable, org.broadleafcommerce.common.copy.MultiTenantCloneable<PaymentTransaction>, org.broadleafcommerce.common.domain.AdditionalFields, org.broadleafcommerce.common.persistence.Status, PaymentTransaction

@Entity public class PaymentTransactionImpl extends Object implements PaymentTransaction
Author:
Jerry Ocanas (jocanas)
See Also:
  • Field Details

    • id

      protected Long id
    • type

      protected String type
    • amount

      protected BigDecimal amount
    • date

      protected Date date
    • customerIpAddress

      protected String customerIpAddress
    • rawResponse

      protected String rawResponse
    • success

      protected Boolean success
    • archiveStatus

      protected org.broadleafcommerce.common.persistence.ArchiveStatus archiveStatus
    • orderPayment

      protected OrderPayment orderPayment
    • parentTransaction

      protected PaymentTransaction parentTransaction
      Necessary for operations on a payment that require something to have happened beforehand. For instance, an AUTHORIZE would not have a parent but a CAPTURE must have an AUTHORIZE parent and a REFUND must have a CAPTURE parent
    • additionalFields

      protected Map<String,String> additionalFields
    • saveToken

      protected Boolean saveToken
  • Constructor Details

    • PaymentTransactionImpl

      public PaymentTransactionImpl()
  • Method Details

    • getId

      public Long getId()
      Specified by:
      getId in interface PaymentTransaction
    • setId

      public void setId(Long id)
      Specified by:
      setId in interface PaymentTransaction
    • getOrderPayment

      public OrderPayment getOrderPayment()
      Description copied from interface: PaymentTransaction
      The overall payment that this transaction applies to. Note that if the relationship to an order payment is unset on this particular transaction, then this will automatically attempt to obtain the OrderPayment from PaymentTransaction.getParentTransaction().
      Specified by:
      getOrderPayment in interface PaymentTransaction
    • setOrderPayment

      public void setOrderPayment(OrderPayment orderPayment)
      Description copied from interface: PaymentTransaction
      Sets the overall payment that this transaction applies to
      Specified by:
      setOrderPayment in interface PaymentTransaction
    • getParentTransaction

      public PaymentTransaction getParentTransaction()
      Description copied from interface: PaymentTransaction
      Transactions can have a parent-child relationship for modifying transactions that can occur. Examples of this:
      • PaymentTransactionType.CAPTURE -> PaymentTransactionType.AUTHORIZE
      • PaymentTransactionType.REFUND -> PaymentTransactionType.CAPTURE OR PaymentTransactionType.SETTLED
      • PaymentTransactionType.SETTLED -> PaymentTransactionType.CAPTURE
      • PaymentTransactionType.VOID -> PaymentTransactionType.CAPTURE
      • PaymentTransactionType.REVERSE_AUTH -> PaymentTransactionType.AUTHORIZE

      For PaymentTransactionType.UNCONFIRMED, they will have children that will be either PaymentTransactionType.AUTHORIZE or PaymentTransactionType.AUTHORIZE_AND_CAPTURE.

      Specified by:
      getParentTransaction in interface PaymentTransaction
      Returns:
    • setParentTransaction

      public void setParentTransaction(PaymentTransaction parentTransaction)
      Specified by:
      setParentTransaction in interface PaymentTransaction
    • getType

      public org.broadleafcommerce.common.payment.PaymentTransactionType getType()
      Description copied from interface: PaymentTransaction
      The type of
      Specified by:
      getType in interface PaymentTransaction
      Returns:
    • setType

      public void setType(org.broadleafcommerce.common.payment.PaymentTransactionType type)
      Specified by:
      setType in interface PaymentTransaction
    • getAmount

      public org.broadleafcommerce.common.money.Money getAmount()
      Description copied from interface: PaymentTransaction
      Gets the amount that this transaction is for
      Specified by:
      getAmount in interface PaymentTransaction
    • setAmount

      public void setAmount(org.broadleafcommerce.common.money.Money amount)
      Description copied from interface: PaymentTransaction
      Sets the amount of this transaction
      Specified by:
      setAmount in interface PaymentTransaction
    • getDate

      public Date getDate()
      Description copied from interface: PaymentTransaction
      Gets the date that this transaction was made on
      Specified by:
      getDate in interface PaymentTransaction
    • setDate

      public void setDate(Date date)
      Description copied from interface: PaymentTransaction
      Sets the date that this transaction was made on
      Specified by:
      setDate in interface PaymentTransaction
    • getCustomerIpAddress

      public String getCustomerIpAddress()
      Description copied from interface: PaymentTransaction
      Gets the Customer IP address that instigated this transaction. This is an optional field
      Specified by:
      getCustomerIpAddress in interface PaymentTransaction
    • setCustomerIpAddress

      public void setCustomerIpAddress(String customerIpAddress)
      Description copied from interface: PaymentTransaction
      Sets the Customer IP address that instigated the transaction. This is an optional field.
      Specified by:
      setCustomerIpAddress in interface PaymentTransaction
    • getRawResponse

      public String getRawResponse()
      Description copied from interface: PaymentTransaction
      Gets the string-representation of the serialized response from the gateway. This is usually the complete request parameter map serialized in string form.
      Specified by:
      getRawResponse in interface PaymentTransaction
    • setRawResponse

      public void setRawResponse(String rawResponse)
      Description copied from interface: PaymentTransaction
      Sets the raw response that was returned from the gateway.
      Specified by:
      setRawResponse in interface PaymentTransaction
    • getSuccess

      public Boolean getSuccess()
      Description copied from interface: PaymentTransaction
      Gets whether or not this transaction was successful. There are multiple reasons that a transaction could be unsuccessful such as failed credit card processing or any other errors from the gateway.
      Specified by:
      getSuccess in interface PaymentTransaction
    • setSuccess

      public void setSuccess(Boolean success)
      Specified by:
      setSuccess in interface PaymentTransaction
    • getAdditionalFields

      public Map<String,String> getAdditionalFields()
      Specified by:
      getAdditionalFields in interface org.broadleafcommerce.common.domain.AdditionalFields
      Specified by:
      getAdditionalFields in interface PaymentTransaction
    • setAdditionalFields

      public void setAdditionalFields(Map<String,String> additionalFields)
      Specified by:
      setAdditionalFields in interface org.broadleafcommerce.common.domain.AdditionalFields
      Specified by:
      setAdditionalFields in interface PaymentTransaction
    • isSaveToken

      public boolean isSaveToken()
      Description copied from interface: PaymentTransaction

      Indicates whether or not this transaction on the Order Payment contains a payment token (i.e. PaymentAdditionalFieldType.TOKEN) and should be saved as a CustomerPayment on the user's profile

      Specified by:
      isSaveToken in interface PaymentTransaction
      Returns:
      - whether or not this transaction should be tokenized
    • setSaveToken

      public void setSaveToken(boolean saveToken)
      Description copied from interface: PaymentTransaction
      Mark this transaction as containing (or going to contain) a token that should be saved on the user's profile as a CustomerPayment
      Specified by:
      setSaveToken in interface PaymentTransaction
    • getArchived

      public Character getArchived()
      Specified by:
      getArchived in interface org.broadleafcommerce.common.persistence.Status
    • setArchived

      public void setArchived(Character archived)
      Specified by:
      setArchived in interface org.broadleafcommerce.common.persistence.Status
    • isActive

      public boolean isActive()
      Specified by:
      isActive in interface org.broadleafcommerce.common.persistence.Status
    • createOrRetrieveCopyInstance

      public <G extends PaymentTransaction> org.broadleafcommerce.common.copy.CreateResponse<G> createOrRetrieveCopyInstance(org.broadleafcommerce.common.copy.MultiTenantCopyContext context) throws CloneNotSupportedException
      Specified by:
      createOrRetrieveCopyInstance in interface org.broadleafcommerce.common.copy.MultiTenantCloneable<PaymentTransaction>
      Throws:
      CloneNotSupportedException