@Entity public class PaymentTransactionImpl extends Object implements PaymentTransaction
| Modifier and Type | Field and Description |
|---|---|
protected Map<String,String> |
additionalFields |
protected BigDecimal |
amount |
protected ArchiveStatus |
archiveStatus |
protected String |
customerIpAddress |
protected Date |
date |
protected Long |
id |
protected OrderPayment |
orderPayment |
protected PaymentTransaction |
parentTransaction
Necessary for operations on a payment that require something to have happened beforehand.
|
protected String |
rawResponse |
protected Boolean |
saveToken |
protected Boolean |
success |
protected String |
type |
| Constructor and Description |
|---|
PaymentTransactionImpl() |
| Modifier and Type | Method and Description |
|---|---|
<G extends PaymentTransaction> |
createOrRetrieveCopyInstance(MultiTenantCopyContext context)
Clone this entity for the purpose of multiple tenancy.
|
Map<String,String> |
getAdditionalFields() |
Money |
getAmount()
Gets the amount that this transaction is for
|
Character |
getArchived() |
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 |
isActive() |
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 |
setArchived(Character archived) |
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 orderPayment)
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) |
protected Long id
protected String type
protected BigDecimal amount
protected Date date
protected String customerIpAddress
protected String rawResponse
protected Boolean success
protected ArchiveStatus archiveStatus
protected OrderPayment orderPayment
protected PaymentTransaction parentTransaction
protected Boolean saveToken
public Long getId()
getId in interface PaymentTransactionpublic void setId(Long id)
setId in interface PaymentTransactionpublic OrderPayment getOrderPayment()
PaymentTransactionOrderPayment from
PaymentTransaction.getParentTransaction().getOrderPayment in interface PaymentTransactionpublic void setOrderPayment(OrderPayment orderPayment)
PaymentTransactionsetOrderPayment in interface PaymentTransactionpublic PaymentTransaction getParentTransaction()
PaymentTransactionPaymentTransactionType.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.
getParentTransaction in interface PaymentTransactionpublic void setParentTransaction(PaymentTransaction parentTransaction)
setParentTransaction in interface PaymentTransactionpublic PaymentTransactionType getType()
PaymentTransactiongetType in interface PaymentTransactionpublic void setType(PaymentTransactionType type)
setType in interface PaymentTransactionpublic Money getAmount()
PaymentTransactiongetAmount in interface PaymentTransactionpublic void setAmount(Money amount)
PaymentTransactionsetAmount in interface PaymentTransactionpublic Date getDate()
PaymentTransactiongetDate in interface PaymentTransactionpublic void setDate(Date date)
PaymentTransactionsetDate in interface PaymentTransactionpublic String getCustomerIpAddress()
PaymentTransactionCustomer IP address that instigated this transaction. This is an optional fieldgetCustomerIpAddress in interface PaymentTransactionpublic void setCustomerIpAddress(String customerIpAddress)
PaymentTransactionCustomer IP address that instigated the transaction. This is an optional field.setCustomerIpAddress in interface PaymentTransactionpublic String getRawResponse()
PaymentTransactiongetRawResponse in interface PaymentTransactionpublic void setRawResponse(String rawResponse)
PaymentTransactionsetRawResponse in interface PaymentTransactionpublic Boolean getSuccess()
PaymentTransactiongetSuccess in interface PaymentTransactionpublic void setSuccess(Boolean success)
setSuccess in interface PaymentTransactionpublic Map<String,String> getAdditionalFields()
getAdditionalFields in interface AdditionalFieldsgetAdditionalFields in interface PaymentTransactionPaymentAdditionalFieldType}public void setAdditionalFields(Map<String,String> additionalFields)
setAdditionalFields in interface AdditionalFieldssetAdditionalFields in interface PaymentTransactionpublic boolean isSaveToken()
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
isSaveToken in interface PaymentTransactionpublic void setSaveToken(boolean saveToken)
PaymentTransactionCustomerPaymentsetSaveToken in interface PaymentTransactionpublic Character getArchived()
getArchived in interface Statuspublic void setArchived(Character archived)
setArchived in interface Statuspublic <G extends PaymentTransaction> CreateResponse<G> createOrRetrieveCopyInstance(MultiTenantCopyContext context) throws CloneNotSupportedException
MultiTenantCloneable
public CreateResponse<MyClass> createOrRetrieveCopyInstance(MultiTenantCopyContext context) throws CloneNotSupportedException {
CreateResponse<MyClass> createResponse = super.createOrRetrieveCopyInstance(context);
if (createResponse.isAlreadyPopulated()) {
return createResponse;
}
MyClass myClone = createResponse.getClone();
//copy extended field values on myClone here
return createResponse;
}
Support should also be added for @Embeddable classes that contribute fields (collections or basic) to a cloneable entity:
public CreateResponse<G extends MyClass> createOrRetrieveCopyInstance(MultiTenantCopyContext context) throws CloneNotSupportedException {
CreateResponse createResponse = context.createOrRetrieveCopyInstance(this);
MyClass myClone = createResponse.getClone();
//copy extended field values on myClone here
return createResponse;
}
createOrRetrieveCopyInstance in interface MultiTenantCloneable<PaymentTransaction>context - a context object providing persistence and library functionality for copying entitiesCloneNotSupportedException - if there's a problem detected with the cloning configurationCopyright © 2019. All rights reserved.