@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 PaymentTransaction
public void setId(Long id)
setId
in interface PaymentTransaction
public OrderPayment getOrderPayment()
PaymentTransaction
OrderPayment
from
PaymentTransaction.getParentTransaction()
.getOrderPayment
in interface PaymentTransaction
public void setOrderPayment(OrderPayment orderPayment)
PaymentTransaction
setOrderPayment
in interface PaymentTransaction
public PaymentTransaction getParentTransaction()
PaymentTransaction
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
.
getParentTransaction
in interface PaymentTransaction
public void setParentTransaction(PaymentTransaction parentTransaction)
setParentTransaction
in interface PaymentTransaction
public PaymentTransactionType getType()
PaymentTransaction
getType
in interface PaymentTransaction
public void setType(PaymentTransactionType type)
setType
in interface PaymentTransaction
public Money getAmount()
PaymentTransaction
getAmount
in interface PaymentTransaction
public void setAmount(Money amount)
PaymentTransaction
setAmount
in interface PaymentTransaction
public Date getDate()
PaymentTransaction
getDate
in interface PaymentTransaction
public void setDate(Date date)
PaymentTransaction
setDate
in interface PaymentTransaction
public String getCustomerIpAddress()
PaymentTransaction
Customer
IP address that instigated this transaction. This is an optional fieldgetCustomerIpAddress
in interface PaymentTransaction
public void setCustomerIpAddress(String customerIpAddress)
PaymentTransaction
Customer
IP address that instigated the transaction. This is an optional field.setCustomerIpAddress
in interface PaymentTransaction
public String getRawResponse()
PaymentTransaction
getRawResponse
in interface PaymentTransaction
public void setRawResponse(String rawResponse)
PaymentTransaction
setRawResponse
in interface PaymentTransaction
public Boolean getSuccess()
PaymentTransaction
getSuccess
in interface PaymentTransaction
public void setSuccess(Boolean success)
setSuccess
in interface PaymentTransaction
public Map<String,String> getAdditionalFields()
getAdditionalFields
in interface AdditionalFields
getAdditionalFields
in interface PaymentTransaction
PaymentAdditionalFieldType}
public void setAdditionalFields(Map<String,String> additionalFields)
setAdditionalFields
in interface AdditionalFields
setAdditionalFields
in interface PaymentTransaction
public 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 PaymentTransaction
public void setSaveToken(boolean saveToken)
PaymentTransaction
CustomerPayment
setSaveToken
in interface PaymentTransaction
public Character getArchived()
getArchived
in interface Status
public void setArchived(Character archived)
setArchived
in interface Status
public <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.