Class VirtualFulfillmentPricingProvider
java.lang.Object
com.broadleafcommerce.shipping.virtual.provider.VirtualFulfillmentPricingProvider
- All Implemented Interfaces:
FulfillmentPricingProvider
@Deprecated
public class VirtualFulfillmentPricingProvider
extends Object
implements FulfillmentPricingProvider
Deprecated.
Since 1.7.0. Moved to shipping service.
-
Constructor Summary
ConstructorDescriptionVirtualFulfillmentPricingProvider
(com.fasterxml.jackson.databind.ObjectMapper objectMapper, com.broadleafcommerce.common.extension.TypeFactory typeFactory, VirtualFulfillmentPricingProperties virtualShipProps) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionprotected FulfillmentOptionPricedResponse
buildFulfillmentOptionPricedResponse
(@NonNull javax.money.MonetaryAmount price, @NonNull Map<FulfillmentPricingItem, javax.money.MonetaryAmount> itemToPriceMap, @NonNull VirtualFulfillmentPricingOption fulfillmentOption, boolean isEstimate) Deprecated.Builds aFulfillmentOptionPricedResponse
with the given inputs.protected Map<FulfillmentPricingItem,
javax.money.MonetaryAmount> buildItemToPriceMap
(@NonNull FulfillmentPricingRequest request, @NonNull VirtualFulfillmentPricingOption option, @NonNull javax.money.CurrencyUnit currency) Deprecated.Builds a map ofFulfillmentPricingItems
to the calculated prices.Deprecated.Calculate shipping for a request that includes a specified fulfillment option.protected FulfillmentOptionPricedResponse
calculateCostForFulfillmentGroupInternal
(@NonNull FulfillmentPricingRequest request, boolean isEstimate) Deprecated.Calculates the shipping costs of the fulfillment items based on the fulfillment option on the request.protected javax.money.MonetaryAmount
calculateFixedPriceForItem
(@NonNull FulfillmentPricingItem item, @NonNull VirtualFulfillmentPricingOption option, @NonNull javax.money.CurrencyUnit currency) Deprecated.Calculates the fixed price for the fulfillment item, i.e.protected javax.money.MonetaryAmount
calculateFulfillmentGroupPriceBeforeAdjustments
(@NonNull VirtualFulfillmentPricingOption option, @NonNull javax.money.CurrencyUnit currency) Deprecated.Calculates the fixed fulfillment price per fulfillment group.protected javax.money.MonetaryAmount
calculatePercentageBasedPriceForItem
(@NonNull FulfillmentPricingItem item, @NonNull VirtualFulfillmentPricingOption option, @NonNull javax.money.CurrencyUnit currency) protected javax.money.MonetaryAmount
calculatePercentageBasedPriceForItems
(@NonNull FulfillmentPricingItem item, @NonNull VirtualFulfillmentPricingOption option, @NonNull javax.money.CurrencyUnit currency) Deprecated.protected javax.money.MonetaryAmount
calculatePriceForItem
(@NonNull FulfillmentPricingItem item, @NonNull VirtualFulfillmentPricingOption option, @NonNull javax.money.CurrencyUnit currency) Deprecated.protected javax.money.MonetaryAmount
calculatePriceForItems
(@NonNull FulfillmentPricingItem item, @NonNull VirtualFulfillmentPricingOption option, @NonNull javax.money.CurrencyUnit currency) Deprecated.Calculates the price for a fulfillment items.boolean
canCalculateCostForOption
(String option) Deprecated.Whether this provider has knowledge of the provided option and thus can provide cost information for it.boolean
canProvidePricedFulfillmentOptions
(FulfillmentPricingRequest fulfillmentPricingRequest) Deprecated.Whether this provider can provide fulfillment options based on the "fulfillmentPricingRequest"Deprecated.Estimate shipping for a request that includes a specified fulfillment option.protected VirtualFulfillmentPricingOption
getDefaultVirtualFulfillmentPricingOption
(@NonNull javax.money.CurrencyUnit currency) Deprecated.Builds aVirtualFulfillmentPricingOption
with fields initialized to typical values.protected javax.money.MonetaryAmount
getMonetaryAmount
(javax.money.CurrencyUnit expectedCurrency, Set<FulfillmentPriceAmount> fulfillmentPriceAmounts) Deprecated.Find the corresponding price for the expected currency, otherwise return zero.protected com.fasterxml.jackson.databind.ObjectMapper
Deprecated.protected com.broadleafcommerce.common.extension.TypeFactory
Deprecated.protected VirtualFulfillmentPricingConfig
Deprecated.protected VirtualFulfillmentPricingProperties
Deprecated.void
init()
Deprecated.Reads in the configuration file defined byVirtualFulfillmentPricingProperties.getConfigPath()
and initializesvirtualFulfillmentPricingConfig
to the result.Deprecated.Retrieve all possible priced fulfillment options for the provided request.protected javax.money.CurrencyUnit
resolveCurrency
(FulfillmentPricingRequest request) Deprecated.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.broadleafcommerce.shipping.FulfillmentPricingProvider
getFulfillmentOptionPricingResponses
-
Constructor Details
-
VirtualFulfillmentPricingProvider
public VirtualFulfillmentPricingProvider(com.fasterxml.jackson.databind.ObjectMapper objectMapper, com.broadleafcommerce.common.extension.TypeFactory typeFactory, VirtualFulfillmentPricingProperties virtualShipProps) Deprecated.
-
-
Method Details
-
init
@PostConstruct public void init()Deprecated.Reads in the configuration file defined byVirtualFulfillmentPricingProperties.getConfigPath()
and initializesvirtualFulfillmentPricingConfig
to the result.- Throws:
UncheckedIOException
- Thrown when there is an error while reading the configuration file or converting its contents into aVirtualFulfillmentPricingConfig
.IllegalStateException
- Thrown when there is not configuration file defined byVirtualFulfillmentPricingProperties.getConfigPath()
.
-
providePricedFulfillmentOptions
public List<FulfillmentOptionPricedResponse> providePricedFulfillmentOptions(FulfillmentPricingRequest request) Deprecated.Description copied from interface:FulfillmentPricingProvider
Retrieve all possible priced fulfillment options for the provided request. Intended to be used to display options to the customer for selection.- Specified by:
providePricedFulfillmentOptions
in interfaceFulfillmentPricingProvider
- Parameters:
request
- The request for which to calculate shipping and return options.- Returns:
- All possible priced fulfillment options for the provided request.
-
canProvidePricedFulfillmentOptions
public boolean canProvidePricedFulfillmentOptions(FulfillmentPricingRequest fulfillmentPricingRequest) Deprecated.Description copied from interface:FulfillmentPricingProvider
Whether this provider can provide fulfillment options based on the "fulfillmentPricingRequest"- Specified by:
canProvidePricedFulfillmentOptions
in interfaceFulfillmentPricingProvider
- Parameters:
fulfillmentPricingRequest
- The request used to identify relevant fulfillment options- Returns:
- Whether this provider can provide fulfillment options based on the "fulfillmentPricingRequest"
-
calculateCostForFulfillmentGroup
public FulfillmentOptionPricedResponse calculateCostForFulfillmentGroup(FulfillmentPricingRequest request) Deprecated.Description copied from interface:FulfillmentPricingProvider
Calculate shipping for a request that includes a specified fulfillment option.- Specified by:
calculateCostForFulfillmentGroup
in interfaceFulfillmentPricingProvider
- Parameters:
request
- The request for which to calculate shipping.- Returns:
- Response object with calculated shipping cost for the provided request.
-
canCalculateCostForOption
Deprecated.Description copied from interface:FulfillmentPricingProvider
Whether this provider has knowledge of the provided option and thus can provide cost information for it.- Specified by:
canCalculateCostForOption
in interfaceFulfillmentPricingProvider
- Parameters:
option
- The option to consider whether this provider can calculate cost information.- Returns:
- Whether this provider has knowledge of the provided option and thus can provide cost information for it.
-
estimateCostForFulfillmentGroup
public FulfillmentOptionPricedResponse estimateCostForFulfillmentGroup(FulfillmentPricingRequest request) Deprecated.Description copied from interface:FulfillmentPricingProvider
Estimate shipping for a request that includes a specified fulfillment option.- Specified by:
estimateCostForFulfillmentGroup
in interfaceFulfillmentPricingProvider
- Parameters:
request
- The request for which to estimate shipping.- Returns:
- Response object with estimated shipping cost for the provided request.
-
calculateCostForFulfillmentGroupInternal
protected FulfillmentOptionPricedResponse calculateCostForFulfillmentGroupInternal(@NonNull @NonNull FulfillmentPricingRequest request, boolean isEstimate) Deprecated.Calculates the shipping costs of the fulfillment items based on the fulfillment option on the request. Handles the shared logic ofcalculateCostForFulfillmentGroup(FulfillmentPricingRequest)
andestimateCostForFulfillmentGroup(FulfillmentPricingRequest)
.- Parameters:
request
- The request for which to calculate shippingisEstimate
- Whether or not the shipping should be estimated- Returns:
- fulfillment price information for request based on the fulfillment option.
-
buildItemToPriceMap
protected Map<FulfillmentPricingItem,javax.money.MonetaryAmount> buildItemToPriceMap(@NonNull @NonNull FulfillmentPricingRequest request, @NonNull @NonNull VirtualFulfillmentPricingOption option, @NonNull @NonNull javax.money.CurrencyUnit currency) Deprecated.Builds a map ofFulfillmentPricingItems
to the calculated prices.- Parameters:
request
- The request for which to calculate shippingoption
- The fulfillment option to use to calculate pricing for therequest
- Returns:
- a map of
FulfillmentPricingItems
to the calculated prices.
-
calculatePriceForItem
@Deprecated protected javax.money.MonetaryAmount calculatePriceForItem(@NonNull @NonNull FulfillmentPricingItem item, @NonNull @NonNull VirtualFulfillmentPricingOption option, @NonNull @NonNull javax.money.CurrencyUnit currency) Deprecated.Calculates the price for a fulfillment item. By default this means the price for a single unit rather than all like units, i.e.,FulfillmentPricingItem.getUnitPrice()
is used notFulfillmentPricingItem.getSubtotal()
.- Parameters:
item
- TheFulfillmentPriceInfo
item to be pricedoption
- The applicableVirtualFulfillmentPricingOption
for theitem
- Returns:
- the price for a fulfillment item.
-
calculatePriceForItems
protected javax.money.MonetaryAmount calculatePriceForItems(@NonNull @NonNull FulfillmentPricingItem item, @NonNull @NonNull VirtualFulfillmentPricingOption option, @NonNull @NonNull javax.money.CurrencyUnit currency) Deprecated.Calculates the price for a fulfillment items. By default this means the price for all units, i.e.,FulfillmentPricingItem.getMerchandiseTotalAmount()
.- Parameters:
item
- TheFulfillmentPriceInfo
item to be pricedoption
- The applicableVirtualFulfillmentPricingOption
for theitem
- Returns:
- the price for a fulfillment items.
-
calculateFixedPriceForItem
protected javax.money.MonetaryAmount calculateFixedPriceForItem(@NonNull @NonNull FulfillmentPricingItem item, @NonNull @NonNull VirtualFulfillmentPricingOption option, @NonNull @NonNull javax.money.CurrencyUnit currency) Deprecated.Calculates the fixed price for the fulfillment item, i.e. the price per item plus any flat rates for this item.- Parameters:
item
- TheFulfillmentPriceInfo
item to be pricedoption
- The applicableVirtualFulfillmentPricingOption
for theitem
- Returns:
- the fixed price for a fulfillment item.
-
calculatePercentageBasedPriceForItem
@Deprecated protected javax.money.MonetaryAmount calculatePercentageBasedPriceForItem(@NonNull @NonNull FulfillmentPricingItem item, @NonNull @NonNull VirtualFulfillmentPricingOption option, @NonNull @NonNull javax.money.CurrencyUnit currency) Deprecated.Calculates the fulfillment price based on the percentage rate per item.- Parameters:
item
- TheFulfillmentPriceInfo
item to be pricedoption
- The applicableVirtualFulfillmentPricingOption
for theitem
- Returns:
- the percentage rate price for a fulfillment item.
-
calculatePercentageBasedPriceForItems
protected javax.money.MonetaryAmount calculatePercentageBasedPriceForItems(@NonNull @NonNull FulfillmentPricingItem item, @NonNull @NonNull VirtualFulfillmentPricingOption option, @NonNull @NonNull javax.money.CurrencyUnit currency) Deprecated. -
calculateFulfillmentGroupPriceBeforeAdjustments
protected javax.money.MonetaryAmount calculateFulfillmentGroupPriceBeforeAdjustments(@NonNull @NonNull VirtualFulfillmentPricingOption option, @NonNull @NonNull javax.money.CurrencyUnit currency) Deprecated.Calculates the fixed fulfillment price per fulfillment group.- Parameters:
option
- The applicableVirtualFulfillmentPricingOption
for the fulfillment group- Returns:
- the fixed fulfillment price per fulfillment group
-
getMonetaryAmount
protected javax.money.MonetaryAmount getMonetaryAmount(javax.money.CurrencyUnit expectedCurrency, @Nullable Set<FulfillmentPriceAmount> fulfillmentPriceAmounts) Deprecated.Find the corresponding price for the expected currency, otherwise return zero.- Parameters:
expectedCurrency
- The expected currency to find a price forfulfillmentPriceAmounts
- The list of prices to search against- Returns:
- the corresponding price for the expected currency, otherwise return zero
-
buildFulfillmentOptionPricedResponse
protected FulfillmentOptionPricedResponse buildFulfillmentOptionPricedResponse(@NonNull @NonNull javax.money.MonetaryAmount price, @NonNull @NonNull Map<FulfillmentPricingItem, javax.money.MonetaryAmount> itemToPriceMap, @NonNull @NonNull VirtualFulfillmentPricingOption fulfillmentOption, boolean isEstimate) Deprecated.Builds aFulfillmentOptionPricedResponse
with the given inputs.- Parameters:
price
- The value to set forFulfillmentOptionPricedResponse.getFulfillmentPriceCalculated()
.itemToPriceMap
- Map ofFulfillmentPricingItems
to their fulfillment pricesfulfillmentOption
- TheFulfillmentOption
that forms the basis of the responseisEstimate
- Whether this is for estimating the fulfillment pricing- Returns:
- a
FulfillmentOptionPricedResponse
for the given inputs.
-
getDefaultVirtualFulfillmentPricingOption
protected VirtualFulfillmentPricingOption getDefaultVirtualFulfillmentPricingOption(@NonNull @NonNull javax.money.CurrencyUnit currency) Deprecated.Builds aVirtualFulfillmentPricingOption
with fields initialized to typical values.- Returns:
- a
VirtualFulfillmentPricingOption
with fields initialized to typical values.
-
resolveCurrency
Deprecated. -
getObjectMapper
protected com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()Deprecated. -
getTypeFactory
protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory()Deprecated. -
getVirtualShipProps
Deprecated. -
getVirtualFulfillmentPricingConfig
Deprecated.
-