Class PaymentSummary
- java.lang.Object
-
- com.broadleafcommerce.orderoperation.domain.payment.PaymentSummary
-
- All Implemented Interfaces:
Serializable
public class PaymentSummary extends Object implements Serializable
The domain that summarizes the current state of transactions against the payment.- Author:
- Dima Myroniuk (dmyroniuk)
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description PaymentSummary()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleancanEqual(Object other)booleanequals(Object o)com.broadleafcommerce.order.common.domain.AddressgetAddress(String addressType)Gathers one of the payment's relatedaddressesby typeMap<String,com.broadleafcommerce.order.common.domain.Address>getAddressByType()The collection of related addresses that may include billing or shipping addressesjavax.money.MonetaryAmountgetAdjustmentsTotal()The payment's adjustments (a.k.a discounts) total, usually excluding shipping/fulfillment discounts.javax.money.MonetaryAmountgetAmount()The amount for which this payment is allotted.javax.money.MonetaryAmountgetAmountAuthorized()The total authorized amount for capture.javax.money.MonetaryAmountgetAmountAvailableForAuthorize()Determines the amount that can be authorized for this payment summaryjavax.money.MonetaryAmountgetAmountAvailableForAuthorizeAndCapture()Determines the amount that can be authorized and captured for this payment summaryjavax.money.MonetaryAmountgetAmountAvailableForCapture()Determines the amount that can be captured for this payment summaryjavax.money.MonetaryAmountgetAmountAvailableForRefund()Determines the amount that can be refunded for this payment summaryjavax.money.MonetaryAmountgetAmountAvailableForReverseAuthorization()Determines the amount that can be reverse-authorized for this payment summaryjavax.money.MonetaryAmountgetAmountCaptured()The total captured amount.javax.money.MonetaryAmountgetAmountCredited()The total detached credit amount.javax.money.MonetaryAmountgetAmountRefunded()The total refunded amount.Map<String,String>getAttributes()General use map to capture any additional attributes needed for this Paymentcom.broadleafcommerce.order.common.domain.AddressgetBillingAddress()javax.money.MonetaryAmountgetCaptureAmountAwaitingResult()The total amount sent to the payment gateway for capture, and is waiting for a response about the transaction result.javax.money.CurrencyUnitgetCurrency()The currency gathered fromgetAmount()Map<String,String>getDisplayAttributes()General use map to capture any display properties for this Paymentjavax.money.MonetaryAmountgetFulfillmentTotal()The payment's total fulfillment costStringgetGatewayType()The gateway used to process this payment.StringgetName()The name of this payment.StringgetPaymentId()The id of this payment.javax.money.MonetaryAmountgetRefundAmountAwaitingResult()The total amount sent to the payment gateway for refund, and is waiting for a response about the transaction result.javax.money.MonetaryAmountgetReverseAuthorizeAmountAwaitingResult()The total amount sent to the payment gateway for reverse authorize, and is waiting for a response about the transaction result.javax.money.MonetaryAmountgetSubtotal()The payment's total usually excluding adjustments, tax, and shipping.javax.money.MonetaryAmountgetTaxTotal()The payment's total tax costStringgetType()The type of this payment like Credit Card or Gift Card.IntegergetVersion()The version of this payment.inthashCode()booleanisFullyAuthorized()Determines if the payment summary is fully authorizedbooleanisFullyCaptured()Determines if the payment summary is fully capturedbooleanisPartiallyCaptured()Determines if the payment summary is partially capturedbooleanisPartialReverseAuthSupported()Whether a portion of an authorization transaction can be reversed, or if the full authorization transaction must be reversed.booleanisSingleUsePaymentMethod()Whether or not the underlying payment method can only be used once.voidsetAddressByType(Map<String,com.broadleafcommerce.order.common.domain.Address> addressByType)The collection of related addresses that may include billing or shipping addressesvoidsetAdjustmentsTotal(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 for which this payment is allotted.voidsetAmountAuthorized(javax.money.MonetaryAmount amountAuthorized)The total authorized amount for capture.voidsetAmountAvailableForAuthorize(javax.money.MonetaryAmount amountAvailableForAuthorize)Determines the amount that can be authorized for this payment summaryvoidsetAmountAvailableForAuthorizeAndCapture(javax.money.MonetaryAmount amountAvailableForAuthorizeAndCapture)Determines the amount that can be authorized and captured for this payment summaryvoidsetAmountAvailableForCapture(javax.money.MonetaryAmount amountAvailableForCapture)Determines the amount that can be captured for this payment summaryvoidsetAmountAvailableForRefund(javax.money.MonetaryAmount amountAvailableForRefund)Determines the amount that can be refunded for this payment summaryvoidsetAmountAvailableForReverseAuthorization(javax.money.MonetaryAmount amountAvailableForReverseAuthorization)Determines the amount that can be reverse-authorized for this payment summaryvoidsetAmountCaptured(javax.money.MonetaryAmount amountCaptured)The total captured amount.voidsetAmountCredited(javax.money.MonetaryAmount amountCredited)The total detached credit amount.voidsetAmountRefunded(javax.money.MonetaryAmount amountRefunded)The total refunded amount.voidsetAttributes(Map<String,String> attributes)General use map to capture any additional attributes needed for this PaymentvoidsetCaptureAmountAwaitingResult(javax.money.MonetaryAmount captureAmountAwaitingResult)The total amount sent to the payment gateway for capture, and is waiting for a response about the transaction result.voidsetDisplayAttributes(Map<String,String> displayAttributes)General use map to capture any display properties for this PaymentvoidsetFulfillmentTotal(javax.money.MonetaryAmount fulfillmentTotal)The payment's total fulfillment costvoidsetFullyAuthorized(boolean fullyAuthorized)Determines if the payment summary is fully authorizedvoidsetFullyCaptured(boolean fullyCaptured)Determines if the payment summary is fully capturedvoidsetGatewayType(String gatewayType)The gateway used to process this payment.voidsetName(String name)The name of this payment.voidsetPartiallyCaptured(boolean partiallyCaptured)Determines if the payment summary is partially capturedvoidsetPartialReverseAuthSupported(boolean partialReverseAuthSupported)Whether a portion of an authorization transaction can be reversed, or if the full authorization transaction must be reversed.voidsetPaymentId(String paymentId)The id of this payment.voidsetRefundAmountAwaitingResult(javax.money.MonetaryAmount refundAmountAwaitingResult)The total amount sent to the payment gateway for refund, and is waiting for a response about the transaction result.voidsetReverseAuthorizeAmountAwaitingResult(javax.money.MonetaryAmount reverseAuthorizeAmountAwaitingResult)The total amount sent to the payment gateway for reverse authorize, and is waiting for a response about the transaction result.voidsetSingleUsePaymentMethod(boolean isSingleUsePaymentMethod)Whether or not the underlying payment method can only be used once.voidsetSubtotal(javax.money.MonetaryAmount subtotal)The payment's total usually excluding adjustments, tax, and shipping.voidsetTaxTotal(javax.money.MonetaryAmount taxTotal)The payment's total tax costvoidsetType(String type)The type of this payment like Credit Card or Gift Card.voidsetVersion(Integer version)The version of this payment.StringtoString()
-
-
-
Method Detail
-
getAddress
@Nullable public com.broadleafcommerce.order.common.domain.Address getAddress(String addressType)
Gathers one of the payment's relatedaddressesby type- Returns:
- The payment's related address identified by type
-
getBillingAddress
@Nullable public com.broadleafcommerce.order.common.domain.Address getBillingAddress()
-
getCurrency
@Nullable public javax.money.CurrencyUnit getCurrency()
The currency gathered fromgetAmount()- Returns:
- The currency gathered from the amount
-
getPaymentId
public String getPaymentId()
The id of this payment.- Returns:
- The id of this payment.
-
getName
public String getName()
The name of this payment. This name is typically something like "Visa ending in 1234".- Returns:
- The name of this payment.
-
getType
public String getType()
The type of this payment like Credit Card or Gift Card.- Returns:
- The type of this payment like Credit Card or Gift Card.
-
getGatewayType
public String getGatewayType()
The gateway used to process this payment. Only a SINGLE payment gateway can modify transactions on a particular payment.- Returns:
- The gateway used to process this payment.
-
getAddressByType
public Map<String,com.broadleafcommerce.order.common.domain.Address> getAddressByType()
The collection of related addresses that may include billing or shipping addresses- Returns:
- The collection of related addresses
-
getAttributes
public Map<String,String> getAttributes()
General use map to capture any additional attributes needed for this Payment- Returns:
- General use map to capture any additional attributes needed for this Payment
-
getDisplayAttributes
public Map<String,String> getDisplayAttributes()
General use map to capture any display properties for this Payment- Returns:
- General use map to capture any display properties for this Payment
-
isSingleUsePaymentMethod
public boolean isSingleUsePaymentMethod()
Whether or not the underlying payment method can only be used once. In most cases, we're managing a single-use token that represents a credit card. This flag is especially important for managing payments with successful transactions. In those cases, the token has already been used and cannot be reused. If we need modify the payment's amount, then we may actually need to archive the existing payment, and create a new payment, with a new underlying token. Additionally, this flag is helpful when needing to re-authorize an expired authorization transaction. In that case, if the payment represents a single-use payment method, then the re-authorization may not be possible, and you'll need to seek an alternative form of payment.- Returns:
- Whether or not the underlying payment method can only be used once
-
getAmount
public javax.money.MonetaryAmount getAmount()
The amount for which this payment is allotted. The summation of all of thepaymentsfor a particular cart should equal the cart's total. If specified, the amount details (subtotal,adjustmentsTotal,fulfillmentTotal, &taxTotal) should sum together to equal this amount.- Returns:
- The amount for which this payment is allotted.
-
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
-
getAmountAuthorized
public javax.money.MonetaryAmount getAmountAuthorized()
The total authorized amount for capture. This value is calculated as "total authorized - total reverse-authed".- Returns:
- the total authorized amount for capture
-
getAmountCaptured
public javax.money.MonetaryAmount getAmountCaptured()
The total captured amount. This value is calculated as "total captured - total refunded - total voided".- Returns:
- the total captured amount
-
getAmountRefunded
public javax.money.MonetaryAmount getAmountRefunded()
The total refunded amount.- Returns:
- the total refunded amount
-
getAmountCredited
public javax.money.MonetaryAmount getAmountCredited()
The total detached credit amount.- Returns:
- the total detached credit amount
-
getCaptureAmountAwaitingResult
public javax.money.MonetaryAmount getCaptureAmountAwaitingResult()
The total amount sent to the payment gateway for capture, and is waiting for a response about the transaction result.This value should only be present for payment gateways that support asynchronous transaction executions.
- Returns:
- the total amount sent to the payment gateway for capture and is waiting for a response about the transaction result
-
getReverseAuthorizeAmountAwaitingResult
public javax.money.MonetaryAmount getReverseAuthorizeAmountAwaitingResult()
The total amount sent to the payment gateway for reverse authorize, and is waiting for a response about the transaction result.This value should only be present for payment gateways that support asynchronous transaction executions.
- Returns:
- the total amount sent to the payment gateway for reverse authorize and is waiting for a response about the transaction result
-
getRefundAmountAwaitingResult
public javax.money.MonetaryAmount getRefundAmountAwaitingResult()
The total amount sent to the payment gateway for refund, and is waiting for a response about the transaction result.This value should only be present for payment gateways that support asynchronous transaction executions.
- Returns:
- the total amount sent to the payment gateway for refund and is waiting for a response about the transaction result
-
getVersion
public Integer getVersion()
The version of this payment. Used for checking that the requested version of the payment is up-to-date before saving changes. Required for any request which results in an update being made to the payment. This should never be manually incremented/decremented.
-
isPartialReverseAuthSupported
public boolean isPartialReverseAuthSupported()
Whether a portion of an authorization transaction can be reversed, or if the full authorization transaction must be reversed.- Returns:
- Whether a portion of an authorization transaction can be reversed.
-
getAmountAvailableForAuthorize
public javax.money.MonetaryAmount getAmountAvailableForAuthorize()
Determines the amount that can be authorized for this payment summary- Returns:
- The amount that is available for authorize
-
getAmountAvailableForCapture
public javax.money.MonetaryAmount getAmountAvailableForCapture()
Determines the amount that can be captured for this payment summary- Returns:
- The amount that is available for capture
-
getAmountAvailableForAuthorizeAndCapture
public javax.money.MonetaryAmount getAmountAvailableForAuthorizeAndCapture()
Determines the amount that can be authorized and captured for this payment summary- Returns:
- The amount that is available for authorize and capture
-
getAmountAvailableForReverseAuthorization
public javax.money.MonetaryAmount getAmountAvailableForReverseAuthorization()
Determines the amount that can be reverse-authorized for this payment summary- Returns:
- The amount that is available for reverse-authorized
-
getAmountAvailableForRefund
public javax.money.MonetaryAmount getAmountAvailableForRefund()
Determines the amount that can be refunded for this payment summary- Returns:
- The amount that is available for refund
-
isFullyAuthorized
public boolean isFullyAuthorized()
Determines if the payment summary is fully authorized- Returns:
- true if the payment summary has authorized the full amount, false otherwise
-
isFullyCaptured
public boolean isFullyCaptured()
Determines if the payment summary is fully captured- Returns:
- true if the payment summary has captured the full amount, false otherwise
-
isPartiallyCaptured
public boolean isPartiallyCaptured()
Determines if the payment summary is partially captured- Returns:
- true if the payment summary has started to capture an amount (smaller than the full amount), false otherwise
-
setPaymentId
public void setPaymentId(String paymentId)
The id of this payment.- Parameters:
id- The id of this payment.
-
setName
public void setName(String name)
The name of this payment. This name is typically something like "Visa ending in 1234".- Parameters:
name- The name of this payment.
-
setType
public void setType(String type)
The type of this payment like Credit Card or Gift Card.- Parameters:
type- The type of this payment like Credit Card or Gift Card.
-
setGatewayType
public void setGatewayType(String gatewayType)
The gateway used to process this payment. Only a SINGLE payment gateway can modify transactions on a particular payment.- Parameters:
gatewayType- The gateway used to process this payment.
-
setAddressByType
public void setAddressByType(Map<String,com.broadleafcommerce.order.common.domain.Address> addressByType)
The collection of related addresses that may include billing or shipping addresses- Parameters:
addressByType- The collection of related addresses
-
setAttributes
public void setAttributes(Map<String,String> attributes)
General use map to capture any additional attributes needed for this Payment- Parameters:
attributes- General use map to capture any additional attributes needed for this Payment
-
setDisplayAttributes
public void setDisplayAttributes(Map<String,String> displayAttributes)
General use map to capture any display properties for this Payment- Parameters:
displayAttributes- General use map to capture any display properties for this Payment
-
setSingleUsePaymentMethod
public void setSingleUsePaymentMethod(boolean isSingleUsePaymentMethod)
Whether or not the underlying payment method can only be used once. In most cases, we're managing a single-use token that represents a credit card. This flag is especially important for managing payments with successful transactions. In those cases, the token has already been used and cannot be reused. If we need modify the payment's amount, then we may actually need to archive the existing payment, and create a new payment, with a new underlying token. Additionally, this flag is helpful when needing to re-authorize an expired authorization transaction. In that case, if the payment represents a single-use payment method, then the re-authorization may not be possible, and you'll need to seek an alternative form of payment.- Parameters:
isSingleUsePaymentMethod- Whether or not the underlying payment method can only be used once
-
setAmount
public void setAmount(javax.money.MonetaryAmount amount)
The amount for which this payment is allotted. The summation of all of thepaymentsfor a particular cart should equal the cart's total. If specified, the amount details (subtotal,adjustmentsTotal,fulfillmentTotal, &taxTotal) should sum together to equal this amount.- Parameters:
amount- The amount for which this payment is allotted.
-
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
-
setAmountAuthorized
public void setAmountAuthorized(javax.money.MonetaryAmount amountAuthorized)
The total authorized amount for capture. This value is calculated as "total authorized - total reverse-authed".- Parameters:
amountAuthorized- the total authorized amount for capture
-
setAmountCaptured
public void setAmountCaptured(javax.money.MonetaryAmount amountCaptured)
The total captured amount. This value is calculated as "total captured - total refunded - total voided".- Parameters:
amountCaptured- the total captured amount
-
setAmountRefunded
public void setAmountRefunded(javax.money.MonetaryAmount amountRefunded)
The total refunded amount.- Parameters:
amountRefunded- the total refunded amount
-
setAmountCredited
public void setAmountCredited(javax.money.MonetaryAmount amountCredited)
The total detached credit amount.- Parameters:
amountCredited- the total detached credit amount
-
setCaptureAmountAwaitingResult
public void setCaptureAmountAwaitingResult(javax.money.MonetaryAmount captureAmountAwaitingResult)
The total amount sent to the payment gateway for capture, and is waiting for a response about the transaction result.This value should only be present for payment gateways that support asynchronous transaction executions.
- Parameters:
captureAmountAwaitingResult- the total amount sent to the payment gateway for capture and is waiting for a response about the transaction result
-
setReverseAuthorizeAmountAwaitingResult
public void setReverseAuthorizeAmountAwaitingResult(javax.money.MonetaryAmount reverseAuthorizeAmountAwaitingResult)
The total amount sent to the payment gateway for reverse authorize, and is waiting for a response about the transaction result.This value should only be present for payment gateways that support asynchronous transaction executions.
- Parameters:
reverseAuthorizeAmountAwaitingResult- the total amount sent to the payment gateway for reverse authorize and is waiting for a response about the transaction result
-
setRefundAmountAwaitingResult
public void setRefundAmountAwaitingResult(javax.money.MonetaryAmount refundAmountAwaitingResult)
The total amount sent to the payment gateway for refund, and is waiting for a response about the transaction result.This value should only be present for payment gateways that support asynchronous transaction executions.
- Parameters:
refundAmountAwaitingResult- the total amount sent to the payment gateway for refund and is waiting for a response about the transaction result
-
setVersion
public void setVersion(Integer version)
The version of this payment. Used for checking that the requested version of the payment is up-to-date before saving changes. Required for any request which results in an update being made to the payment. This should never be manually incremented/decremented.
-
setPartialReverseAuthSupported
public void setPartialReverseAuthSupported(boolean partialReverseAuthSupported)
Whether a portion of an authorization transaction can be reversed, or if the full authorization transaction must be reversed.- Parameters:
partialReverseAuthSupported- Whether a portion of an authorization transaction can be reversed.
-
setAmountAvailableForAuthorize
public void setAmountAvailableForAuthorize(javax.money.MonetaryAmount amountAvailableForAuthorize)
Determines the amount that can be authorized for this payment summary
-
setAmountAvailableForCapture
public void setAmountAvailableForCapture(javax.money.MonetaryAmount amountAvailableForCapture)
Determines the amount that can be captured for this payment summary
-
setAmountAvailableForAuthorizeAndCapture
public void setAmountAvailableForAuthorizeAndCapture(javax.money.MonetaryAmount amountAvailableForAuthorizeAndCapture)
Determines the amount that can be authorized and captured for this payment summary
-
setAmountAvailableForReverseAuthorization
public void setAmountAvailableForReverseAuthorization(javax.money.MonetaryAmount amountAvailableForReverseAuthorization)
Determines the amount that can be reverse-authorized for this payment summary
-
setAmountAvailableForRefund
public void setAmountAvailableForRefund(javax.money.MonetaryAmount amountAvailableForRefund)
Determines the amount that can be refunded for this payment summary
-
setFullyAuthorized
public void setFullyAuthorized(boolean fullyAuthorized)
Determines if the payment summary is fully authorized
-
setFullyCaptured
public void setFullyCaptured(boolean fullyCaptured)
Determines if the payment summary is fully captured
-
setPartiallyCaptured
public void setPartiallyCaptured(boolean partiallyCaptured)
Determines if the payment summary is partially captured
-
canEqual
protected boolean canEqual(Object other)
-
-