Class PaymentTransaction
- java.lang.Object
-
- com.broadleafcommerce.customer.service.provider.domain.PaymentTransaction
-
- All Implemented Interfaces:
Serializable
public class PaymentTransaction extends Object implements Serializable
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description PaymentTransaction()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
canEqual(Object other)
boolean
equals(Object o)
Map<String,String>
getAttributes()
Map of specific attributes that have been gathered from the raw response.Instant
getDateRecorded()
The timestamp when this transaction response was recordedString
getDeclineType()
The type of transaction failure (hard vs soft failure)String
getFailureType()
The type of transaction failureString
getGatewayResponseCode()
The response code provided by the payment gateway which may represent a success or failureString
getId()
The id of this payment transaction.String
getParentTransactionId()
The id of the parentPaymentTransaction
.String
getStatus()
The status of the transactionString
getTransactionReferenceId()
The transaction id known by the payment gateway.String
getType()
The type of this transaction (authorize, capture, refund, etc.)int
hashCode()
void
setAttributes(Map<String,String> attributes)
Map of specific attributes that have been gathered from the raw response.void
setDateRecorded(Instant dateRecorded)
The timestamp when this transaction response was recordedvoid
setDeclineType(String declineType)
The type of transaction failure (hard vs soft failure)void
setFailureType(String failureType)
The type of transaction failurevoid
setGatewayResponseCode(String gatewayResponseCode)
The response code provided by the payment gateway which may represent a success or failurevoid
setId(String id)
The id of this payment transaction.void
setParentTransactionId(String parentTransactionId)
The id of the parentPaymentTransaction
.void
setStatus(String status)
The status of the transactionvoid
setTransactionReferenceId(String transactionReferenceId)
The transaction id known by the payment gateway.void
setType(String type)
The type of this transaction (authorize, capture, refund, etc.)String
toString()
boolean
wasSuccessful()
Whether or not this transaction was successful based ongetStatus()
.
-
-
-
Method Detail
-
wasSuccessful
public boolean wasSuccessful()
Whether or not this transaction was successful based ongetStatus()
.- Returns:
- Whether or not this transaction was successful.
- See Also:
getStatus()
-
getId
public String getId()
The id of this payment transaction.- Returns:
- The id of this payment transaction.
-
getType
public String getType()
The type of this transaction (authorize, capture, refund, etc.)- Returns:
- The type of this transaction (authorize, capture, refund, etc.)
-
getStatus
public String getStatus()
The status of the transaction- Returns:
- The status of the transaction
-
getTransactionReferenceId
public String getTransactionReferenceId()
The transaction id known by the payment gateway. This reference can be used to link the request to the gateway's record of the transaction in the case that the calling application does not receive a response from the gateway.- Returns:
- The transaction id known by the payment gateway
-
getDateRecorded
public Instant getDateRecorded()
The timestamp when this transaction response was recorded- Returns:
- The timestamp when this transaction response was recorded
-
getGatewayResponseCode
public String getGatewayResponseCode()
The response code provided by the payment gateway which may represent a success or failure- Returns:
- The response code provided by the payment gateway which may represent a success or failure
-
getFailureType
public String getFailureType()
The type of transaction failure- Returns:
- The type of transaction failure
-
getDeclineType
public String getDeclineType()
The type of transaction failure (hard vs soft failure)- Returns:
- The type of transaction failure (hard vs soft failure)
-
getParentTransactionId
public String getParentTransactionId()
The id of the parentPaymentTransaction
. Necessary for operations on a payment that require something to have happened beforehand. For instance, an authorize transaction would not have a parent but a capture must have an authorize parent transaction and a refund must have a capture parent transaction. The full set of expected parent-child transaction relationships are as follows:- Child Transaction -> Parent Transaction
- Reverse Authorize -> Authorize
- Capture -> Authorize
- Void -> Capture
- Void -> AuthorizeAndCapture
- Settle -> Capture
- Refund -> Capture
- Refund -> AuthorizeAndCapture
- Refund -> Settle
- Returns:
- The id of the parent PaymentTransaction.
-
getAttributes
public Map<String,String> getAttributes()
Map of specific attributes that have been gathered from the raw response. This should be used for data points that are to be used programmatically. For example, a gateway-specific transaction id that can be used to capture or refund the transaction.- Returns:
- Map of specific fields that have been gathered from the raw response
-
setId
public void setId(String id)
The id of this payment transaction.- Parameters:
paymentTransactionId
- The id of this payment transaction.
-
setType
public void setType(String type)
The type of this transaction (authorize, capture, refund, etc.)- Parameters:
amount
- The type of this transaction
-
setStatus
public void setStatus(String status)
The status of the transaction- Parameters:
status
- The status of the transaction
-
setTransactionReferenceId
public void setTransactionReferenceId(String transactionReferenceId)
The transaction id known by the payment gateway. This reference can be used to link the request to the gateway's record of the transaction in the case that the calling application does not receive a response from the gateway.- Parameters:
transactionReferenceId
- The transaction id known by the payment gateway
-
setDateRecorded
public void setDateRecorded(Instant dateRecorded)
The timestamp when this transaction response was recorded- Parameters:
dateRecorded
- The timestamp when this transaction response was recorded
-
setGatewayResponseCode
public void setGatewayResponseCode(String gatewayResponseCode)
The response code provided by the payment gateway which may represent a success or failure- Parameters:
gatewayResponseCode
- The response code provided by the payment gateway which may represent a success or failure
-
setFailureType
public void setFailureType(String failureType)
The type of transaction failure- Parameters:
failureType
- The type of transaction failure
-
setDeclineType
public void setDeclineType(String declineType)
The type of transaction failure (hard vs soft failure)- Parameters:
failureType
- The type of transaction failure (hard vs soft failure)
-
setParentTransactionId
public void setParentTransactionId(String parentTransactionId)
The id of the parentPaymentTransaction
. Necessary for operations on a payment that require something to have happened beforehand. For instance, an authorize transaction would not have a parent but a capture must have an authorize parent transaction and a refund must have a capture parent transaction. The full set of expected parent-child transaction relationships are as follows:- Child Transaction -> Parent Transaction
- Reverse Authorize -> Authorize
- Capture -> Authorize
- Void -> Capture
- Void -> AuthorizeAndCapture
- Settle -> Capture
- Refund -> Capture
- Refund -> AuthorizeAndCapture
- Refund -> Settle
- Parameters:
parentTransactionId
- The id of the parent PaymentTransaction.
-
setAttributes
public void setAttributes(Map<String,String> attributes)
Map of specific attributes that have been gathered from the raw response. This should be used for data points that are to be used programmatically. For example, a gateway-specific transaction id that can be used to capture or refund the transaction.- Parameters:
attributes
- Map of specific fields that have been gathered from the raw response
-
canEqual
protected boolean canEqual(Object other)
-
-