Class SubscriptionPriceResponse

java.lang.Object
com.broadleafcommerce.cartoperation.service.provider.domain.SubscriptionPriceResponse
All Implemented Interfaces:
Serializable

public class SubscriptionPriceResponse extends Object implements 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 Details

    • SubscriptionPriceResponse

      public SubscriptionPriceResponse()
  • Method Details

    • addAttribute

      public void addAttribute(String name, Object value)
      Takes in any additional attributes passed in the request not matching any defined properties.
      Parameters:
      name - Name of the additional attribute
      value - Value of the additional attribute
    • getAttribute

      public Map<String,Object> 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

      public String getFlow()
      Describes the subscription action flow that is being executed.
      See Also:
    • getPaymentStrategy

      public String getPaymentStrategy()
      The payment strategy of the subscription, e.g. PREPAID vs POSTPAID
      See Also:
      • DefaultPaymentStrategy
    • getSubscriptionActionDate

      public Instant 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

      public String getRootCartItemId()
      Reference to the root subscription CartItem
    • getRootItemRefType

      public String getRootItemRefType()
      Type of item that this object represents. For example, BLC_PRODUCT.
    • getRootItemRef

      public String getRootItemRef()
      Reference to the id of the item represented by this object. For example, the product id.
    • getPeriodType

      public String 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 with periodType of 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 to getProratedAmount() + 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 an DefaultPaymentStrategy.PREPAID payment 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 a DefaultSubscriptionActionFlow.CREATE action, 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

      public List<SubscriptionActionPriceDetail> getActionPriceDetails()
      A collection of SubscriptionActionPriceDetail objects describing the price before & after the action for each item.
    • getDueNowItemDetails

      public List<SubscriptionItemPriceDetail> getDueNowItemDetails()
      A list of SubscriptionPriceItemDetails describing the individual item prices that contributed to the overall getAmountDueNow().
    • getEstimatedFuturePayments

      public List<EstimatedFuturePayment> getEstimatedFuturePayments()
      A collection of EstimatedFuturePayment objects describing the timing & amount of future subscription payments.
    • getRemovedAdjustments

      public List<RemovedAdjustment> getRemovedAdjustments()
      The list of Adjustments being removed with additional contextual information.
    • getAttributes

      public Map<String,Object> getAttributes()
      Map holding any additional attributes passed in the request not matching any defined properties.
    • getAdditionalAttributes

      public Map<String,Object> getAdditionalAttributes()
      Miscellaneous attributes that can be added to the response in order to provide more information.
    • setFlow

      public void setFlow(String flow)
      Describes the subscription action flow that is being executed.
      See Also:
    • setPaymentStrategy

      public void setPaymentStrategy(String paymentStrategy)
      The payment strategy of the subscription, e.g. PREPAID vs POSTPAID
      See Also:
      • DefaultPaymentStrategy
    • setSubscriptionActionDate

      public void setSubscriptionActionDate(Instant subscriptionActionDate)
      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

      public void setRootCartItemId(String rootCartItemId)
      Reference to the root subscription CartItem
    • setRootItemRefType

      public void setRootItemRefType(String rootItemRefType)
      Type of item that this object represents. For example, BLC_PRODUCT.
    • setRootItemRef

      public void setRootItemRef(String rootItemRef)
      Reference to the id of the item represented by this object. For example, the product id.
    • setPeriodType

      public void setPeriodType(String periodType)
      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 with periodType of 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 to getProratedAmount() + 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 an DefaultPaymentStrategy.PREPAID payment 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 a DefaultSubscriptionActionFlow.CREATE action, 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

      public void setActionPriceDetails(List<SubscriptionActionPriceDetail> actionPriceDetails)
      A collection of SubscriptionActionPriceDetail objects describing the price before & after the action for each item.
    • setDueNowItemDetails

      public void setDueNowItemDetails(List<SubscriptionItemPriceDetail> dueNowItemDetails)
      A list of SubscriptionPriceItemDetails describing the individual item prices that contributed to the overall getAmountDueNow().
    • setEstimatedFuturePayments

      public void setEstimatedFuturePayments(List<EstimatedFuturePayment> estimatedFuturePayments)
      A collection of EstimatedFuturePayment objects describing the timing & amount of future subscription payments.
    • setRemovedAdjustments

      public void setRemovedAdjustments(List<RemovedAdjustment> removedAdjustments)
      The list of Adjustments being removed with additional contextual information.
    • setAttributes

      public void setAttributes(Map<String,Object> attributes)
      Map holding any additional attributes passed in the request not matching any defined properties.
    • setAdditionalAttributes

      public void setAdditionalAttributes(Map<String,Object> additionalAttributes)
      Miscellaneous attributes that can be added to the response in order to provide more information.
    • 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