public interface FulfillmentPricingService
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.Modifier and Type | Method and Description |
---|---|
FulfillmentGroup |
calculateCostForFulfillmentGroup(FulfillmentGroup fulfillmentGroup)
Called during the Pricing workflow to determine the cost for the
FulfillmentGroup . |
FulfillmentEstimationResponse |
estimateCostForFulfillmentGroup(FulfillmentGroup fulfillmentGroup,
Set<FulfillmentOption> options)
This provides an estimation for a
FulfillmentGroup with a FulfillmentOption . |
List<FulfillmentPricingProvider> |
getProviders() |
FulfillmentGroup calculateCostForFulfillmentGroup(FulfillmentGroup fulfillmentGroup) throws FulfillmentPriceException
FulfillmentGroup
. This will loop through
#getProcessors()
and call FulfillmentPricingProvider.calculateCostForFulfillmentGroup(FulfillmentGroup)
on the first processor that returns true from FulfillmentPricingProvider#canCalculateCostForFulfillmentGroup(FulfillmentGroup)
fulfillmentGroup
- FulfillmentPriceException
- if fulfillmentGroup does not have a FulfillmentOption associated to it or
if there was no processor found to calculate costs for fulfillmentGroupFulfillmentPricingProvider}
FulfillmentEstimationResponse estimateCostForFulfillmentGroup(FulfillmentGroup fulfillmentGroup, Set<FulfillmentOption> options) throws FulfillmentPriceException
FulfillmentGroup
with a FulfillmentOption
. The main use case for this method
is in a view cart controller that wants to provide estimations for different FulfillmentOption
s before the user
actually selects one. This uses getProviders()
to allow third-party integrations to respond to
estimations, and returns the first processor that returns true from FulfillmentPricingProvider.canCalculateCostForFulfillmentGroup(FulfillmentGroup, FulfillmentOption)
.fulfillmentGroup
- options
- FulfillmentGroup
with a candidate FulfillmentOption
FulfillmentPriceException
- if no processor was found to estimate costs for fulfillmentGroup with the given optionFulfillmentPricingProvider}
List<FulfillmentPricingProvider> getProviders()
Copyright © 2019. All rights reserved.