Interface PaymentTransaction
- All Superinterfaces:
AdditionalFields,MultiTenantCloneable<PaymentTransaction>,Serializable,Status
- All Known Implementing Classes:
PaymentTransactionImpl
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.AUTHORIZEPaymentTransactionType.REFUND->PaymentTransactionType.CAPTUREORPaymentTransactionType.SETTLEDPaymentTransactionType.SETTLED->PaymentTransactionType.CAPTUREPaymentTransactionType.VOID->PaymentTransactionType.CAPTUREPaymentTransactionType.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 TypeMethodDescriptionGets the amount that this transaction is forGets theCustomerIP address that instigated this transaction.getDate()Gets the date that this transaction was made ongetId()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.getType()The type ofbooleanIndicates whether or not this transaction on the Order Payment contains a payment token (i.e.voidsetAdditionalFields(Map<String, String> additionalFields) voidSets the amount of this transactionvoidsetCustomerIpAddress(String customerIpAddress) Sets theCustomerIP address that instigated the transaction.voidSets the date that this transaction was made onvoidvoidsetOrderPayment(OrderPayment payment) Sets the overall payment that this transaction applies tovoidsetParentTransaction(PaymentTransaction parentTransaction) voidsetRawResponse(String rawResponse) Sets the raw response that was returned from the gateway.voidsetSaveToken(boolean saveToken) Mark this transaction as containing (or going to contain) a token that should be saved on the user's profile as aCustomerPaymentvoidsetSuccess(Boolean success) voidMethods inherited from interface org.broadleafcommerce.common.copy.MultiTenantCloneable
createOrRetrieveCopyInstanceMethods inherited from interface org.broadleafcommerce.common.persistence.Status
getArchived, isActive, setArchived
-
Method Details
-
getId
Long getId() -
setId
-
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 theOrderPaymentfromgetParentTransaction(). -
setOrderPayment
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.AUTHORIZEPaymentTransactionType.REFUND->PaymentTransactionType.CAPTUREORPaymentTransactionType.SETTLEDPaymentTransactionType.SETTLED->PaymentTransactionType.CAPTUREPaymentTransactionType.VOID->PaymentTransactionType.CAPTUREPaymentTransactionType.REVERSE_AUTH->PaymentTransactionType.AUTHORIZE
For
PaymentTransactionType.UNCONFIRMED, they will have children that will be eitherPaymentTransactionType.AUTHORIZEorPaymentTransactionType.AUTHORIZE_AND_CAPTURE.- Returns:
-
setParentTransaction
-
getType
PaymentTransactionType getType()The type of- Returns:
-
setType
-
getAmount
Money getAmount()Gets the amount that this transaction is for -
setAmount
Sets the amount of this transaction -
getDate
Date getDate()Gets the date that this transaction was made on -
setDate
Sets the date that this transaction was made on -
getCustomerIpAddress
String getCustomerIpAddress()Gets theCustomerIP address that instigated this transaction. This is an optional field -
setCustomerIpAddress
Sets theCustomerIP 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
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
-
getAdditionalFields
- Specified by:
getAdditionalFieldsin interfaceAdditionalFields
-
setAdditionalFields
- Specified by:
setAdditionalFieldsin interfaceAdditionalFields
-
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 aCustomerPaymenton 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 aCustomerPayment- Parameters:
saveToken-
-