Class AbstractSubscriptionFacade
- java.lang.Object
-
- de.hybris.platform.subscriptionfacades.impl.AbstractSubscriptionFacade
-
- All Implemented Interfaces:
SubscriptionFacade
- Direct Known Subclasses:
DefaultCisSubscriptionFacade
,DefaultSubscriptionFacade
public abstract class AbstractSubscriptionFacade extends java.lang.Object implements SubscriptionFacade
Abstract subscription facade.
-
-
Constructor Summary
Constructors Constructor Description AbstractSubscriptionFacade()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected CCPaymentInfoData
createEmptyCCPaymentInfoData()
Creates an emptyCCPaymentInfoData
object.protected SubscriptionPaymentData
createEmptySubscriptionPaymentData()
Creates an emptySubscriptionPaymentData
object.protected BaseStoreService
getBaseStoreService()
protected CartService
getCartService()
protected CheckoutFacade
getCheckoutFacade()
protected Converter<CreditCardPaymentInfoModel,CCPaymentInfoData>
getCreditCardPaymentInfoConverter()
protected java.lang.String
getCurrencyIso()
protected java.lang.String
getCurrentCustomerId()
protected CustomerAccountService
getCustomerAccountService()
protected CustomerResolutionService
getCustomerResolutionService()
protected ModelService
getModelService()
AbstractOrderEntryModel
getOrderEntryForOrderCodeAndEntryNumber(java.lang.String orderCode, int entryNumber)
Returns theAbstractOrderEntryModel
for the given orderCode and entryNumber.protected OrderService
getOrderService()
protected ProductFacade
getProductFacade()
java.util.Date
getSubscriptionEndDate(ProductData subscriptionProductData, java.util.Date startDate)
Calculates an end date for a subscription product based on its subscription term details.java.util.List<SubscriptionData>
getSubscriptionsForPaymentMethod(java.lang.String paymentMethodId)
Returns a list of subscriptions for the given paymentMethodId of the current user.java.util.List<ProductData>
getUpsellingOptionsForSubscription(java.lang.String productCode)
Returns a list of possible upgrade options for the given subscription product.void
setBaseStoreService(BaseStoreService baseStoreService)
void
setCartService(CartService cartService)
void
setCheckoutFacade(CheckoutFacade checkoutFacade)
void
setCreditCardPaymentInfoConverter(Converter<CreditCardPaymentInfoModel,CCPaymentInfoData> creditCardPaymentInfoConverter)
void
setCustomerAccountService(CustomerAccountService customerAccountService)
void
setCustomerResolutionService(CustomerResolutionService customerResolutionService)
void
setModelService(ModelService modelService)
void
setOrderService(OrderService orderService)
void
setProductFacade(ProductFacade productFacade)
CCPaymentInfoData
updateCreatedPaymentMethod(CCPaymentInfoData paymentInfo, java.util.Map<java.lang.String,java.lang.String> paramMap)
Updates an newly-created Payment Type with the Subscription Service information.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.hybris.platform.subscriptionfacades.SubscriptionFacade
changePaymentMethod, changeSubscriptionState, createPaymentSubscription, createSubscriptions, extendSubscriptionTermDuration, finalizeTransaction, getBillingActivityDetail, getBillingActivityList, getSubscription, getSubscriptions, getUpgradePreviewBillings, hpfUrl, initializeTransaction, replacePaymentMethod, replacePaymentMethod, updateProfile, updateSubscription, updateSubscriptionAutorenewal
-
-
-
-
Method Detail
-
createEmptyCCPaymentInfoData
@Nonnull protected CCPaymentInfoData createEmptyCCPaymentInfoData()
Creates an emptyCCPaymentInfoData
object.- Returns:
- An empty
CCPaymentInfoData
object
-
createEmptySubscriptionPaymentData
@Nonnull protected SubscriptionPaymentData createEmptySubscriptionPaymentData()
Creates an emptySubscriptionPaymentData
object.- Returns:
- An empty
SubscriptionPaymentData
object
-
getCurrencyIso
@Nullable protected java.lang.String getCurrencyIso()
-
getSubscriptionEndDate
@Nonnull public java.util.Date getSubscriptionEndDate(@Nonnull ProductData subscriptionProductData, @Nullable java.util.Date startDate)
Description copied from interface:SubscriptionFacade
Calculates an end date for a subscription product based on its subscription term details.- Specified by:
getSubscriptionEndDate
in interfaceSubscriptionFacade
- Parameters:
subscriptionProductData
- ptoduct data with information about subscription termsstartDate
- start date of the subscription- Returns:
- the calculated end date
-
getUpsellingOptionsForSubscription
@Nonnull public java.util.List<ProductData> getUpsellingOptionsForSubscription(@Nonnull java.lang.String productCode)
Description copied from interface:SubscriptionFacade
Returns a list of possible upgrade options for the given subscription product.- Specified by:
getUpsellingOptionsForSubscription
in interfaceSubscriptionFacade
- Parameters:
productCode
- code of the subscription product- Returns:
List
ofProductData
-
getCurrentCustomerId
@Nullable protected java.lang.String getCurrentCustomerId()
-
getOrderEntryForOrderCodeAndEntryNumber
@Nullable public AbstractOrderEntryModel getOrderEntryForOrderCodeAndEntryNumber(@Nonnull java.lang.String orderCode, int entryNumber)
Description copied from interface:SubscriptionFacade
Returns theAbstractOrderEntryModel
for the given orderCode and entryNumber.- Specified by:
getOrderEntryForOrderCodeAndEntryNumber
in interfaceSubscriptionFacade
- Parameters:
orderCode
- code of the given orderentryNumber
- entry number in the order- Returns:
AbstractOrderEntryModel
ornull
if not found
-
getSubscriptionsForPaymentMethod
@Nonnull public java.util.List<SubscriptionData> getSubscriptionsForPaymentMethod(@Nullable java.lang.String paymentMethodId) throws SubscriptionFacadeException
Description copied from interface:SubscriptionFacade
Returns a list of subscriptions for the given paymentMethodId of the current user.- Specified by:
getSubscriptionsForPaymentMethod
in interfaceSubscriptionFacade
- Parameters:
paymentMethodId
- the ID of the payment method- Returns:
- list of subscriptions
- Throws:
SubscriptionFacadeException
- if operation cannot be performed
-
updateCreatedPaymentMethod
@Nonnull public CCPaymentInfoData updateCreatedPaymentMethod(@Nonnull CCPaymentInfoData paymentInfo, @Nonnull java.util.Map<java.lang.String,java.lang.String> paramMap) throws SubscriptionFacadeException
Description copied from interface:SubscriptionFacade
Updates an newly-created Payment Type with the Subscription Service information. This method differs fromSubscriptionFacade.changePaymentMethod(CCPaymentInfoData, String, boolean, Map)
because it must be used only during the creation of a new payment method (created by the PaymentFacade).SubscriptionFacade.changePaymentMethod(CCPaymentInfoData, String, boolean, Map)
must be used changing details at a later time.- Specified by:
updateCreatedPaymentMethod
in interfaceSubscriptionFacade
- Parameters:
paymentInfo
- the payment info data relating to the recently-created Payment TypeparamMap
- the detail map containing new subscription information.- Returns:
- an updated paymentInfo, or null if the update fails.
- Throws:
SubscriptionFacadeException
- if created payment method cannot be updated
-
getCartService
protected CartService getCartService()
-
setCartService
public void setCartService(CartService cartService)
-
getCheckoutFacade
protected CheckoutFacade getCheckoutFacade()
-
setCheckoutFacade
public void setCheckoutFacade(CheckoutFacade checkoutFacade)
-
getCreditCardPaymentInfoConverter
protected Converter<CreditCardPaymentInfoModel,CCPaymentInfoData> getCreditCardPaymentInfoConverter()
-
setCreditCardPaymentInfoConverter
public void setCreditCardPaymentInfoConverter(Converter<CreditCardPaymentInfoModel,CCPaymentInfoData> creditCardPaymentInfoConverter)
-
getCustomerResolutionService
protected CustomerResolutionService getCustomerResolutionService()
-
setCustomerResolutionService
public void setCustomerResolutionService(CustomerResolutionService customerResolutionService)
-
getProductFacade
protected ProductFacade getProductFacade()
-
setProductFacade
public void setProductFacade(ProductFacade productFacade)
-
getCustomerAccountService
protected CustomerAccountService getCustomerAccountService()
-
setCustomerAccountService
public void setCustomerAccountService(CustomerAccountService customerAccountService)
-
getBaseStoreService
protected BaseStoreService getBaseStoreService()
-
setBaseStoreService
public void setBaseStoreService(BaseStoreService baseStoreService)
-
getOrderService
protected OrderService getOrderService()
-
setOrderService
public void setOrderService(OrderService orderService)
-
getModelService
protected ModelService getModelService()
-
setModelService
public void setModelService(ModelService modelService)
-
-