Class PaymentTransactionFailureDetail

  • All Implemented Interfaces:
    Serializable

    public class PaymentTransactionFailureDetail
    extends Object
    implements Serializable
    DTO for communicating the details of a failed payment transaction executed during checkout.
    Author:
    Chris Kittrell (ckittrell)
    See Also:
    Serialized Form
    • Constructor Detail

      • PaymentTransactionFailureDetail

        public PaymentTransactionFailureDetail()
    • Method Detail

      • getPaymentId

        public String getPaymentId()
        The id of the payment.
        Returns:
        The id of the payment.
      • getTransactionType

        public String getTransactionType()
        The type of transactions that were executed.
        Returns:
        The type of transactions that were executed.
        See Also:
        TransactionType
      • getTransactionId

        public String getTransactionId()
        The id of the executed transaction.
        Returns:
        The id of the executed 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:
        TransactionStatus
      • 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:
        PaymentDeclineType
      • 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.
      • getRequestId

        public String getRequestId()
        The id representing the customer's request to execute the transaction.
        Returns:
        The id representing the customer's request to execute the transaction.
      • 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
      • setPaymentId

        public void setPaymentId​(String paymentId)
        The id of the payment.
        Parameters:
        paymentId - The id of the payment.
      • setTransactionType

        public void setTransactionType​(String transactionType)
        The type of transactions that were executed.
        Parameters:
        transactionType - The type of transactions that were executed.
        See Also:
        TransactionType
      • setTransactionId

        public void setTransactionId​(String transactionId)
        The id of the executed transaction.
        Parameters:
        transactionId - The id of the executed 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:
        TransactionStatus
      • setFailureType

        public void setFailureType​(String failureType)
        The type of transaction failure
        Parameters:
        failureType - The type of transaction failure
        See Also:
        DefaultTransactionFailureTypes
      • 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:
        PaymentDeclineType
      • 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.
      • setRequestId

        public void setRequestId​(String requestId)
        The id representing the customer's request to execute the transaction.
        Parameters:
        requestId - The id representing the customer's request to execute the transaction.
      • 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