Interface PaymentTransaction

All Superinterfaces:
org.broadleafcommerce.common.domain.AdditionalFields, org.broadleafcommerce.common.copy.MultiTenantCloneable<PaymentTransaction>, Serializable, org.broadleafcommerce.common.persistence.Status
All Known Implementing Classes:
PaymentTransactionImpl

public interface PaymentTransaction extends Serializable, org.broadleafcommerce.common.persistence.Status, org.broadleafcommerce.common.domain.AdditionalFields, org.broadleafcommerce.common.copy.MultiTenantCloneable<PaymentTransaction>

Used to store individual transactions about a particular payment. While an OrderPayment holds data like what the user might be paying with and the total amount they will be paying (like credit card and $10), a PaymentTransaction is more about what happens with that particular payment. Thus, PaymentTransactions do not make sense by themselves and ONLY make sense in the context of an OrderPayment.

For instance, the user might say they want to pay $10 but rather than capture the payment at order checkout, there might first be a transaction for PaymentTransactionType.AUTHORIZE and then when the item is shipped there is another PaymentTransaction for PaymentTransactionType.CAPTURE.

In the above case, this also implies that a PaymentTransaction can have a parent transaction (retrieved via getParentTransaction()). The parent transaction will only be set in the following cases:

  • 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.

*
Author:
Phillip Verheyden (phillipuniverse)
  • Method Summary

    Modifier and Type
    Method
    Description
     
    org.broadleafcommerce.common.money.Money
    Gets the amount that this transaction is for
    Gets the Customer IP address that instigated this transaction.
    Gets the date that this transaction was made on
     
    The overall payment that this transaction applies to.
    Transactions can have a parent-child relationship for modifying transactions that can occur.
    Gets the string-representation of the serialized response from the gateway.
    Gets whether or not this transaction was successful.
    org.broadleafcommerce.common.payment.PaymentTransactionType
    The type of
    boolean
    Indicates whether or not this transaction on the Order Payment contains a payment token (i.e.
    void
    setAdditionalFields(Map<String,String> additionalFields)
     
    void
    setAmount(org.broadleafcommerce.common.money.Money amount)
    Sets the amount of this transaction
    void
    setCustomerIpAddress(String customerIpAddress)
    Sets the Customer IP address that instigated the transaction.
    void
    setDate(Date date)
    Sets the date that this transaction was made on
    void
    setId(Long id)
     
    void
    Sets the overall payment that this transaction applies to
    void
     
    void
    setRawResponse(String rawResponse)
    Sets the raw response that was returned from the gateway.
    void
    setSaveToken(boolean saveToken)
    Mark this transaction as containing (or going to contain) a token that should be saved on the user's profile as a CustomerPayment
    void
     
    void
    setType(org.broadleafcommerce.common.payment.PaymentTransactionType type)
     

    Methods inherited from interface org.broadleafcommerce.common.copy.MultiTenantCloneable

    createOrRetrieveCopyInstance

    Methods inherited from interface org.broadleafcommerce.common.persistence.Status

    getArchived, isActive, setArchived
  • Method Details

    • getId

      Long getId()
    • setId

      void setId(Long id)
    • getOrderPayment

      OrderPayment getOrderPayment()
      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 getParentTransaction().
    • setOrderPayment

      void setOrderPayment(OrderPayment payment)
      Sets the overall payment that this transaction applies to
    • getParentTransaction

      PaymentTransaction getParentTransaction()
      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.

      Returns:
    • setParentTransaction

      void setParentTransaction(PaymentTransaction parentTransaction)
    • getType

      org.broadleafcommerce.common.payment.PaymentTransactionType getType()
      The type of
      Returns:
    • setType

      void setType(org.broadleafcommerce.common.payment.PaymentTransactionType type)
    • getAmount

      org.broadleafcommerce.common.money.Money getAmount()
      Gets the amount that this transaction is for
    • setAmount

      void setAmount(org.broadleafcommerce.common.money.Money amount)
      Sets the amount of this transaction
    • getDate

      Date getDate()
      Gets the date that this transaction was made on
    • setDate

      void setDate(Date date)
      Sets the date that this transaction was made on
    • getCustomerIpAddress

      String getCustomerIpAddress()
      Gets the Customer IP address that instigated this transaction. This is an optional field
    • setCustomerIpAddress

      void setCustomerIpAddress(String customerIpAddress)
      Sets the Customer IP address that instigated the transaction. This is an optional field.
    • getRawResponse

      String getRawResponse()
      Gets the string-representation of the serialized response from the gateway. This is usually the complete request parameter map serialized in string form.
    • setRawResponse

      void setRawResponse(String rawResponse)
      Sets the raw response that was returned from the gateway.
    • getSuccess

      Boolean getSuccess()
      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.
    • setSuccess

      void setSuccess(Boolean success)
    • getAdditionalFields

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

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

      boolean isSaveToken()

      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

      Returns:
      - whether or not this transaction should be tokenized
    • setSaveToken

      void setSaveToken(boolean saveToken)
      Mark this transaction as containing (or going to contain) a token that should be saved on the user's profile as a CustomerPayment
      Parameters:
      saveToken -