Interface FulfillmentPricingService
- All Known Implementing Classes:
FulfillmentPricingServiceImpl
public interface FulfillmentPricingService
This service can be used in a couple of different ways. First, this is used in the pricing workflow and specifically
FulfillmentGroupMerchandiseTotalActivity to calculate costs for FulfillmentGroups in an Order. This can
also be injected in a controller to provide estimations for various FulfillmentOptions to display to the user
before an option is actually selected.- Author:
- Phillip Verheyden
-
Method Summary
Modifier and TypeMethodDescriptioncalculateCostForFulfillmentGroup(FulfillmentGroup fulfillmentGroup) Called during the Pricing workflow to determine the cost for theFulfillmentGroup.estimateCostForFulfillmentGroup(FulfillmentGroup fulfillmentGroup, Set<FulfillmentOption> options) This provides an estimation for aFulfillmentGroupwith aFulfillmentOption.
-
Method Details
-
calculateCostForFulfillmentGroup
FulfillmentGroup calculateCostForFulfillmentGroup(FulfillmentGroup fulfillmentGroup) throws FulfillmentPriceException Called during the Pricing workflow to determine the cost for theFulfillmentGroup. This will loop through#getProcessors()and callFulfillmentPricingProvider.calculateCostForFulfillmentGroup(FulfillmentGroup)on the first processor that returns true fromFulfillmentPricingProvider#canCalculateCostForFulfillmentGroup(FulfillmentGroup)- Parameters:
fulfillmentGroup-- Returns:
- the updated fulfillmentGroup with its shippingPrice set
- Throws:
FulfillmentPriceException- if fulfillmentGroup does not have a FulfillmentOption associated to it or if there was no processor found to calculate costs for fulfillmentGroup
-
estimateCostForFulfillmentGroup
FulfillmentEstimationResponse estimateCostForFulfillmentGroup(FulfillmentGroup fulfillmentGroup, Set<FulfillmentOption> options) throws FulfillmentPriceException This provides an estimation for aFulfillmentGroupwith aFulfillmentOption. The main use case for this method is in a view cart controller that wants to provide estimations for differentFulfillmentOptions before the user actually selects one. This usesgetProviders()to allow third-party integrations to respond to estimations, and returns the first processor that returns true fromFulfillmentPricingProvider.canCalculateCostForFulfillmentGroup(FulfillmentGroup, FulfillmentOption).- Parameters:
fulfillmentGroup-options-- Returns:
- the price estimation for a particular
FulfillmentGroupwith a candidateFulfillmentOption - Throws:
FulfillmentPriceException- if no processor was found to estimate costs for fulfillmentGroup with the given option
-
getProviders
List<FulfillmentPricingProvider> getProviders()
-