public class DefaultSubscriptionCommerceCartService extends DefaultCommerceCartService implements SubscriptionCommerceCartService
SubscriptionCommerceCartService.ESTIMATED_TAXES| Constructor and Description |
|---|
DefaultSubscriptionCommerceCartService() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addOneRecurringFrequency(SubscriptionPricePlanModel subscriptionPricePlan,
java.util.List<BillingTimeModel> billingFrequencies) |
CommerceCartModification |
addToCart(CartModel masterCartModel,
ProductModel productModel,
long quantityToAdd,
UnitModel unit,
boolean forceNewEntry)
Deprecated.
Since ages.
|
CommerceCartModification |
addToCart(CartModel masterCartModel,
ProductModel productModel,
long quantityToAdd,
UnitModel unit,
boolean forceNewEntry,
java.lang.String xmlProduct)
Deprecated.
Since 6.4
|
CommerceCartModification |
addToCart(CartModel masterCartModel,
ProductModel productModel,
long quantityToAdd,
UnitModel unit,
boolean forceNewEntry,
java.lang.String xmlProduct,
java.lang.String originalSubscriptionId,
AbstractOrderEntryModel originalEntry) |
void |
checkMasterCart(CartModel cartModel,
BillingTimeModel masterCartBillingTimeModel)
Checks if the given
CartModel is a master cart and has the correct BillingTimeModel. |
void |
checkQuantityToAdd(long quantityToAdd)
Checks if given quantity can be added.
|
protected void |
checkQuantityToAdd(long quantityToAdd,
long maxQuantity) |
CartModel |
createChildCartForBillingTime(CartModel masterCart,
BillingTimeModel billFreq)
Creates a new child cart for the given billing frequency and assigns it as child cart to the given master cart.
|
protected long |
getAvailableStockLevel(ProductModel productModel,
PointOfServiceModel pointOfServiceModel)
Find the available stock quantity for a product.
|
protected BaseStoreService |
getBaseStoreService() |
java.util.List<BillingTimeModel> |
getBillingFrequenciesForMasterEntry(AbstractOrderEntryModel entry) |
protected BillingTimeModel |
getBillingTimeForCode(java.lang.String code) |
protected BillingTimeService |
getBillingTimeService() |
protected AbstractOrderEntryModel |
getCartEntryToBeUpdated(CartModel cartModel,
long entryNumber)
Searches in the given
cartModel for the cart entry with has the given entryNumber and
returns it. |
CartModel |
getChildCartForBillingTime(CartModel masterCart,
BillingTimeModel billFreq)
Get the child cart for the given
BillingTimeModel, if any. |
protected SubscriptionCommercePriceService |
getCommercePriceService() |
protected CommerceStockService |
getCommerceStockService() |
java.lang.String |
getMasterCartBillingTimeCode()
Get the billing frequency code for the master cart.
|
CartModel |
getMasterCartForCartEntry(CartEntryModel cartEntryModel)
Get the master cart for the given
cartEntryModel. |
protected SubscriptionCommerceCartStrategy |
getSubscriptionCommerceCartStrategy() |
protected SubscriptionProductService |
getSubscriptionProductService() |
protected int |
getSubscriptionProductStockQuantity() |
protected boolean |
isMasterCart(CartModel cartModel) |
void |
recalculateCart(CartModel masterCartModel)
Overrides the super class' method to make sure that in a multi-cart system the master cart and its child carts are
re-calculated.
|
void |
recalculateCart(CommerceCartParameter parameter)
Overrides the super class' method to make sure that in a multi-cart system the master cart and its child carts are
re-calculated.
|
void |
removeAllEntries(CartModel masterCartModel) |
void |
setBaseStoreService(BaseStoreService baseStoreService) |
void |
setBillingTimeService(BillingTimeService billingTimeService) |
void |
setCommercePriceService(SubscriptionCommercePriceService commercePriceService) |
void |
setCommerceStockService(CommerceStockService commerceStockService) |
void |
setMasterCartBillingTimeCode(java.lang.String masterCartBillingTimeCode) |
void |
setSubscriptionCommerceCartStrategy(SubscriptionCommerceCartStrategy subscriptionCommerceCartStrategy) |
void |
setSubscriptionProductService(SubscriptionProductService subscriptionProductService) |
void |
setSubscriptionProductStockQuantity(int subscriptionProductStockQuantity) |
protected boolean |
useBillingFrequencyForProduct(ProductModel subscriptionProduct,
SubscriptionPricePlanModel subscriptionPricePlan) |
addToCart, addToCart, afterCalculate, beforeCalculate, calculateCart, calculateCart, configureCartEntry, estimateTaxes, estimateTaxes, getBaseSiteService, getCartForCodeAndUser, getCartForGuidAndSite, getCartForGuidAndSiteAndUser, getCartsForSiteAndUser, getCartValidationStrategy, getCommerceAddToCartStrategy, getCommerceCartCalculationStrategy, getCommerceCartDao, getCommerceCartEstimateTaxesStrategy, getCommerceCartHashCalculationStrategy, getCommerceCartMergingStrategy, getCommerceCartMetadataUpdateStrategy, getCommerceCartRestorationStrategy, getCommerceCartSplitStrategy, getCommerceRemoveEntriesStrategy, getCommerceUpdateCartEntryStrategy, getModelService, getProductConfigurationStrategy, getRemoveEntryGroupStrategy, getSessionService, getStaleCartRemovalStrategy, mergeCarts, removeAllEntries, removeEntryGroup, removeStaleCarts, removeStaleCarts, restoreCart, restoreCart, setBaseSiteService, setCartValidationStrategy, setCommerceAddToCartStrategy, setCommerceCartCalculationStrategy, setCommerceCartDao, setCommerceCartEstimateTaxesStrategy, setCommerceCartHashCalculationStrategy, setCommerceCartMergingStrategy, setCommerceCartMetadataUpdateStrategy, setCommerceCartRestorationStrategy, setCommerceCartSplitStrategy, setCommerceRemoveEntriesStrategy, setCommerceUpdateCartEntryStrategy, setModelService, setProductConfigurationStrategy, setRemoveEntryGroupStrategy, setSessionService, setStaleCartRemovalStrategy, split, split, updateCartMetadata, updatePointOfServiceForCartEntry, updatePointOfServiceForCartEntry, updateQuantityForCartEntry, updateQuantityForCartEntry, updateToShippingModeForCartEntry, updateToShippingModeForCartEntry, validateCart, validateCartclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddToCart, addToCart, calculateCart, calculateCart, configureCartEntry, estimateTaxes, estimateTaxes, getCartForCodeAndUser, getCartForGuidAndSite, getCartForGuidAndSiteAndUser, getCartsForSiteAndUser, mergeCarts, removeAllEntries, removeEntryGroup, removeStaleCarts, removeStaleCarts, restoreCart, restoreCart, split, split, updateCartMetadata, updatePointOfServiceForCartEntry, updatePointOfServiceForCartEntry, updateQuantityForCartEntry, updateQuantityForCartEntry, updateToShippingModeForCartEntry, updateToShippingModeForCartEntry, validateCart, validateCartpublic DefaultSubscriptionCommerceCartService()
@Deprecated public CommerceCartModification addToCart(CartModel masterCartModel, ProductModel productModel, long quantityToAdd, UnitModel unit, boolean forceNewEntry) throws CommerceCartModificationException
addToCart in interface CommerceCartServiceaddToCart in class DefaultCommerceCartServicemasterCartModel - the user's cart in sessionproductModel - the ProductModel to addquantityToAdd - the quantity to addunit - the UnitModel of the product @see
ProductModel.getUnit()forceNewEntry - the flag for creating a new
CartEntryModelCommerceCartModificationExceptionpublic CommerceCartModification addToCart(CartModel masterCartModel, ProductModel productModel, long quantityToAdd, UnitModel unit, boolean forceNewEntry, java.lang.String xmlProduct, java.lang.String originalSubscriptionId, AbstractOrderEntryModel originalEntry) throws CommerceCartModificationException
addToCart in interface SubscriptionCommerceCartServicemasterCartModel - master cartproductModel - the ProductModel to addquantityToAdd - the quantity to addunit - the UnitModel of the productforceNewEntry - the flag for creating a newCommerceCartModificationException@Deprecated public CommerceCartModification addToCart(CartModel masterCartModel, ProductModel productModel, long quantityToAdd, UnitModel unit, boolean forceNewEntry, java.lang.String xmlProduct) throws CommerceCartModificationException
addToCart in interface SubscriptionCommerceCartServicemasterCartModel - master cartproductModel - the ProductModel to addquantityToAdd - the quantity to addunit - the UnitModel of the productforceNewEntry - the flag for creating a newCommerceCartModificationExceptionpublic java.util.List<BillingTimeModel> getBillingFrequenciesForMasterEntry(AbstractOrderEntryModel entry)
getBillingFrequenciesForMasterEntry in interface SubscriptionCommerceCartServiceentry - AbstractOrderEntryModel to get list of billing frequencies forBillingTimeModelsprotected void addOneRecurringFrequency(SubscriptionPricePlanModel subscriptionPricePlan, java.util.List<BillingTimeModel> billingFrequencies)
protected boolean useBillingFrequencyForProduct(ProductModel subscriptionProduct, SubscriptionPricePlanModel subscriptionPricePlan)
public void removeAllEntries(CartModel masterCartModel)
removeAllEntries in interface CommerceCartServiceremoveAllEntries in class DefaultCommerceCartServicemasterCartModel - the user's cart in sessionprotected AbstractOrderEntryModel getCartEntryToBeUpdated(CartModel cartModel, long entryNumber) throws CommerceCartModificationException
cartModel for the cart entry with has the given entryNumber and
returns it.cartModel - the cartentryNumber - number of the cart entryentryNumberCommerceCartModificationException - if there is no cart entry with the given entryNumberprotected long getAvailableStockLevel(ProductModel productModel, PointOfServiceModel pointOfServiceModel)
productModel - the product in the cartpublic CartModel getChildCartForBillingTime(CartModel masterCart, BillingTimeModel billFreq)
SubscriptionCommerceCartServiceBillingTimeModel, if any.getChildCartForBillingTime in interface SubscriptionCommerceCartServicemasterCart - the CartModel of the master cartbillFreq - the BillingTimeModel to look forCartModel for the given BillingTimeModel or null.public CartModel createChildCartForBillingTime(CartModel masterCart, BillingTimeModel billFreq)
createChildCartForBillingTime in interface SubscriptionCommerceCartServicemasterCart - CartModel representing master cart for which child cart should be createdbillFreq - BillingTimeModel for child cartprotected boolean isMasterCart(CartModel cartModel)
public void checkMasterCart(CartModel cartModel, BillingTimeModel masterCartBillingTimeModel) throws java.lang.IllegalArgumentException, CommerceCartModificationException
CartModel is a master cart and has the correct BillingTimeModel.checkMasterCart in interface SubscriptionCommerceCartServicecartModel - the cart model to be checked whether it is a master cartmasterCartBillingTimeModel - the BillingTimeModel that a master cart must have. If the given cart's billing frequency is
empty the masterCartBillingTimeModel will be set as billing frequencyjava.lang.IllegalArgumentException - if the given cart is not a master cartCommerceCartModificationException - if the given cart's billing frequency does no equal the given masterCartBillingTimeModelpublic void recalculateCart(CartModel masterCartModel) throws CalculationException
recalculateCart in interface CommerceCartServicerecalculateCart in class DefaultCommerceCartServicemasterCartModel - the cart model CartModel (must exist) that will be recalculated CartModel. It must be
the master cart of the multi-cart system. In addition, the master cart's child carts will also be
re-calculated.java.lang.IllegalArgumentException - in case the given masterCartModel is not a master cartCalculationExceptionpublic void recalculateCart(CommerceCartParameter parameter)
recalculateCart in interface CommerceCartServicerecalculateCart in class DefaultCommerceCartServiceparameter - checkout parameter containing the the master cart of the multi-cartpublic CartModel getMasterCartForCartEntry(CartEntryModel cartEntryModel)
SubscriptionCommerceCartServicecartEntryModel. The cartEntryModel may be a master or
child cart entry.getMasterCartForCartEntry in interface SubscriptionCommerceCartServicecartEntryModel - the CartEntryModel whose master CartModel is searchedcartEntryModel's master CartModelprotected void checkQuantityToAdd(long quantityToAdd,
long maxQuantity)
throws CommerceCartModificationException
public void checkQuantityToAdd(long quantityToAdd)
throws CommerceCartModificationException
SubscriptionCommerceCartServicecheckQuantityToAdd in interface SubscriptionCommerceCartServiceCommerceCartModificationException - If given quantity is not allowed to add.protected BillingTimeModel getBillingTimeForCode(java.lang.String code)
public void setMasterCartBillingTimeCode(java.lang.String masterCartBillingTimeCode)
public java.lang.String getMasterCartBillingTimeCode()
SubscriptionCommerceCartServicegetMasterCartBillingTimeCode in interface SubscriptionCommerceCartServicepublic void setBillingTimeService(BillingTimeService billingTimeService)
protected BillingTimeService getBillingTimeService()
public void setSubscriptionProductStockQuantity(int subscriptionProductStockQuantity)
protected int getSubscriptionProductStockQuantity()
protected SubscriptionCommercePriceService getCommercePriceService()
public void setCommercePriceService(SubscriptionCommercePriceService commercePriceService)
protected SubscriptionCommerceCartStrategy getSubscriptionCommerceCartStrategy()
public void setSubscriptionCommerceCartStrategy(SubscriptionCommerceCartStrategy subscriptionCommerceCartStrategy)
protected BaseStoreService getBaseStoreService()
public void setBaseStoreService(BaseStoreService baseStoreService)
protected CommerceStockService getCommerceStockService()
public void setCommerceStockService(CommerceStockService commerceStockService)
protected SubscriptionProductService getSubscriptionProductService()
public void setSubscriptionProductService(SubscriptionProductService subscriptionProductService)
Copyright © 2018 SAP SE. All Rights Reserved.