Class DefaultSubscriptionFacade
java.lang.Object
de.hybris.platform.subscriptionfacades.impl.AbstractSubscriptionFacade
de.hybris.platform.subscriptionfacades.impl.DefaultSubscriptionFacade
- All Implemented Interfaces:
SubscriptionFacade
Default implementation of the
SubscriptionFacade interface providing No-op implementations of the interface
methods.-
Field Summary
Fields inherited from class de.hybris.platform.subscriptionfacades.impl.AbstractSubscriptionFacade
MAXIMUM_NUMBER_OF_REFERENCES, QUARTER_NUMBER_OF_MONTHS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionchangePaymentMethod(CCPaymentInfoData paymentInfo, String action, boolean propagate, Map<String, String> parameters) Changes an existing payment method.Updates the state of an existing subscription.protected SubscriptionPaymentDataCreates an emptySubscriptionPaymentDataobject.createPaymentSubscription(Map<String, String> paymentParameters) Creates a payment subscription on the hybris side.createSubscriptions(OrderData order, Map<String, String> parameters) Creates subscriptions for the given order and current user.extendSubscriptionTermDuration(String subscriptionId, Integer contractDurationExtension, Map<String, String> parameters) Extends the subscription term duration of an existing subscription.finalizeTransaction(String authorizationRequestId, String authorizationRequestToken, Map<String, String> parameters) Finalizes an established subscription with the subscription billing provider.getBillingActivityDetail(String billingActivityId, Map<String, String> parameters) Returns a file stream containing detail information for the specified billing activity.getBillingActivityList(String subscriptionId, Map<String, String> parameters) Returns a list of billing activities for the given subscription.getSubscription(String subscriptionId) Returns the subscription with the given ID.Returns all subscriptions for the current user.getUpgradePreviewBillings(String subscriptionId, String upgradeId) Returns a list of the possible billing changes between the current subscription and an upgrade option.hpfUrl()Returns the HPF URL.initializeTransaction(String clientIpAddress, String returnUrl, String cancelReturnUrl, Map<String, String> parameters) Initializes a transaction with the subscription billing provider.replacePaymentMethod(String subscriptionId, String paymentMethodId, String effectiveFrom, Map<String, String> parameters) Replaces the payment method for the given subscription and effectiveFrom.Replaces the payment method for the given subscription.updateProfile(Map<String, String> parameters) Creates or updates a subscription profile for the current user.updateSubscription(String subscriptionId, boolean force, SubscriptionUpdateActionEnum action, Map<String, String> parameters) Updates the given subscription (e.g.updateSubscriptionAutorenewal(String subscriptionId, boolean isAutorenewal, Map<String, String> parameters) Updates the auto-renewal status of an existing subscription.Methods inherited from class de.hybris.platform.subscriptionfacades.impl.AbstractSubscriptionFacade
createEmptyCCPaymentInfoData, getBaseStoreService, getCartService, getCheckoutFacade, getCreditCardPaymentInfoConverter, getCurrencyIso, getCurrentCustomerId, getCustomerAccountService, getCustomerResolutionService, getModelService, getOrderEntryForOrderCodeAndEntryNumber, getOrderService, getProductFacade, getSubscriptionEndDate, getSubscriptionsForPaymentMethod, getUpsellingOptionsForSubscription, setBaseStoreService, setCartService, setCheckoutFacade, setCreditCardPaymentInfoConverter, setCustomerAccountService, setCustomerResolutionService, setModelService, setOrderService, setProductFacade, updateCreatedPaymentMethod
-
Constructor Details
-
DefaultSubscriptionFacade
public DefaultSubscriptionFacade()
-
-
Method Details
-
updateProfile
@Nonnull public SubscriptionPaymentData updateProfile(Map<String, String> parameters) throws SubscriptionFacadeExceptionDescription copied from interface:SubscriptionFacadeCreates or updates a subscription profile for the current user.- Parameters:
parameters- provider specific parameters- Returns:
SubscriptionPaymentDatacontaining the results of the operation- Throws:
SubscriptionFacadeException- if operation cannot be performed
-
createSubscriptions
public SubscriptionPaymentData createSubscriptions(@Nonnull OrderData order, Map<String, String> parameters) throws SubscriptionFacadeExceptionDescription copied from interface:SubscriptionFacadeCreates subscriptions for the given order and current user.- Parameters:
order- the order to create the subscriptions forparameters- provider specific parameters- Returns:
SubscriptionPaymentDatacontaining the results of the operation- Throws:
SubscriptionFacadeException- if subscription cannot be created
-
initializeTransaction
@Nonnull public SubscriptionPaymentData initializeTransaction(String clientIpAddress, String returnUrl, String cancelReturnUrl, Map<String, String> parameters) throws SubscriptionFacadeExceptionDescription copied from interface:SubscriptionFacadeInitializes a transaction with the subscription billing provider.- Parameters:
clientIpAddress- the IP address of the calling client. May be empty.returnUrl- the URL to redirect to after the silent from post. May not be null or empty.cancelReturnUrl- the URL to redirect to in case of errors after the silent from post. May not be null or empty.parameters- provider specific parameters- Returns:
SubscriptionPaymentDatacontaining the results of the operation (hpfUrl and session token). result.getParameters().get("sessionTransactionToken") returns not-null String value.- Throws:
SubscriptionFacadeException- if operation cannot be performed
-
finalizeTransaction
@Nonnull public SubscriptionPaymentData finalizeTransaction(String authorizationRequestId, String authorizationRequestToken, Map<String, String> parameters) throws SubscriptionFacadeExceptionDescription copied from interface:SubscriptionFacadeFinalizes an established subscription with the subscription billing provider.- Parameters:
authorizationRequestId- the request IDauthorizationRequestToken- the request token retrieved from the result of aSubscriptionFacade.initializeTransaction(java.lang.String, java.lang.String, java.lang.String, java.util.Map<java.lang.String, java.lang.String>)call.parameters- provider specific parameters- Returns:
SubscriptionPaymentDatacontaining the results of the operation- Throws:
SubscriptionFacadeException- if operation cannot be performed
-
changePaymentMethod
@Nonnull public CCPaymentInfoData changePaymentMethod(@Nonnull CCPaymentInfoData paymentInfo, String action, boolean propagate, Map<String, String> parameters) throws SubscriptionFacadeExceptionDescription copied from interface:SubscriptionFacadeChanges an existing payment method.- Parameters:
paymentInfo-CCPaymentInfoDatathe updated payment informationaction-Stringthe change action to perform (currently supported: "enable", "disable")propagate- determines whether to propagate the change to all billing subscriptions using the given payment methodparameters- provider specific parameters- Returns:
CCPaymentInfoDatacontaining the results of the operation- Throws:
SubscriptionFacadeException- if payment method cannot be changed
-
replacePaymentMethod
@Nonnull public SubscriptionPaymentData replacePaymentMethod(String subscriptionId, String paymentMethodId, Map<String, String> parameters) throws SubscriptionFacadeExceptionDescription copied from interface:SubscriptionFacadeReplaces the payment method for the given subscription.- Parameters:
subscriptionId- the ID of the subscription to replace the payment method forpaymentMethodId- the ID of the new payment method which replaces the current oneparameters- provider specific parameters- Returns:
SubscriptionPaymentDatacontaining the results of the operation- Throws:
SubscriptionFacadeException- if payment method cannot be replaced
-
replacePaymentMethod
@Nonnull public SubscriptionData replacePaymentMethod(String subscriptionId, String paymentMethodId, String effectiveFrom, Map<String, String> parameters) throws SubscriptionFacadeExceptionDescription copied from interface:SubscriptionFacadeReplaces the payment method for the given subscription and effectiveFrom.- Parameters:
subscriptionId- the ID of the subscriptionpaymentMethodId- the ID of the payment method to seteffectiveFrom- determines when the replacement will take effectparameters- provider specific parameters- Returns:
SubscriptionDatacontaining the results of the operation- Throws:
SubscriptionFacadeException- if operation cannot be performed
-
createPaymentSubscription
public CCPaymentInfoData createPaymentSubscription(Map<String, String> paymentParameters) throws SubscriptionFacadeExceptionDescription copied from interface:SubscriptionFacadeCreates a payment subscription on the hybris side.- Parameters:
paymentParameters- parameters retrieved from the result of aSubscriptionFacade.finalizeTransaction(java.lang.String, java.lang.String, java.util.Map<java.lang.String, java.lang.String>)call.- Returns:
CCPaymentInfoDatathe payment information created based on the given parameters- Throws:
SubscriptionFacadeException- if operation cannot be performed
-
updateSubscription
@Nonnull public SubscriptionPaymentData updateSubscription(String subscriptionId, boolean force, SubscriptionUpdateActionEnum action, Map<String, String> parameters) throws SubscriptionFacadeExceptionDescription copied from interface:SubscriptionFacadeUpdates the given subscription (e.g. cancel)- Parameters:
subscriptionId- the subscription to updateforce- determines whether to force the update or notaction- the update action to performparameters- provider specific parameters- Returns:
SubscriptionPaymentDatacontaining the results of the operation- Throws:
SubscriptionFacadeException- if operation cannot be performed
-
getSubscriptions
Description copied from interface:SubscriptionFacadeReturns all subscriptions for the current user.- Returns:
Collection<SubscriptionData> the current user's subscription- Throws:
SubscriptionFacadeException- if operation cannot be performed
-
getSubscription
Description copied from interface:SubscriptionFacadeReturns the subscription with the given ID.- Parameters:
subscriptionId- the ID of the subscription- Returns:
SubscriptionDatathe subscription with the given ID- Throws:
SubscriptionFacadeException- if operation cannot be performed
-
hpfUrl
Description copied from interface:SubscriptionFacadeReturns the HPF URL.- Returns:
- the HPF URL
- Throws:
SubscriptionFacadeException- if operation cannot be performed
-
getUpgradePreviewBillings
public List<SubscriptionBillingData> getUpgradePreviewBillings(String subscriptionId, String upgradeId) throws SubscriptionFacadeException Description copied from interface:SubscriptionFacadeReturns a list of the possible billing changes between the current subscription and an upgrade option.- Parameters:
subscriptionId- the current subscriptionupgradeId- the upgrade option- Returns:
ListofSubscriptionBillingData- Throws:
SubscriptionFacadeException- if operation cannot be performed
-
updateSubscriptionAutorenewal
@Nonnull public SubscriptionData updateSubscriptionAutorenewal(String subscriptionId, boolean isAutorenewal, Map<String, String> parameters) throws SubscriptionFacadeExceptionDescription copied from interface:SubscriptionFacadeUpdates the auto-renewal status of an existing subscription.- Parameters:
subscriptionId- the ID of the subscriptionisAutorenewal- the new auto-renewal status of the subscriptionparameters- provider specific parameters- Returns:
SubscriptionDatacontaining the results of the operation- Throws:
SubscriptionFacadeException- if operation cannot be performed
-
changeSubscriptionState
@Nonnull public SubscriptionData changeSubscriptionState(String subscriptionId, String newStatus, Map<String, String> parameters) throws SubscriptionFacadeExceptionDescription copied from interface:SubscriptionFacadeUpdates the state of an existing subscription.- Parameters:
subscriptionId- the ID of the subscriptionnewStatus- new status of the subscriptionparameters- provider specific parameters- Returns:
SubscriptionDatacontaining the results of the operation- Throws:
SubscriptionFacadeException- if operation cannot be performed
-
extendSubscriptionTermDuration
@Nonnull public SubscriptionData extendSubscriptionTermDuration(String subscriptionId, Integer contractDurationExtension, Map<String, String> parameters) throws SubscriptionFacadeExceptionDescription copied from interface:SubscriptionFacadeExtends the subscription term duration of an existing subscription.- Parameters:
subscriptionId- the ID of the subscriptioncontractDurationExtension- extends the duration x timesparameters- provider specific parameters- Returns:
SubscriptionDatacontaining the results of the operation- Throws:
SubscriptionFacadeException- if operation cannot be performed
-
getBillingActivityList
public List<SubscriptionBillingData> getBillingActivityList(String subscriptionId, Map<String, String> parameters) throws SubscriptionFacadeExceptionDescription copied from interface:SubscriptionFacadeReturns a list of billing activities for the given subscription.- Parameters:
subscriptionId- the ID of the subscriptionparameters- provider specific parameters- Returns:
List<SubscriptionBillingData>- Throws:
SubscriptionFacadeException- if operation cannot be performed
-
getBillingActivityDetail
public SubscriptionBillingDetailFileStream getBillingActivityDetail(String billingActivityId, Map<String, String> parameters) throws SubscriptionFacadeExceptionDescription copied from interface:SubscriptionFacadeReturns a file stream containing detail information for the specified billing activity.- Parameters:
billingActivityId- the ID of the billing activityparameters- provider specific parameters- Returns:
SubscriptionBillingDetailFileStream- Throws:
SubscriptionFacadeException- if operation cannot be performed
-
createEmptySubscriptionPaymentData
Description copied from class:AbstractSubscriptionFacadeCreates an emptySubscriptionPaymentDataobject.- Overrides:
createEmptySubscriptionPaymentDatain classAbstractSubscriptionFacade- Returns:
- An empty
SubscriptionPaymentDataobject
-