Class SubscriptionPriceResponse
java.lang.Object
com.broadleafcommerce.cartoperation.service.provider.domain.SubscriptionPriceResponse
- All Implemented Interfaces:
Serializable
For a subscription cart item, this object describes the amount that the customer should be
charged now vs their future payments.
- Since:
- Cart Operation Service 2.3.0, Release Train 2.3.0
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAttribute(String name, Object value) Takes in any additional attributes passed in the request not matching any defined properties.protected booleanbooleanA collection ofSubscriptionActionPriceDetailobjects describing the price before & after the action for each item.Miscellaneous attributes that can be added to the response in order to provide more information.javax.money.MonetaryAmountAmount due today, which is typically captured immediately.Return any additional attributes passed in the request not matching any defined properties.Map holding any additional attributes passed in the request not matching any defined properties.javax.money.MonetaryAmountFor edits, upgrades, and downgrades on a subscription that’s using anDefaultPaymentStrategy.PREPAIDpayment strategy, the customer has already paid the full amount for this billing cycle at the previous rate.A list ofSubscriptionPriceItemDetailsdescribing the individual item prices that contributed to the overallgetAmountDueNow().A collection ofEstimatedFuturePaymentobjects describing the timing & amount of future subscription payments.getFlow()Describes the subscription action flow that is being executed.The payment strategy of the subscription, e.g.intThe frequency with which the recurring price should be charged., e.g., a value of 1 combined withperiodTypeof MONTH would indicate to a subscription service that the price should be charged every 1 month.The period type for the price, e.g.javax.money.MonetaryAmountThe subscription subtotal after to the action being taken, reflecting the typical recurring price for the subscription.javax.money.MonetaryAmountThe subscription subtotal prior to the action being taken, reflecting the typical recurring price for the subscription.javax.money.MonetaryAmountPrior to an edit, upgrade, or downgrade on a subscription that’s using a Postpaid payment strategy, the system will have prior unbilled charges that will be part of the next invoice.javax.money.MonetaryAmountThe subscription price, prorated relative to the next invoice date.The list ofAdjustmentsbeing removed with additional contextual information.Reference to the root subscriptionCartItemReference to the id of the item represented by this object.Type of item that this object represents.The timestamp at which the subscription action was taken.inthashCode()voidsetActionPriceDetails(List<SubscriptionActionPriceDetail> actionPriceDetails) A collection ofSubscriptionActionPriceDetailobjects describing the price before & after the action for each item.voidsetAdditionalAttributes(Map<String, Object> additionalAttributes) Miscellaneous attributes that can be added to the response in order to provide more information.voidsetAmountDueNow(javax.money.MonetaryAmount amountDueNow) Amount due today, which is typically captured immediately.voidsetAttributes(Map<String, Object> attributes) Map holding any additional attributes passed in the request not matching any defined properties.voidsetCreditedAmount(javax.money.MonetaryAmount creditedAmount) For edits, upgrades, and downgrades on a subscription that’s using anDefaultPaymentStrategy.PREPAIDpayment strategy, the customer has already paid the full amount for this billing cycle at the previous rate.voidsetDueNowItemDetails(List<SubscriptionItemPriceDetail> dueNowItemDetails) A list ofSubscriptionPriceItemDetailsdescribing the individual item prices that contributed to the overallgetAmountDueNow().voidsetEstimatedFuturePayments(List<EstimatedFuturePayment> estimatedFuturePayments) A collection ofEstimatedFuturePaymentobjects describing the timing & amount of future subscription payments.voidDescribes the subscription action flow that is being executed.voidsetPaymentStrategy(String paymentStrategy) The payment strategy of the subscription, e.g.voidsetPeriodFrequency(int periodFrequency) The frequency with which the recurring price should be charged., e.g., a value of 1 combined withperiodTypeof MONTH would indicate to a subscription service that the price should be charged every 1 month.voidsetPeriodType(String periodType) The period type for the price, e.g.voidsetPostActionSubtotal(javax.money.MonetaryAmount postActionSubtotal) The subscription subtotal after to the action being taken, reflecting the typical recurring price for the subscription.voidsetPreActionSubtotal(javax.money.MonetaryAmount preActionSubtotal) The subscription subtotal prior to the action being taken, reflecting the typical recurring price for the subscription.voidsetPriorUnbilledAmount(javax.money.MonetaryAmount priorUnbilledAmount) Prior to an edit, upgrade, or downgrade on a subscription that’s using a Postpaid payment strategy, the system will have prior unbilled charges that will be part of the next invoice.voidsetProratedAmount(javax.money.MonetaryAmount proratedAmount) The subscription price, prorated relative to the next invoice date.voidsetRemovedAdjustments(List<RemovedAdjustment> removedAdjustments) The list ofAdjustmentsbeing removed with additional contextual information.voidsetRootCartItemId(String rootCartItemId) Reference to the root subscriptionCartItemvoidsetRootItemRef(String rootItemRef) Reference to the id of the item represented by this object.voidsetRootItemRefType(String rootItemRefType) Type of item that this object represents.voidsetSubscriptionActionDate(Instant subscriptionActionDate) The timestamp at which the subscription action was taken.toString()
-
Constructor Details
-
SubscriptionPriceResponse
public SubscriptionPriceResponse()
-
-
Method Details
-
addAttribute
Takes in any additional attributes passed in the request not matching any defined properties.- Parameters:
name- Name of the additional attributevalue- Value of the additional attribute
-
getAttribute
Return any additional attributes passed in the request not matching any defined properties.- Returns:
- any additional attributes passed in the request not matching any defined properties.
-
getFlow
Describes the subscription action flow that is being executed.- See Also:
-
getPaymentStrategy
The payment strategy of the subscription, e.g. PREPAID vs POSTPAID- See Also:
-
DefaultPaymentStrategy
-
getSubscriptionActionDate
The timestamp at which the subscription action was taken. In most pricing contexts, the action has not been formally submitted, so we'll use today's date for making pricing calculations. -
getRootCartItemId
Reference to the root subscriptionCartItem -
getRootItemRefType
Type of item that this object represents. For example, BLC_PRODUCT. -
getRootItemRef
Reference to the id of the item represented by this object. For example, the product id. -
getPeriodType
The period type for the price, e.g. DAY, MONTH, YEAR- See Also:
-
periodFrequency
-
getPeriodFrequency
public int getPeriodFrequency()The frequency with which the recurring price should be charged., e.g., a value of 1 combined withperiodTypeof MONTH would indicate to a subscription service that the price should be charged every 1 month.- See Also:
-
periodType
-
getAmountDueNow
public javax.money.MonetaryAmount getAmountDueNow()Amount due today, which is typically captured immediately. Equal togetProratedAmount()+getPriorUnbilledAmount()-getCreditedAmount(). Note: This value is allowed to be negative, representing a required refund. -
getProratedAmount
public javax.money.MonetaryAmount getProratedAmount()The subscription price, prorated relative to the next invoice date. For a new purchase, this reflects the full date range. For edits, upgrades, & downgrades, this reflects the prorated price between the action & the end of the billing period. -
getCreditedAmount
public javax.money.MonetaryAmount getCreditedAmount()For edits, upgrades, and downgrades on a subscription that’s using anDefaultPaymentStrategy.PREPAIDpayment strategy, the customer has already paid the full amount for this billing cycle at the previous rate. For example, consider a customer who is upgrading from 10 to 20 licenses at $1 each half-way through a 30-day month. The user prorated amount would be $10 for 20 licenses. This user has already partially paid for 10 of the licenses, so they will be due a credit of $5 toward the second-half-of-the-month amount. Note: This typically only impacts the first period in the estimatedFuturePayments list. -
getPriorUnbilledAmount
public javax.money.MonetaryAmount getPriorUnbilledAmount()Prior to an edit, upgrade, or downgrade on a subscription that’s using a Postpaid payment strategy, the system will have prior unbilled charges that will be part of the next invoice. In this case, the user will owe this in addition to the prorated charges for the changes being made. For example, consider a customer who is upgrading from 10 to 20 licenses at $1 each half-way through a 30-day month. The user prorated amount would be $10 for 20 licenses. This user also owes $5 for access to the 10 licenses in the first half of the month. Note: This typically only impacts the first period in the estimatedFuturePayments list. -
getPreActionSubtotal
public javax.money.MonetaryAmount getPreActionSubtotal()The subscription subtotal prior to the action being taken, reflecting the typical recurring price for the subscription. For aDefaultSubscriptionActionFlow.CREATEaction, this value will be null since there was no prior subscription. -
getPostActionSubtotal
public javax.money.MonetaryAmount getPostActionSubtotal()The subscription subtotal after to the action being taken, reflecting the typical recurring price for the subscription. -
getActionPriceDetails
A collection ofSubscriptionActionPriceDetailobjects describing the price before & after the action for each item. -
getDueNowItemDetails
A list ofSubscriptionPriceItemDetailsdescribing the individual item prices that contributed to the overallgetAmountDueNow(). -
getEstimatedFuturePayments
A collection ofEstimatedFuturePaymentobjects describing the timing & amount of future subscription payments. -
getRemovedAdjustments
The list ofAdjustmentsbeing removed with additional contextual information. -
getAttributes
Map holding any additional attributes passed in the request not matching any defined properties. -
getAdditionalAttributes
Miscellaneous attributes that can be added to the response in order to provide more information. -
setFlow
Describes the subscription action flow that is being executed.- See Also:
-
setPaymentStrategy
The payment strategy of the subscription, e.g. PREPAID vs POSTPAID- See Also:
-
DefaultPaymentStrategy
-
setSubscriptionActionDate
The timestamp at which the subscription action was taken. In most pricing contexts, the action has not been formally submitted, so we'll use today's date for making pricing calculations. -
setRootCartItemId
Reference to the root subscriptionCartItem -
setRootItemRefType
Type of item that this object represents. For example, BLC_PRODUCT. -
setRootItemRef
Reference to the id of the item represented by this object. For example, the product id. -
setPeriodType
The period type for the price, e.g. DAY, MONTH, YEAR- See Also:
-
periodFrequency
-
setPeriodFrequency
public void setPeriodFrequency(int periodFrequency) The frequency with which the recurring price should be charged., e.g., a value of 1 combined withperiodTypeof MONTH would indicate to a subscription service that the price should be charged every 1 month.- See Also:
-
periodType
-
setAmountDueNow
public void setAmountDueNow(javax.money.MonetaryAmount amountDueNow) Amount due today, which is typically captured immediately. Equal togetProratedAmount()+getPriorUnbilledAmount()-getCreditedAmount(). Note: This value is allowed to be negative, representing a required refund. -
setProratedAmount
public void setProratedAmount(javax.money.MonetaryAmount proratedAmount) The subscription price, prorated relative to the next invoice date. For a new purchase, this reflects the full date range. For edits, upgrades, & downgrades, this reflects the prorated price between the action & the end of the billing period. -
setCreditedAmount
public void setCreditedAmount(javax.money.MonetaryAmount creditedAmount) For edits, upgrades, and downgrades on a subscription that’s using anDefaultPaymentStrategy.PREPAIDpayment strategy, the customer has already paid the full amount for this billing cycle at the previous rate. For example, consider a customer who is upgrading from 10 to 20 licenses at $1 each half-way through a 30-day month. The user prorated amount would be $10 for 20 licenses. This user has already partially paid for 10 of the licenses, so they will be due a credit of $5 toward the second-half-of-the-month amount. Note: This typically only impacts the first period in the estimatedFuturePayments list. -
setPriorUnbilledAmount
public void setPriorUnbilledAmount(javax.money.MonetaryAmount priorUnbilledAmount) Prior to an edit, upgrade, or downgrade on a subscription that’s using a Postpaid payment strategy, the system will have prior unbilled charges that will be part of the next invoice. In this case, the user will owe this in addition to the prorated charges for the changes being made. For example, consider a customer who is upgrading from 10 to 20 licenses at $1 each half-way through a 30-day month. The user prorated amount would be $10 for 20 licenses. This user also owes $5 for access to the 10 licenses in the first half of the month. Note: This typically only impacts the first period in the estimatedFuturePayments list. -
setPreActionSubtotal
public void setPreActionSubtotal(javax.money.MonetaryAmount preActionSubtotal) The subscription subtotal prior to the action being taken, reflecting the typical recurring price for the subscription. For aDefaultSubscriptionActionFlow.CREATEaction, this value will be null since there was no prior subscription. -
setPostActionSubtotal
public void setPostActionSubtotal(javax.money.MonetaryAmount postActionSubtotal) The subscription subtotal after to the action being taken, reflecting the typical recurring price for the subscription. -
setActionPriceDetails
A collection ofSubscriptionActionPriceDetailobjects describing the price before & after the action for each item. -
setDueNowItemDetails
A list ofSubscriptionPriceItemDetailsdescribing the individual item prices that contributed to the overallgetAmountDueNow(). -
setEstimatedFuturePayments
A collection ofEstimatedFuturePaymentobjects describing the timing & amount of future subscription payments. -
setRemovedAdjustments
The list ofAdjustmentsbeing removed with additional contextual information. -
setAttributes
Map holding any additional attributes passed in the request not matching any defined properties. -
setAdditionalAttributes
Miscellaneous attributes that can be added to the response in order to provide more information. -
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-