Class TransactionExecutionDetail
- All Implemented Interfaces:
Serializable
- Author:
- Chris Kittrell (ckittrell)
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
boolean
javax.money.MonetaryAmount
The payment's adjustments (a.k.a discounts) total, usually excluding shipping/fulfillment discounts.Map of specific attributes that have been gathered from the raw response.The timestamp when this transaction response was recordedThe type of transaction failure (hard vs soft failure)The type of transaction failurejavax.money.MonetaryAmount
The total fees related to thetransactionAmount
javax.money.MonetaryAmount
The payment's total fulfillment cost.The response code provided by the payment gateway which may represent a success or failureThe gateway-specific id for the transaction.javax.money.MonetaryAmount
The amount of taxes that are included in the subtotal (VAT).Message describing the result of the transactioncom.broadleafcommerce.paymentgateway.domain.NextAction
The id of the parentPaymentTransaction
.javax.money.MonetaryAmount
The payment's total usually excluding adjustments, tax, fees, and shipping.javax.money.MonetaryAmount
The payment's total tax cost.javax.money.MonetaryAmount
The transaction amount that we're expecting to execute against thePayment
.The id of the executed transaction.The management state of this transaction, after it's been executed.The transaction id known by the payment gateway.The status of the transaction.int
hashCode()
boolean
Indicates that the payment transaction has been flagged for manual review via fraud checks.boolean
Tells if this transaction has an indeterminate result.void
setAdjustmentsTotal
(javax.money.MonetaryAmount adjustmentsTotal) The payment's adjustments (a.k.a discounts) total, usually excluding shipping/fulfillment discounts.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
setFeesTotal
(javax.money.MonetaryAmount feesTotal) The total fees related to thetransactionAmount
void
setFlaggedForManualReview
(boolean flaggedForManualReview) Indicates that the payment transaction has been flagged for manual review via fraud checks.void
setFulfillmentTotal
(javax.money.MonetaryAmount fulfillmentTotal) The payment's total fulfillment cost.void
setGatewayResponseCode
(String gatewayResponseCode) The response code provided by the payment gateway which may represent a success or failurevoid
setGatewayTransactionId
(String gatewayTransactionId) The gateway-specific id for the transaction.void
setIncludedTaxTotal
(javax.money.MonetaryAmount includedTaxTotal) The amount of taxes that are included in the subtotal (VAT).void
setIndeterminateResult
(boolean indeterminateResult) Tells if this transaction has an indeterminate result.void
setMessage
(String message) Message describing the result of the transactionvoid
setNextAction
(com.broadleafcommerce.paymentgateway.domain.NextAction nextAction) The next step required for the payment gateway to continue processing this payment.void
setParentTransactionId
(String parentTransactionId) The id of the parentPaymentTransaction
.void
setSubtotal
(javax.money.MonetaryAmount subtotal) The payment's total usually excluding adjustments, tax, fees, and shipping.void
setTaxTotal
(javax.money.MonetaryAmount taxTotal) The payment's total tax cost.void
setThreeDSecureVerificationUrl
(String threeDSecureVerificationUrl) Deprecated.void
setTransactionAmount
(javax.money.MonetaryAmount transactionAmount) The transaction amount that we're expecting to execute against thePayment
.void
setTransactionId
(String transactionId) The id of the executed transaction.void
setTransactionManagementState
(String transactionManagementState) The management state of this transaction, after it's been executed.void
setTransactionReferenceId
(String transactionReferenceId) The transaction id known by the payment gateway.void
setTransactionStatus
(String transactionStatus) The status of the transaction.toString()
boolean
Whether this transaction was successful based ongetTransactionStatus()
.
-
Constructor Details
-
TransactionExecutionDetail
public TransactionExecutionDetail()
-
-
Method Details
-
wasSuccessful
public boolean wasSuccessful()Whether this transaction was successful based ongetTransactionStatus()
.- Returns:
- Whether or not this transaction was successful.
- See Also:
-
getThreeDSecureVerificationUrl
-
getNextAction
public com.broadleafcommerce.paymentgateway.domain.NextAction getNextAction() -
getTransactionId
The id of the executed transaction.- Returns:
- The id of the executed transaction.
-
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
- Refund -> Capture
- Refund -> AuthorizeAndCapture
- Returns:
- The id of the parent PaymentTransaction.
-
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
-
getGatewayTransactionId
The gateway-specific id for the transaction.- Returns:
- The gateway-specific id for the transaction
-
getTransactionManagementState
The management state of this transaction, after it's been executed.- Returns:
- The management state of this transaction, after it's been executed.
- See Also:
-
getTransactionStatus
The status of the transaction.- Returns:
- The status of the transaction.
- See Also:
-
getFailureType
The type of transaction failure- Returns:
- The type of transaction failure
-
getDeclineType
The type of transaction failure (hard vs soft failure)- Returns:
- The type of transaction failure (hard vs soft failure)
-
isFlaggedForManualReview
public boolean isFlaggedForManualReview()Indicates that the payment transaction has been flagged for manual review via fraud checks.- Returns:
- true if the transaction flagged for manual review
-
isIndeterminateResult
public boolean isIndeterminateResult()Tells if this transaction has an indeterminate result.Having an indeterminate result means that the true outcome of the transaction is not known. For example, if a transaction is sent to the payment processor but a network error occurred, it is not known to us whether the user was actually charged or not (thus, the result is indeterminate).
Transactions should be marked as indeterminate when sending to the payment processor, and then unmarked once a response is received, understood, and recorded. This means that a transaction in an indeterminate result state is expected during the sending to processor phase. However, if the transaction remains in that state for an excessive amount of time, something likely went wrong and the transaction will need to be reconciled. If the transaction changes from the sending to processor status but remains indeterminate, the transaction will also require reconciliation in that scenario.
Some situations which may lead to an indeterminate result:
- A transaction is sent to the processor, but a network error prevents us from receiving the response
- A transaction is sent to the processor, but the processor returns an unexpected error (e.g. 500 internal server error)
- A transaction is sent to the processor and a response is received, but cannot be recorded because Cart Services is down
- A transaction is sent to the processor and a response is received, but cannot be recorded because the database is down
-
getDateRecorded
The timestamp when this transaction response was recorded- Returns:
- The timestamp when this transaction response was recorded
-
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
-
getMessage
Message describing the result of the transaction- Returns:
- Message describing the result of the transaction
-
getTransactionAmount
public javax.money.MonetaryAmount getTransactionAmount()The transaction amount that we're expecting to execute against thePayment
. This amount must be valid according to what's available for thePayment
. If specified, the amount details should be equal to this amount using the following equation: transactionAmount =subtotal
+fulfillmentTotal
+feesTotal
-adjustmentsTotal
+taxTotal
-includedTaxTotal
.- Returns:
- The transaction amount that we're expecting to execute against the
Payment
.
-
getSubtotal
public javax.money.MonetaryAmount getSubtotal()The payment's total usually excluding adjustments, tax, fees, and shipping.- Returns:
- The payment's total usually excluding adjustments, tax, fees, and shipping.
-
getAdjustmentsTotal
public javax.money.MonetaryAmount getAdjustmentsTotal()The payment's adjustments (a.k.a discounts) total, usually excluding shipping/fulfillment discounts.- Returns:
- The payment's adjustments (a.k.a discounts) total, usually excluding shipping/fulfillment discounts.
-
getFulfillmentTotal
public javax.money.MonetaryAmount getFulfillmentTotal()The payment's total fulfillment cost.- Returns:
- The payment's total fulfillment cost.
-
getFeesTotal
public javax.money.MonetaryAmount getFeesTotal()The total fees related to thetransactionAmount
- Returns:
- The total fees related to the
transactionAmount
-
getTaxTotal
public javax.money.MonetaryAmount getTaxTotal()The payment's total tax cost.- Returns:
- The payment's total tax cost.
-
getIncludedTaxTotal
public javax.money.MonetaryAmount getIncludedTaxTotal()The amount of taxes that are included in the subtotal (VAT).- Returns:
- The amount of taxes that are included in the subtotal (VAT).
-
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
-
setTransactionId
The id of the executed transaction.- Parameters:
transactionId
- The id of the executed transaction.
-
setParentTransactionId
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
- Refund -> Capture
- Refund -> AuthorizeAndCapture
- Parameters:
parentTransactionId
- The id of the parent PaymentTransaction.
-
setTransactionReferenceId
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
-
setGatewayTransactionId
The gateway-specific id for the transaction.- Parameters:
gatewayTransactionId
- The gateway-specific id for the transaction
-
setTransactionManagementState
The management state of this transaction, after it's been executed.- Parameters:
transactionManagementState
- The management state of this transaction, after it's been executed.- See Also:
-
setTransactionStatus
The status of the transaction.- Parameters:
status
- The status of the transaction.- See Also:
-
setFailureType
The type of transaction failure- Parameters:
failureType
- The type of transaction failure
-
setDeclineType
The type of transaction failure (hard vs soft failure)- Parameters:
failureType
- The type of transaction failure (hard vs soft failure)
-
setFlaggedForManualReview
public void setFlaggedForManualReview(boolean flaggedForManualReview) Indicates that the payment transaction has been flagged for manual review via fraud checks.- Parameters:
flaggedForManualReview
- whether the transaction is marked for manual review
-
setThreeDSecureVerificationUrl
Deprecated.in favor ofnextAction
The gateway-provided url where the customer must verify that they are in fact the owner of the payment method. The customer is typically redirected to this location, but the page can also be rendered within an iframe if this is supported by the gateway.- Parameters:
threeDSecureVerificationUrl
- The gateway-provided url where the customer must verify that they are in fact the owner of the payment method.
-
setIndeterminateResult
public void setIndeterminateResult(boolean indeterminateResult) Tells if this transaction has an indeterminate result.Having an indeterminate result means that the true outcome of the transaction is not known. For example, if a transaction is sent to the payment processor but a network error occurred, it is not known to us whether the user was actually charged or not (thus, the result is indeterminate).
Transactions should be marked as indeterminate when sending to the payment processor, and then unmarked once a response is received, understood, and recorded. This means that a transaction in an indeterminate result state is expected during the sending to processor phase. However, if the transaction remains in that state for an excessive amount of time, something likely went wrong and the transaction will need to be reconciled. If the transaction changes from the sending to processor status but remains indeterminate, the transaction will also require reconciliation in that scenario.
Some situations which may lead to an indeterminate result:
- A transaction is sent to the processor, but a network error prevents us from receiving the response
- A transaction is sent to the processor, but the processor returns an unexpected error (e.g. 500 internal server error)
- A transaction is sent to the processor and a response is received, but cannot be recorded because Cart Services is down
- A transaction is sent to the processor and a response is received, but cannot be recorded because the database is down
-
setDateRecorded
The timestamp when this transaction response was recorded- Parameters:
dateRecorded
- The timestamp when this transaction response was recorded
-
setGatewayResponseCode
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
-
setMessage
Message describing the result of the transaction- Parameters:
message
- Message describing the result of the transaction
-
setTransactionAmount
public void setTransactionAmount(javax.money.MonetaryAmount transactionAmount) The transaction amount that we're expecting to execute against thePayment
. This amount must be valid according to what's available for thePayment
. If specified, the amount details should be equal to this amount using the following equation: transactionAmount =subtotal
+fulfillmentTotal
+feesTotal
-adjustmentsTotal
+taxTotal
-includedTaxTotal
.- Parameters:
transactionAmount
- The transaction amount that we're expecting to execute against thePayment
.
-
setSubtotal
public void setSubtotal(javax.money.MonetaryAmount subtotal) The payment's total usually excluding adjustments, tax, fees, and shipping.- Parameters:
subtotal
- The payment's total usually excluding adjustments, tax, fees, and shipping.
-
setAdjustmentsTotal
public void setAdjustmentsTotal(javax.money.MonetaryAmount adjustmentsTotal) The payment's adjustments (a.k.a discounts) total, usually excluding shipping/fulfillment discounts.- Parameters:
adjustmentsTotal
- The payment's adjustments (a.k.a discounts) total, usually excluding shipping/fulfillment discounts.
-
setFulfillmentTotal
public void setFulfillmentTotal(javax.money.MonetaryAmount fulfillmentTotal) The payment's total fulfillment cost.- Parameters:
fulfillmentTotal
- The payment's total fulfillment cost.
-
setFeesTotal
public void setFeesTotal(javax.money.MonetaryAmount feesTotal) The total fees related to thetransactionAmount
- Parameters:
feesTotal
- The total fees related to thetransactionAmount
-
setTaxTotal
public void setTaxTotal(javax.money.MonetaryAmount taxTotal) The payment's total tax cost.- Parameters:
taxTotal
- The payment's total tax cost.
-
setIncludedTaxTotal
public void setIncludedTaxTotal(javax.money.MonetaryAmount includedTaxTotal) The amount of taxes that are included in the subtotal (VAT).- Parameters:
includedTaxTotal
- The amount of taxes that are included in the subtotal (VAT).
-
setNextAction
public void setNextAction(com.broadleafcommerce.paymentgateway.domain.NextAction nextAction) The next step required for the payment gateway to continue processing this payment.- Parameters:
nextAction
- The next step required for the payment gateway to continue processing this payment.
-
setAttributes
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
-
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-
nextAction