Class PaymentTransactionRef
- All Implemented Interfaces:
- Serializable
- Author:
- Chris Kittrell (ckittrell)
- See Also:
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected booleanbooleanjavax.money.MonetaryAmountThe payment's adjustments (a.k.a discounts) total, usually excluding shipping/fulfillment discounts.javax.money.MonetaryAmountThe amount related to this transaction.Map of specific attributes that have been gathered from the raw response.javax.money.CurrencyUnitThe currency gathered fromgetAmount()The timestamp when this transaction response was recordedThe type of transaction failurejavax.money.MonetaryAmountThe total fees related to theamountjavax.money.MonetaryAmountThe 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.The type of this transaction, as described by the gateway.getId()The payment transaction's id.javax.money.MonetaryAmountThe amount of taxes that are included in the subtotal (VAT).The state of this transaction - e.g.Describes the reason for themanagementState.Describes the outcome of the manual review of a transaction after it was flagged by fraud checks.Describes the reason for approving/rejecting a transaction during a manual fraud review.The next step required for the payment gateway to continue processing this payment.The id of the parent source entity of the transaction that proceeded this transaction.The type of the parent source entity of the transaction that proceeded this transaction.The id of the parent payment transaction.The payment's id.The list ofrequestIdsthat were previously used for this transaction.The id used to represent the request that produced this transaction.The name of the system that initiated the transaction - e.g.The ID of the source entity associated with the transaction.The type of the source entity associated with the transaction.The status of the transactionjavax.money.MonetaryAmountThe payment's total usually excluding adjustments, tax, fees, and shipping.javax.money.MonetaryAmountThe payment's total tax cost.The transaction id known by the payment gateway.getType()The type of this transaction (authorize, capture, refund, etc.)inthashCode()booleanIndicates that the payment transaction has been flagged for manual review via fraud checks.booleanTells if this transaction has an indeterminate result.voidsetAdjustmentsTotal(javax.money.MonetaryAmount adjustmentsTotal) The payment's adjustments (a.k.a discounts) total, usually excluding shipping/fulfillment discounts.voidsetAmount(javax.money.MonetaryAmount amount) The amount related to this transaction.voidsetAttributes(Map<String, String> attributes) Map of specific attributes that have been gathered from the raw response.voidsetDateRecorded(Instant dateRecorded) The timestamp when this transaction response was recordedvoidsetFailureType(String failureType) The type of transaction failurevoidsetFeesTotal(javax.money.MonetaryAmount feesTotal) The total fees related to theamountvoidsetFlaggedForManualReview(boolean flaggedForManualReview) Indicates that the payment transaction has been flagged for manual review via fraud checks.voidsetFulfillmentTotal(javax.money.MonetaryAmount fulfillmentTotal) The payment's total fulfillment cost.voidsetGatewayResponseCode(String gatewayResponseCode) The response code provided by the payment gateway which may represent a success or failurevoidsetGatewayTransactionId(String gatewayTransactionId) The gateway-specific id for the transaction.voidsetGatewayTransactionType(String gatewayTransactionType) The type of this transaction, as described by the gateway.voidThe payment transaction's id.voidsetIncludedTaxTotal(javax.money.MonetaryAmount includedTaxTotal) The amount of taxes that are included in the subtotal (VAT).voidsetIndeterminateResult(boolean indeterminateResult) Tells if this transaction has an indeterminate result.voidsetManagementState(String managementState) The state of this transaction - e.g.voidsetManagementStateReason(String managementStateReason) Describes the reason for themanagementState.voidsetManualReviewResult(String manualReviewResult) Describes the outcome of the manual review of a transaction after it was flagged by fraud checks.voidsetManualReviewResultReason(String manualReviewResultReason) Describes the reason for approving/rejecting a transaction during a manual fraud review.voidsetNextAction(NextAction nextAction) The next step required for the payment gateway to continue processing this payment.voidsetParentSourceEntityId(String parentSourceEntityId) The id of the parent source entity of the transaction that proceeded this transaction.voidsetParentSourceEntityType(String parentSourceEntityType) The type of the parent source entity of the transaction that proceeded this transaction.voidsetParentTransactionId(String parentTransactionId) The id of the parent payment transaction.voidsetPaymentId(String paymentId) The payment's id.voidsetPreviousRequestIds(List<String> previousRequestIds) The list ofrequestIdsthat were previously used for this transaction.voidsetRequestId(String requestId) The id used to represent the request that produced this transaction.voidThe name of the system that initiated the transaction - e.g.voidsetSourceEntityId(String sourceEntityId) The ID of the source entity associated with the transaction.voidsetSourceEntityType(String sourceEntityType) The type of the source entity associated with the transaction.voidThe status of the transactionvoidsetSubtotal(javax.money.MonetaryAmount subtotal) The payment's total usually excluding adjustments, tax, fees, and shipping.voidsetTaxTotal(javax.money.MonetaryAmount taxTotal) The payment's total tax cost.voidsetTransactionReferenceId(String transactionReferenceId) The transaction id known by the payment gateway.voidThe type of this transaction (authorize, capture, refund, etc.)toString()booleanWhether this transaction was successful based ongetStatus().
- 
Constructor Details- 
PaymentTransactionRefpublic PaymentTransactionRef()
 
