java.lang.Object
com.broadleafcommerce.cartoperation.service.provider.external.domain.payment.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:
    • isAwaitingResult

      public boolean isAwaitingResult()
      Whether this transaction is awaiting result based on getTransactionStatus().
      Returns:
      Whether or not this transaction was successful.
      See Also:
    • 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 payment transaction. 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 payment 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
    • 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
      See Also:
    • getDeclineType

      public String getDeclineType()
      The type of transaction failure (hard vs soft failure)
      Returns:
      The type of transaction failure (hard vs soft failure)
      See Also:
    • isFlaggedForManualReview

      public boolean isFlaggedForManualReview()
      Indicates that the payment transaction has been flagged for manual review via fraud checks.
      Returns:
      true if the transaction has been flagged for manual review
    • 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
    • getThreeDSecureVerificationUrl

      public String getThreeDSecureVerificationUrl()
      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.
      Returns:
      The gateway-provided url where the customer must verify that they are in fact the owner of the payment method.
    • 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
    • getTransactionAmount

      public javax.money.MonetaryAmount getTransactionAmount()
      The transaction amount that was executed against the PaymentSummary.
      Returns:
      The transaction amount that was executed against the PaymentSummary.
    • getSubtotal

      public javax.money.MonetaryAmount getSubtotal()
      The payment's total usually excluding adjustments, tax, and shipping.
      Returns:
      The payment's total usually excluding adjustments, tax, 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
    • getTaxTotal

      public javax.money.MonetaryAmount getTaxTotal()
      The payment's total tax cost
      Returns:
      The payment's total tax cost
    • getDateRecorded

      public Instant getDateRecorded()
      The timestamp when this transaction response was recorded
      Returns:
      The timestamp when this transaction response was recorded
    • 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. Note: It's very important that this does not include sensitive payment method data. Doing so will expand the PCI scope to include CartOperationServices and its related services.
      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 payment transaction. 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 payment 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
    • 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
      See Also:
    • 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)
      See Also:
    • 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 has been marked for manual review
    • 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
    • setThreeDSecureVerificationUrl

      public void setThreeDSecureVerificationUrl(String threeDSecureVerificationUrl)
      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
    • setTransactionAmount

      public void setTransactionAmount(javax.money.MonetaryAmount transactionAmount)
      The transaction amount that was executed against the PaymentSummary.
      Parameters:
      transactionAmount - The transaction amount that was executed against the PaymentSummary.
    • setSubtotal

      public void setSubtotal(javax.money.MonetaryAmount subtotal)
      The payment's total usually excluding adjustments, tax, and shipping.
    • setAdjustmentsTotal

      public void setAdjustmentsTotal(javax.money.MonetaryAmount 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
    • setTaxTotal

      public void setTaxTotal(javax.money.MonetaryAmount taxTotal)
      The payment's total tax cost
    • setDateRecorded

      public void setDateRecorded(Instant dateRecorded)
      The timestamp when this transaction response was recorded
      Parameters:
      dateRecorded - The timestamp when this transaction response was recorded
    • 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. Note: It's very important that this does not include sensitive payment method data. Doing so will expand the PCI scope to include CartOperationServices and its related services.
      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