Class TransactionExecutionDetail

java.lang.Object
com.broadleafcommerce.paymenttransaction.web.endpoint.domain.TransactionExecutionDetail
All Implemented Interfaces:
Serializable

public class TransactionExecutionDetail extends Object implements Serializable
Object describing the resulting transaction detail.
Author:
Chris Kittrell (ckittrell)
See Also:
  • Constructor Details

    • TransactionExecutionDetail

      public TransactionExecutionDetail()
  • Method Details

    • wasSuccessful

      public boolean wasSuccessful()
      Whether this transaction was successful based on getTransactionStatus().
      Returns:
      Whether or not this transaction was successful.
      See Also:
    • getThreeDSecureVerificationUrl

      public String getThreeDSecureVerificationUrl()
    • getNextAction

      public com.broadleafcommerce.paymentgateway.domain.NextAction getNextAction()
    • getTransactionId

      public String getTransactionId()
      The id of the executed transaction.
      Returns:
      The id of the executed transaction.
    • getParentTransactionId

      public String getParentTransactionId()
      The id of the parent PaymentTransaction. 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

      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
    • getGatewayTransactionId

      public String getGatewayTransactionId()
      The gateway-specific id for the transaction.
      Returns:
      The gateway-specific id for the transaction
    • getTransactionManagementState

      public String 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

      public String getTransactionStatus()
      The status of the transaction.
      Returns:
      The status of the transaction.
      See Also:
    • 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)
    • 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

      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
    • getMessage

      public String 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 the Payment. This amount must be valid according to what's available for the Payment. 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 the transactionAmount
      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

      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
    • setTransactionId

      public void setTransactionId(String transactionId)
      The id of the executed transaction.
      Parameters:
      transactionId - The id of the executed transaction.
    • setParentTransactionId

      public void setParentTransactionId(String parentTransactionId)
      The id of the parent PaymentTransaction. 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

      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
    • setGatewayTransactionId

      public void setGatewayTransactionId(String gatewayTransactionId)
      The gateway-specific id for the transaction.
      Parameters:
      gatewayTransactionId - The gateway-specific id for the transaction
    • setTransactionManagementState

      public void setTransactionManagementState(String transactionManagementState)
      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

      public void setTransactionStatus(String transactionStatus)
      The status of the transaction.
      Parameters:
      status - The status of the transaction.
      See Also:
    • 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)
    • 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 public void setThreeDSecureVerificationUrl(String threeDSecureVerificationUrl)
      Deprecated.
      in favor of nextAction
      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

      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
    • setMessage

      public void setMessage(String message)
      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 the Payment. This amount must be valid according to what's available for the Payment. 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 the Payment.
    • 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 the transactionAmount
      Parameters:
      feesTotal - The total fees related to the transactionAmount
    • 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

      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
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object