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 FulfillmentGroup
s in an Order
. This can
also be injected in a controller to provide estimations for various FulfillmentOption
s 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 aFulfillmentGroup
with 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 aFulfillmentGroup
with aFulfillmentOption
. The main use case for this method is in a view cart controller that wants to provide estimations for differentFulfillmentOption
s 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
FulfillmentGroup
with a candidateFulfillmentOption
- Throws:
FulfillmentPriceException
- if no processor was found to estimate costs for fulfillmentGroup with the given option
-
getProviders
List<FulfillmentPricingProvider> getProviders()
-