- 
- 
Method Details- 
wasSuccessfulpublic boolean wasSuccessful()Whether this transaction was successful based ongetStatus().- Returns:
- Whether this transaction was successful.
- See Also:
 
- 
getCurrency@Nullable public javax.money.CurrencyUnit getCurrency()The currency gathered fromgetAmount()- Returns:
- The currency gathered from the amount
 
- 
getIdThe payment transaction's id.- Returns:
- The payment transaction's id.
 
- 
getParentTransactionIdThe 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 PaymentTransaction.
 
- 
getPaymentIdThe payment's id.- Returns:
- The payment's id.
 
- 
getRequestIdThe id used to represent the request that produced this transaction.- Returns:
- The id used to represent the request that produced this transaction
 
- 
getPreviousRequestIdsThe list ofrequestIdsthat were previously used for this transaction.Note: if the transaction is reused for multiple requests, then the requestIdshould be updated with the latest value, & the previous value should be stored in this collection.- Returns:
- The list of request ids that were previously used for this transaction.
 
- 
getTransactionReferenceIdThe 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
 
- 
getGatewayTransactionIdThe gateway-specific id for the transaction.- Returns:
- The gateway-specific id for the transaction
 
- 
getTypeThe type of this transaction (authorize, capture, refund, etc.)- Returns:
- The type of this transaction (authorize, capture, refund, etc.)
 
- 
getGatewayTransactionTypeThe type of this transaction, as described by the gateway.- Returns:
- The type of this transaction, as described by the gateway.
 
- 
getStatusThe status of the transaction- Returns:
- The status of the transaction
- See Also:
 
- 
getGatewayResponseCodeThe 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
 
- 
getFailureTypeThe type of transaction failure- Returns:
- The type of transaction failure
 
- 
getAmountpublic javax.money.MonetaryAmount getAmount()The amount related to this transaction. Depending on thetype, this may be the amount authorized, captured, refunded, etc.- Returns:
- The amount related to this transaction
 
- 
getSubtotalpublic javax.money.MonetaryAmount getSubtotal()The payment's total usually excluding adjustments, tax, fees, and shipping.Note: Only the amountis required, but if this value is included, then thefulfillmentTotal,feesTotal,adjustmentsTotal,taxTotal, &includedTaxTotalshould be included also.- Returns:
- The payment's total usually excluding adjustments, tax, fees, and shipping.
 
