Class ExternalSubscriptionOpsProvider
java.lang.Object
com.broadleafcommerce.cartoperation.service.provider.external.AbstractExternalProvider
com.broadleafcommerce.cartoperation.service.provider.external.ExternalSubscriptionOpsProvider
- All Implemented Interfaces:
SubscriptionOpsProvider
public class ExternalSubscriptionOpsProvider
extends AbstractExternalProvider
implements SubscriptionOpsProvider
-
Field Summary
Fields inherited from class com.broadleafcommerce.cartoperation.service.provider.external.AbstractExternalProvider
ENTITY_NOT_FOUND -
Constructor Summary
ConstructorsConstructorDescriptionExternalSubscriptionOpsProvider(org.springframework.web.reactive.function.client.WebClient webClient, com.fasterxml.jackson.databind.ObjectMapper objectMapper, com.broadleafcommerce.common.extension.TypeFactory typeFactory, ExternalSubscriptionOpsProviderProperties properties) -
Method Summary
Modifier and TypeMethodDescriptionClears a lock for a subscription.protected StringidentifyCancellationPolicy(IdentifyCancellationPolicyRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Identifies the cancellation policy based on the givenIdentifyCancellationPolicyRequest.lockSubscription(String subscriptionId) Locks a subscription.readUserSubscriptionSummary(@NonNull String userRefType, @NonNull String userRef, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Fetches aUserSubscriptionSummarycontaining information about a user's active and former subscriptions.retrieveCancellationPolicyById(@NonNull String cancellationPolicyId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Retrieves aCancellationPolicyby its id.retrieveSubscriptionPricing(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) RetrievesSubscriptionPriceResponsesdescribing how much the customer should be charged now, & estimations for how much & when they'll be charged in the future as part of subscription billing.Methods inherited from class com.broadleafcommerce.cartoperation.service.provider.external.AbstractExternalProvider
addOffsetOrPageNumber, buildNotFoundException, executeRequest, getHeaders, getObjectMapper, getTypeFactory, getWebClient, isEntityNotFound, pageableToParams, uriVars
-
Constructor Details
-
ExternalSubscriptionOpsProvider
public ExternalSubscriptionOpsProvider(org.springframework.web.reactive.function.client.WebClient webClient, com.fasterxml.jackson.databind.ObjectMapper objectMapper, com.broadleafcommerce.common.extension.TypeFactory typeFactory, ExternalSubscriptionOpsProviderProperties properties)
-
-
Method Details
-
retrieveSubscriptionPricing
public List<SubscriptionPriceResponse> retrieveSubscriptionPricing(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:SubscriptionOpsProviderRetrievesSubscriptionPriceResponsesdescribing how much the customer should be charged now, & estimations for how much & when they'll be charged in the future as part of subscription billing.- Specified by:
retrieveSubscriptionPricingin interfaceSubscriptionOpsProvider- Parameters:
cart- The cart that we are pricing.contextInfo- Context information around sandbox and multitenant state.- Returns:
- a list of
SubscriptionPriceResponses
-
identifyCancellationPolicy
public IdentifyCancellationPolicyResponse identifyCancellationPolicy(IdentifyCancellationPolicyRequest request, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:SubscriptionOpsProviderIdentifies the cancellation policy based on the givenIdentifyCancellationPolicyRequest.- Specified by:
identifyCancellationPolicyin interfaceSubscriptionOpsProvider- Parameters:
request- The request containing the cart items to identify the cancellation policies for.contextInfo- Context information around sandbox and multitenant state.- Returns:
- The
IdentifyCancellationPolicyResponsecontaining the identified cancellation policies.
-
retrieveCancellationPolicyById
public CancellationPolicy retrieveCancellationPolicyById(@NonNull @NonNull String cancellationPolicyId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:SubscriptionOpsProviderRetrieves aCancellationPolicyby its id.- Specified by:
retrieveCancellationPolicyByIdin interfaceSubscriptionOpsProvider- Parameters:
cancellationPolicyId- The Id of theCancellationPolicyto retrieve.contextInfo- Context information around sandbox and multitenant state.- Returns:
- The retrieved
CancellationPolicy
-
readUserSubscriptionSummary
public UserSubscriptionSummary readUserSubscriptionSummary(@NonNull @NonNull String userRefType, @NonNull @NonNull String userRef, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:SubscriptionOpsProviderFetches aUserSubscriptionSummarycontaining information about a user's active and former subscriptions.- Specified by:
readUserSubscriptionSummaryin interfaceSubscriptionOpsProvider- Parameters:
userRefType- The type of user referenceuserRef- The reference to a usercontextInfo- Context information around sandbox and multitenant state.- Returns:
- A
UserSubscriptionSummarycontaining information about a user's active and former subscriptions.
-
lockSubscription
Description copied from interface:SubscriptionOpsProviderLocks a subscription.- Specified by:
lockSubscriptionin interfaceSubscriptionOpsProvider- Parameters:
subscriptionId- The subscription ID to lock.- Returns:
- The status of the lock operation.
-
clearLock
Description copied from interface:SubscriptionOpsProviderClears a lock for a subscription.- Specified by:
clearLockin interfaceSubscriptionOpsProvider- Parameters:
subscriptionId- The subscription ID to clear the lock for.- Returns:
- The status of the lock operation.
-
getServiceClient
-
getProperties
-