public interface PaymentTransaction extends Serializable, Status, AdditionalFields, 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.AUTHORIZEPaymentTransactionType.REFUND -> PaymentTransactionType.CAPTURE OR PaymentTransactionType.SETTLEDPaymentTransactionType.SETTLED -> PaymentTransactionType.CAPTUREPaymentTransactionType.VOID -> PaymentTransactionType.CAPTUREPaymentTransactionType.REVERSE_AUTH -> PaymentTransactionType.AUTHORIZEFor PaymentTransactionType.UNCONFIRMED, they will have children that will be either PaymentTransactionType.AUTHORIZE
or PaymentTransactionType.AUTHORIZE_AND_CAPTURE.
| Modifier and Type | Method and Description |
|---|---|
Map<String,String> |
getAdditionalFields() |
Money |
getAmount()
Gets the amount that this transaction is for
|
String |
getCustomerIpAddress()
Gets the
Customer IP address that instigated this transaction. |
Date |
getDate()
Gets the date that this transaction was made on
|
Long |
getId() |
OrderPayment |
getOrderPayment()
The overall payment that this transaction applies to.
|
PaymentTransaction |
getParentTransaction()
Transactions can have a parent-child relationship for modifying transactions that can occur.
|
String |
getRawResponse()
Gets the string-representation of the serialized response from the gateway.
|
Boolean |
getSuccess()
Gets whether or not this transaction was successful.
|
PaymentTransactionType |
getType()
The type of
|
boolean |
isSaveToken()
Indicates whether or not this transaction on the Order Payment contains
a payment token (i.e.
|
void |
setAdditionalFields(Map<String,String> additionalFields) |
void |
setAmount(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 |
setOrderPayment(OrderPayment payment)
Sets the overall payment that this transaction applies to
|
void |
setParentTransaction(PaymentTransaction parentTransaction) |
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 |
setSuccess(Boolean success) |
void |
setType(PaymentTransactionType type) |
getArchived, isActive, setArchivedcreateOrRetrieveCopyInstanceLong getId()
void setId(Long id)
OrderPayment getOrderPayment()
OrderPayment from
getParentTransaction().void setOrderPayment(OrderPayment payment)
PaymentTransaction getParentTransaction()
PaymentTransactionType.CAPTURE -> PaymentTransactionType.AUTHORIZEPaymentTransactionType.REFUND -> PaymentTransactionType.CAPTURE OR PaymentTransactionType.SETTLEDPaymentTransactionType.SETTLED -> PaymentTransactionType.CAPTUREPaymentTransactionType.VOID -> PaymentTransactionType.CAPTUREPaymentTransactionType.REVERSE_AUTH -> PaymentTransactionType.AUTHORIZEFor PaymentTransactionType.UNCONFIRMED, they will have children that will be either PaymentTransactionType.AUTHORIZE
or PaymentTransactionType.AUTHORIZE_AND_CAPTURE.
void setParentTransaction(PaymentTransaction parentTransaction)
PaymentTransactionType getType()
void setType(PaymentTransactionType type)
Money getAmount()
void setAmount(Money amount)
Date getDate()
void setDate(Date date)
String getCustomerIpAddress()
Customer IP address that instigated this transaction. This is an optional fieldvoid setCustomerIpAddress(String customerIpAddress)
Customer IP address that instigated the transaction. This is an optional field.String getRawResponse()
void setRawResponse(String rawResponse)
Boolean getSuccess()
void setSuccess(Boolean success)
Map<String,String> getAdditionalFields()
getAdditionalFields in interface AdditionalFieldsPaymentAdditionalFieldType}void setAdditionalFields(Map<String,String> additionalFields)
setAdditionalFields in interface AdditionalFieldsboolean 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
void setSaveToken(boolean saveToken)
CustomerPaymentsaveToken - Copyright © 2019. All rights reserved.