- 
getAdjustmentsTotalpublic javax.money.MonetaryAmount getAdjustmentsTotal()The payment's adjustments (a.k.a discounts) total, usually excluding shipping/fulfillment discounts.Note: Only the amountis required, but if this value is included, then thesubtotal,fulfillmentTotal,feesTotal,taxTotal, &includedTaxTotalshould be included also.- Returns:
- The payment's adjustments (a.k.a discounts) total, usually excluding shipping/fulfillment discounts.
 
- 
getFulfillmentTotalpublic javax.money.MonetaryAmount getFulfillmentTotal()The payment's total fulfillment cost.Note: Only the amountis required, but if this value is included, then thesubtotal,feesTotal,adjustmentsTotal,taxTotal, &includedTaxTotalshould be included also.- Returns:
- The payment's total fulfillment cost.
 
- 
getFeesTotalpublic javax.money.MonetaryAmount getFeesTotal()The total fees related to theamountNote: Only the amountis required, but if this value is included, then thesubtotal,fulfillmentTotal,adjustmentsTotal,taxTotal, &includedTaxTotalshould be included also.- Returns:
- The total fees related to the amount
 
- 
getTaxTotalpublic javax.money.MonetaryAmount getTaxTotal()The payment's total tax cost.Note: Only the amountis required, but if this value is included, then thesubtotal,fulfillmentTotal,feesTotal,adjustmentsTotal, &includedTaxTotalshould be included also.- Returns:
- The payment's total tax cost.
 
- 
getIncludedTaxTotalpublic javax.money.MonetaryAmount getIncludedTaxTotal()The amount of taxes that are included in the subtotal (VAT).Note: Only the amountis required, but if this value is included, then thesubtotal,fulfillmentTotal,feesTotal,adjustmentsTotal, &taxTotalshould be included also.- Returns:
- The amount of taxes that are included in the subtotal (VAT).
 
- 
getSourceThe name of the system that initiated the transaction - e.g. CART_OPERATION_SERVICES vs ORDER_OPERATION_SERVICES.- Returns:
- The name of the system that initiated the transaction
 
- 
getSourceEntityTypeThe type of the source entity associated with the transaction. For example, "CHECKOUT_REQUEST" or "ORDER_FULFILLMENT".- Returns:
- The type of the source entity associated with the transaction
 
- 
getSourceEntityIdThe ID of the source entity associated with the transaction.For example, if getSourceEntityType()isORDER_FULFILLMENT, this would be the ID of theOrderFulfillment.- Returns:
- The ID of the source entity associated with the transaction
- See Also:
 
- 
getParentSourceEntityTypeThe type of the parent source entity of the transaction that proceeded this transaction.This is used to identify the parent transaction instead of using the parent transaction id itself, because other systems have no knowledge of specific transactions. For example, the execution of a refund transaction requires a proceeding capture or authorize and capture transaction. Let's say the proceeding capture transaction has the source entity type of ORDER_FULFILLMENT, and the refund transaction has the entity source type ofRETURN_CONFIRMATION. In this case, the refund transaction request needs the parent source entity type ofORDER_FULFILLMENTand its id in order to identify the parent capture transaction.- Returns:
- The type of the parent source entity of the transaction that proceeded this transaction
 
- 
getParentSourceEntityIdThe id of the parent source entity of the transaction that proceeded this transaction.- Returns:
- The id of the parent source entity of the transaction that proceeded this transaction
- See Also:
 
- 
getManagementStateThe state of this transaction - e.g. whether the transaction is scheduled for reversal or if it's being used in an active checkout. If the transaction was not successful, then we expect this value to be null.- Returns:
- The state of this transaction
 
- 
getManagementStateReasonDescribes the reason for themanagementState.- Returns:
- The reason for the managementState value
 
- 
isFlaggedForManualReviewpublic 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
 
- 
getManualReviewResultDescribes the outcome of the manual review of a transaction after it was flagged by fraud checks.- Returns:
- The outcome of the manual review of a transaction after it was flagged by fraud checks.
 
