Class BillingEvent

java.lang.Object
com.broadleafcommerce.billing.domain.BillingEvent
All Implemented Interfaces:
com.broadleafcommerce.data.tracking.core.ContextStateAware, com.broadleafcommerce.money.CurrencyConsumer, Serializable, javax.money.CurrencySupplier

public class BillingEvent extends Object implements com.broadleafcommerce.data.tracking.core.ContextStateAware, javax.money.CurrencySupplier, com.broadleafcommerce.money.CurrencyConsumer, Serializable
Represents a specific instance of billing a user for a Subscription. This domain contains the summary fields, while BillingEventAddress, BillingEventAdjustment, BillingEventItem, BillingEventPayment, and others store detailed information.
See Also:
  • Constructor Details

    • BillingEvent

      public BillingEvent()
    • BillingEvent

      public BillingEvent(String id, String orderRef, String orderId, String orderSrc, Date createdDate, String userRef, boolean isRecurring, Map<@Size(max=255) String,@Size(max=2000) String> additionalAttributes, String currencyCode, javax.money.CurrencyUnit currency, String alternateUserRef, String siteIdentifier, String subscriptionRef, Integer subscriptionPeriod, Date billingCycleStartDate, Date billingCycleEndDate, Date billDate, BigDecimal billTotal, BigDecimal billTotalTax, String eventNotificationChannel, String source, String sourceId, String billingEventAddressId, com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState contextState)
  • Method Details

    • isRecurring

      public boolean isRecurring()
    • calculateSubtotal

      public BigDecimal calculateSubtotal()
    • setCurrencyCode

      public void setCurrencyCode(String currencyCode)
    • setCurrency

      public void setCurrency(javax.money.CurrencyUnit currency)
      Specified by:
      setCurrency in interface com.broadleafcommerce.money.CurrencyConsumer
    • convert

      public Object convert(org.modelmapper.spi.MappingContext<?,?> context)
    • getId

      public String getId()
    • getOrderRef

      public String getOrderRef()
      Reference for the business order for this billing event. By default, this is set to the order number.
    • getOrderId

      public String getOrderId()
      The identifier for the business order for this billing event.
    • getOrderSrc

      public String getOrderSrc()
      The source system for the business order.
    • getCreatedDate

      public Date getCreatedDate()
      The date this billing event was created on
    • getUserRef

      public String getUserRef()
      The id of the user billed for this event
    • getAdditionalAttributes

      public Map<@Size(max=255) String,@Size(max=2000) String> getAdditionalAttributes()
      Name/Value pairs of additional attributes.
    • getCurrencyCode

      @Deprecated public String getCurrencyCode()
      Deprecated.
      use getCurrency() field instead
      The currency (“USD”, “CAD”, etc.) correlated to charges on this BillingEvent
    • getCurrency

      public javax.money.CurrencyUnit getCurrency()
      The currency of charges on this BillingEvent
      Specified by:
      getCurrency in interface javax.money.CurrencySupplier
    • getAlternateUserRef

      public String getAlternateUserRef()
      Alternate reference to the user. Useful for third-party authentication system identifiers
    • getSiteIdentifier

      public String getSiteIdentifier()
      Multi-tenancy support
    • getSubscriptionRef

      public String getSubscriptionRef()
      The Subscription used for this BillingEvent
    • getSubscriptionPeriod

      public Integer getSubscriptionPeriod()
      Describes the Subscription's period that correlates to this BillingEvent. This value is especially relevant when processing a subscription's recurring billing. If this BillingEvent does not correlate to a Subscription, then we expect this value to be null.
    • getBillingCycleStartDate

      public Date getBillingCycleStartDate()
      Date representing the start of the window which is being billed for
    • getBillingCycleEndDate

      public Date getBillingCycleEndDate()
      Date representing the end of the window which is being billed for
    • getBillDate

      public Date getBillDate()
      Date when the BillingEvent is billed
    • getBillTotal

      public BigDecimal getBillTotal()
      Total bill amount including tax for this BillingEvent
    • getBillTotalTax

      public BigDecimal getBillTotalTax()
      Total tax created for the billAmount
    • getEventNotificationChannel

      public String getEventNotificationChannel()
      Notification channel for this event
    • getSource

      public String getSource()
      The type of the process that created this event
    • getSourceId

      public String getSourceId()
      The id of the process that created this event
    • getBillingEventAddressId

      public String getBillingEventAddressId()
      Reference to the related BillingEventAddress
    • getContextState

      public com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState getContextState()
      A subset of Tracking information to expose the context state for this object.
      Specified by:
      getContextState in interface com.broadleafcommerce.data.tracking.core.ContextStateAware
    • setId

      public void setId(String id)
    • setOrderRef

      public void setOrderRef(String orderRef)
      Reference for the business order for this billing event. By default, this is set to the order number.
    • setOrderId

      public void setOrderId(String orderId)
      The identifier for the business order for this billing event.
    • setOrderSrc

      public void setOrderSrc(String orderSrc)
      The source system for the business order.
    • setCreatedDate

      public void setCreatedDate(Date createdDate)
      The date this billing event was created on
    • setUserRef

      public void setUserRef(String userRef)
      The id of the user billed for this event
    • setRecurring

      public void setRecurring(boolean isRecurring)
      Indicates whether the billing event is for a recurring subscription
    • setAdditionalAttributes

      public void setAdditionalAttributes(Map<@Size(max=255) String,@Size(max=2000) String> additionalAttributes)
      Name/Value pairs of additional attributes.
    • setAlternateUserRef

      public void setAlternateUserRef(String alternateUserRef)
      Alternate reference to the user. Useful for third-party authentication system identifiers
    • setSiteIdentifier

      public void setSiteIdentifier(String siteIdentifier)
      Multi-tenancy support
    • setSubscriptionRef

      public void setSubscriptionRef(String subscriptionRef)
      The Subscription used for this BillingEvent
    • setSubscriptionPeriod

      public void setSubscriptionPeriod(Integer subscriptionPeriod)
      Describes the Subscription's period that correlates to this BillingEvent. This value is especially relevant when processing a subscription's recurring billing. If this BillingEvent does not correlate to a Subscription, then we expect this value to be null.
    • setBillingCycleStartDate

      public void setBillingCycleStartDate(Date billingCycleStartDate)
      Date representing the start of the window which is being billed for
    • setBillingCycleEndDate

      public void setBillingCycleEndDate(Date billingCycleEndDate)
      Date representing the end of the window which is being billed for
    • setBillDate

      public void setBillDate(Date billDate)
      Date when the BillingEvent is billed
    • setBillTotal

      public void setBillTotal(BigDecimal billTotal)
      Total bill amount including tax for this BillingEvent
    • setBillTotalTax

      public void setBillTotalTax(BigDecimal billTotalTax)
      Total tax created for the billAmount
    • setEventNotificationChannel

      public void setEventNotificationChannel(String eventNotificationChannel)
      Notification channel for this event
    • setSource

      public void setSource(String source)
      The type of the process that created this event
    • setSourceId

      public void setSourceId(String sourceId)
      The id of the process that created this event
    • setBillingEventAddressId

      public void setBillingEventAddressId(String billingEventAddressId)
      Reference to the related BillingEventAddress
    • setContextState

      public void setContextState(com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState contextState)
      A subset of Tracking information to expose the context state for this object.
      Specified by:
      setContextState in interface com.broadleafcommerce.data.tracking.core.ContextStateAware
    • 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