Interface FeePricingService
- All Known Implementing Classes:
DefaultFeePricingService
public interface FeePricingService
Service for pricing operations related to
Fees.- Since:
- Cart Operation Services 2.3.0, Release Train 2.3.0
- Author:
- Julia Lopez-Pozas (jlopezpozas)
-
Method Summary
Modifier and TypeMethodDescription<T extends Fee>
voidapplyFeesAfterAdjustments(com.broadleafcommerce.cart.client.domain.Cart cart, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) <T extends Fee>
voidapplyFeesBeforeAdjustments(com.broadleafcommerce.cart.client.domain.Cart cart, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) <T extends Fee>
voidcalculateAndApplyFees(com.broadleafcommerce.cart.client.domain.Cart cart, List<T> feesToBeApplied, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Calculates theFeespassed in and applies them to theCartby addingCartItems of typeDefaultCartItemTypes.EXTRA_FEE, which should update theCartPricing.feesTotalwhen totals are calculated for the cart.getFeesByApplication(com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Fetches and returns a list ofFeesmatching the passed inContextInfo'sapplication information.
-
Method Details
-
applyFeesBeforeAdjustments
<T extends Fee> void applyFeesBeforeAdjustments(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) FetchesFeesfor theContextInfo'sapplication, then calculates and applies them to the givenCart. Expected to be called before adjustments / offers are applied onto the cart.- Type Parameters:
T- The domain type for the fees to be applied- Parameters:
cart- theCartto apply the fees tocontextInfo- Context information around sandbox and multitenant state
-
applyFeesAfterAdjustments
<T extends Fee> void applyFeesAfterAdjustments(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) FetchesFeesfor theContextInfo'sapplication, then calculates and applies them to the givenCart. Expected to be called after adjustments / offers have been applied onto the cart.- Type Parameters:
T- The domain type for the fees to be applied- Parameters:
cart- theCartto apply the fees tocontextInfo- Context information around sandbox and multitenant state
-
calculateAndApplyFees
<T extends Fee> void calculateAndApplyFees(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull List<T> feesToBeApplied, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Calculates theFeespassed in and applies them to theCartby addingCartItems of typeDefaultCartItemTypes.EXTRA_FEE, which should update theCartPricing.feesTotalwhen totals are calculated for the cart.- Type Parameters:
T- The domain type for the fees to be applied- Parameters:
cart- theCartto apply the fees tofeesToBeApplied- the list ofFeesto apply onto the cartcontextInfo- Context information around sandbox and multitenant state
-
getFeesByApplication
<T extends Fee> List<T> getFeesByApplication(@Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Fetches and returns a list ofFeesmatching the passed inContextInfo'sapplication information. The list is either fetched from the cache or fetched by the external Pricing provider.- Type Parameters:
T- The domain type for the fees being fetched- Parameters:
contextInfo- Context information around sandbox and multitenant state- Returns:
- the list of
Feesmatching the context's application that is fetched from the cache or fetched by the external Pricing provider
-