- 
getManualReviewResultReasonDescribes the reason for approving/rejecting a transaction during a manual fraud review.- Returns:
- The reason for approving/rejecting a transaction during a manual fraud review.
 
- 
getDateRecordedThe timestamp when this transaction response was recorded- Returns:
- The timestamp when this transaction response was recorded
 
- 
isIndeterminateResultpublic 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
 
- 
getNextActionThe next step required for the payment gateway to continue processing this payment.- Returns:
- The next step required for the payment gateway to continue processing this payment.
 
- 
getAttributesMap 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
 
- 
setIdThe payment transaction's id.- Parameters:
- id- The payment transaction's id.
 
- 
setParentTransactionIdThe 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 PaymentTransaction.
 
- 
setPaymentIdThe payment's id.- Parameters:
- paymentId- The payment's id.
 
- 
setRequestIdThe id used to represent the request that produced this transaction.- Parameters:
- requestId- The id used to represent the request that produced this transaction
 
- 
setPreviousRequestIdsThe list ofrequestIdsthat were previously used for this transaction.Note: if the transaction is reused for multiple requests, then the requestIdshould be updated with the latest value, & the previous value should be stored in this collection.- Parameters:
- previousRequestIds- The list of request ids that were previously used for this transaction.
 
- 
setTransactionReferenceIdThe 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
 
- 
setGatewayTransactionIdThe gateway-specific id for the transaction.- Parameters:
- gatewayTransactionId- The gateway-specific id for the transaction
 
- 
setTypeThe type of this transaction (authorize, capture, refund, etc.)- Parameters:
- type- The type of this transaction
 
- 
setGatewayTransactionTypeThe type of this transaction, as described by the gateway.- Parameters:
- gatewayTransactionType- The type of this transaction, as described by the gateway.
 
- 
setStatusThe status of the transaction- Parameters:
- status- The status of the transaction
- See Also:
 
- 
setGatewayResponseCodeThe 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
 
- 
setFailureTypeThe type of transaction failure- Parameters:
- failureType- The type of transaction failure
 
- 
setAmountpublic void setAmount(javax.money.MonetaryAmount amount) The amount related to this transaction. Depending on thetype, this may be the amount authorized, captured, refunded, etc.- Parameters:
- amount- The amount related to this transaction
 
- 
setSubtotalpublic void setSubtotal(javax.money.MonetaryAmount subtotal) The payment's total usually excluding adjustments, tax, fees, and shipping.Note: Only the amountis required, but if this value is included, then thefulfillmentTotal,feesTotal,adjustmentsTotal,taxTotal, &includedTaxTotalshould be included also.- Parameters:
- subtotal- The payment's total usually excluding adjustments, tax, fees, and shipping.
 
- 
setAdjustmentsTotalpublic void setAdjustmentsTotal(javax.money.MonetaryAmount adjustmentsTotal) The payment's adjustments (a.k.a discounts) total, usually excluding shipping/fulfillment discounts.Note: Only the amountis required, but if this value is included, then thesubtotal,fulfillmentTotal,feesTotal,taxTotal, &includedTaxTotalshould be included also.- Parameters:
- adjustmentsTotal- The payment's adjustments (a.k.a discounts) total, usually excluding shipping/fulfillment discounts.
 
- 
setFulfillmentTotalpublic void setFulfillmentTotal(javax.money.MonetaryAmount fulfillmentTotal) The payment's total fulfillment cost.Note: Only the amountis required, but if this value is included, then thesubtotal,feesTotal,adjustmentsTotal,taxTotal, &includedTaxTotalshould be included also.- Parameters:
- fulfillmentTotal- The payment's total fulfillment cost.
 
- 
setFeesTotalpublic void setFeesTotal(javax.money.MonetaryAmount feesTotal) The total fees related to theamountNote: Only the amountis required, but if this value is included, then thesubtotal,fulfillmentTotal,adjustmentsTotal,taxTotal, &includedTaxTotalshould be included also.- Parameters:
- feesTotal- The total fees related to the- amount
 
- 
setTaxTotalpublic void setTaxTotal(javax.money.MonetaryAmount taxTotal) The payment's total tax cost.Note: Only the amountis required, but if this value is included, then thesubtotal,fulfillmentTotal,feesTotal,adjustmentsTotal, &includedTaxTotalshould be included also.- Parameters:
- taxTotal- The payment's total tax cost.
 
- 
setIncludedTaxTotalpublic void setIncludedTaxTotal(javax.money.MonetaryAmount includedTaxTotal) The amount of taxes that are included in the subtotal (VAT).Note: Only the amountis required, but if this value is included, then thesubtotal,fulfillmentTotal,feesTotal,adjustmentsTotal, &taxTotalshould be included also.- Parameters:
- includedTaxTotal- The amount of taxes that are included in the subtotal (VAT).
 
- 
setSourceThe name of the system that initiated the transaction - e.g. CART_OPERATION_SERVICES vs ORDER_OPERATION_SERVICES.- Parameters:
- source- The name of the system that initiated the transaction
 
- 
setSourceEntityTypeThe type of the source entity associated with the transaction. For example, "CHECKOUT_REQUEST" or "ORDER_FULFILLMENT".- Parameters:
- sourceEntityType- The type of the source entity associated with the transaction
 
- 
setSourceEntityIdThe ID of the source entity associated with the transaction.For example, if getSourceEntityType()isORDER_FULFILLMENT, this would be the ID of theOrderFulfillment.- Parameters:
- sourceEntityId- The ID of the source entity associated with the transaction
- See Also:
 
- 
setParentSourceEntityTypeThe type of the parent source entity of the transaction that proceeded this transaction.This is used to identify the parent transaction instead of using the parent transaction id itself, because other systems have no knowledge of specific transactions. For example, the execution of a refund transaction requires a proceeding capture or authorize and capture transaction. Let's say the proceeding capture transaction has the source entity type of ORDER_FULFILLMENT, and the refund transaction has the entity source type ofRETURN_CONFIRMATION. In this case, the refund transaction request needs the parent source entity type ofORDER_FULFILLMENTand its id in order to identify the parent capture transaction.- Parameters:
- parentSourceEntityType- The type of the parent source entity of the transaction that proceeded this transaction
 
- 
setParentSourceEntityIdThe id of the parent source entity of the transaction that proceeded this transaction.- Parameters:
- parentSourceEntityId- The id of the parent source entity of the transaction that proceeded this transaction
- See Also:
 
- 
setManagementStateThe state of this transaction - e.g. whether the transaction is scheduled for reversal or if it's being used in an active checkout. If the transaction was not successful, then we expect this value to be null.- Parameters:
- managementState- The state of this transaction
 
- 
setManagementStateReasonDescribes the reason for themanagementState.- Parameters:
- managementStateReason- The reason for the managementState value
 
- 
setFlaggedForManualReviewpublic 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
 
- 
setManualReviewResultDescribes the outcome of the manual review of a transaction after it was flagged by fraud checks.- Parameters:
- manualReviewResult- The outcome of the manual review of a transaction after it was flagged by fraud checks.
 
- 
setManualReviewResultReasonDescribes the reason for approving/rejecting a transaction during a manual fraud review.- Parameters:
- manualReviewResultReason- The reason for approving/rejecting a transaction during a manual fraud review.
 
- 
setDateRecordedThe timestamp when this transaction response was recorded- Parameters:
- dateRecorded- The timestamp when this transaction response was recorded
 
- 
setIndeterminateResultpublic 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
 
- 
setNextActionThe 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.
 
- 
setAttributesMap 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
- 
hashCodepublic int hashCode()
- 
toString
 
-