@maxio-com/self-service 1.0.2 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/maxio-components.cjs.js +1 -1
- package/dist/maxio-components.esm.js +1 -1
- package/dist/maxio-components.umd.js +622 -50
- package/package.json +1 -1
- package/typings/packages/billing-history/src/components/Filters/components/FilterBox/FilterBox.styles.d.ts +1 -1
- package/typings/packages/custom-fields/src/utils/renderField.d.ts +3 -2
- package/typings/packages/custom-ui-components/src/components/atoms/BodyText/BodyText.d.ts +2 -1
- package/typings/packages/custom-ui-components/src/components/atoms/BodyText/BodyText.styles.d.ts +2 -0
- package/typings/packages/custom-ui-components/src/components/atoms/Box/Box.styles.d.ts +2 -2
- package/typings/packages/custom-ui-components/src/components/atoms/Checkbox/Checkbox.d.ts +1 -1
- package/typings/packages/customer-details/src/components/CustomFieldsForm/CustomFieldsForm.d.ts +3 -2
- package/typings/packages/data-access/src/DataAccess.d.ts +87 -1
- package/typings/packages/data-access/src/types/index.d.ts +2 -2
- package/typings/packages/data-access/src/types/product.d.ts +9 -0
- package/typings/packages/data-access/src/types/subscription.d.ts +12 -10
- package/typings/packages/subscriptions-manager/src/components/CustomFieldsForm/CustomFieldsForm.d.ts +3 -2
- package/typings/packages/subscriptions-manager/src/components/PaymentProfilesReplace/PaymentProfilesReplace.d.ts +9 -0
- package/typings/packages/subscriptions-manager/src/components/PaymentProfilesReplace/PaymentProfilesReplace.styles.d.ts +2 -0
- package/typings/packages/subscriptions-manager/src/components/PaymentProfilesReplace/components/ExpiredStatus/ExpiredStatus.styles.d.ts +1 -0
- package/typings/packages/subscriptions-manager/src/components/PaymentProfilesReplace/components/ExpiredStatus/ExpitredStatus.d.ts +6 -0
- package/typings/packages/subscriptions-manager/src/components/PaymentProfilesReplace/components/ExpiredStatus/index.d.ts +2 -0
- package/typings/packages/subscriptions-manager/src/components/PaymentProfilesReplace/components/PaymentProfileItem/PaymentProfileItem.d.ts +9 -0
- package/typings/packages/subscriptions-manager/src/components/PaymentProfilesReplace/components/PaymentProfileItem/PaymentProfileItem.styles.d.ts +1 -0
- package/typings/packages/subscriptions-manager/src/components/PaymentProfilesReplace/components/PaymentProfileItem/components/Label.d.ts +8 -0
- package/typings/packages/subscriptions-manager/src/components/PaymentProfilesReplace/components/PaymentProfileItem/components/Label.styles.d.ts +1 -0
- package/typings/packages/subscriptions-manager/src/components/PaymentProfilesReplace/components/PaymentProfileItem/components/index.d.ts +2 -0
- package/typings/packages/subscriptions-manager/src/components/PaymentProfilesReplace/components/PaymentProfileItem/helpers.d.ts +1 -0
- package/typings/packages/subscriptions-manager/src/components/PaymentProfilesReplace/components/PaymentProfileItem/index.d.ts +2 -0
- package/typings/packages/subscriptions-manager/src/components/PaymentProfilesReplace/components/index.d.ts +3 -0
- package/typings/packages/subscriptions-manager/src/components/PaymentProfilesReplace/index.d.ts +2 -0
- package/typings/packages/subscriptions-manager/src/components/PaymentProfilesReplaceAlerts/PaymentProfilesReplace.styles.d.ts +3 -0
- package/typings/packages/subscriptions-manager/src/components/PaymentProfilesReplaceAlerts/PaymentProfilesReplaceAlerts.d.ts +20 -0
- package/typings/packages/subscriptions-manager/src/components/PaymentProfilesReplaceAlerts/index.d.ts +2 -0
- package/typings/packages/subscriptions-manager/src/components/PlanChangeAlerts/PlanChangeAlerts.d.ts +10 -0
- package/typings/packages/subscriptions-manager/src/components/PlanChangeAlerts/index.d.ts +2 -0
- package/typings/packages/subscriptions-manager/src/components/PlanChangeSummary/PlanChangeSummary.d.ts +11 -0
- package/typings/packages/subscriptions-manager/src/components/PlanChangeSummary/index.d.ts +2 -0
- package/typings/packages/subscriptions-manager/src/components/PlanChangeSummaryCharges/PlanChangeSummaryCharges.d.ts +9 -0
- package/typings/packages/subscriptions-manager/src/components/PlanChangeSummaryCharges/index.d.ts +2 -0
- package/typings/packages/subscriptions-manager/src/components/PlanChangeSummaryCharges/utils/mapChargeSummaryToTable.d.ts +12 -0
- package/typings/packages/subscriptions-manager/src/components/PlanRadio/PlanRadio.d.ts +13 -0
- package/typings/packages/subscriptions-manager/src/components/PlanRadio/PlanRadio.styles.d.ts +4 -0
- package/typings/packages/subscriptions-manager/src/components/PlanRadio/components/Price/Price.d.ts +7 -0
- package/typings/packages/subscriptions-manager/src/components/PlanRadio/components/Price/Price.styles.d.ts +1 -0
- package/typings/packages/subscriptions-manager/src/components/PlanRadio/components/Status/Status.d.ts +6 -0
- package/typings/packages/subscriptions-manager/src/components/PlanRadio/components/Status/Status.styles.d.ts +1 -0
- package/typings/packages/subscriptions-manager/src/components/PlanRadio/index.d.ts +2 -0
- package/typings/packages/subscriptions-manager/src/components/SubscriptionDetails/components/DetailRow/DetailRow.d.ts +6 -0
- package/typings/packages/subscriptions-manager/src/components/SubscriptionDetails/components/PlanChangeScheduled/PlanChangeScheduled.d.ts +8 -0
- package/typings/packages/subscriptions-manager/src/components/SubscriptionDetails/components/PlanChangeScheduled/index.d.ts +2 -0
- package/typings/packages/subscriptions-manager/src/components/SubscriptionDetails/components/index.d.ts +2 -1
- package/typings/packages/subscriptions-manager/src/components/{ComponentsAllocationPreview/ComponentsAllocationPreview.styles.d.ts → Summary/Summary.styles.d.ts} +0 -1
- package/typings/packages/subscriptions-manager/src/components/Summary/index.d.ts +2 -0
- package/typings/packages/subscriptions-manager/src/components/TotalCharge/TotalCharge.styles.d.ts +1 -0
- package/typings/packages/subscriptions-manager/src/components/TotalCharge/index.d.ts +2 -0
- package/typings/packages/subscriptions-manager/src/components/index.d.ts +5 -1
- package/typings/packages/subscriptions-manager/src/containers/ChangePlanContainer/ChangePlan.styles.d.ts +1 -0
- package/typings/packages/subscriptions-manager/src/containers/ChangePlanContainer/ChangePlanContainer.d.ts +10 -0
- package/typings/packages/subscriptions-manager/src/containers/ChangePlanContainer/index.d.ts +2 -0
- package/typings/packages/subscriptions-manager/src/containers/PreviewProductMigrationContainer/PreviewProductMigrationContainer.d.ts +9 -0
- package/typings/packages/subscriptions-manager/src/containers/PreviewProductMigrationContainer/index.d.ts +2 -0
- package/typings/packages/subscriptions-manager/src/containers/ReplacePaymentProfilesContainer/ReplacePaymentProfilesContainer.d.ts +7 -0
- package/typings/packages/subscriptions-manager/src/containers/ReplacePaymentProfilesContainer/index.d.ts +2 -0
- package/typings/packages/subscriptions-manager/src/containers/SubscriptionContainer/hooks/useSubscriptionAvailableActions.d.ts +2 -1
- package/typings/packages/subscriptions-manager/src/containers/index.d.ts +4 -1
- package/typings/packages/subscriptions-manager/src/hooks/index.d.ts +2 -1
- package/typings/packages/subscriptions-manager/src/hooks/useChangePlan.d.ts +4 -0
- package/typings/packages/subscriptions-manager/src/hooks/useCreatePaymentProfile/useCreatePaymentProfile.d.ts +2 -1
- package/typings/packages/subscriptions-manager/src/machines/changePlan/changePlan.d.ts +5 -0
- package/typings/packages/subscriptions-manager/src/machines/changePlan/index.d.ts +4 -0
- package/typings/packages/subscriptions-manager/src/machines/changePlan/selectors.d.ts +31 -0
- package/typings/packages/subscriptions-manager/src/machines/changePlan/types.d.ts +39 -0
- package/typings/packages/subscriptions-manager/src/machines/createPaymentProfile/actions.d.ts +4 -0
- package/typings/packages/subscriptions-manager/src/machines/createPaymentProfile/selectors.d.ts +14 -0
- package/typings/packages/subscriptions-manager/src/machines/createPaymentProfile/types.d.ts +29 -1
- package/typings/packages/subscriptions-manager/src/machines/index.d.ts +2 -1
- package/typings/packages/subscriptions-manager/src/machines/modals/selectors.d.ts +16 -0
- package/typings/packages/subscriptions-manager/src/machines/modals/types.d.ts +10 -0
- package/typings/packages/subscriptions-manager/src/machines/subscriptions/actions.d.ts +1 -0
- package/typings/packages/subscriptions-manager/src/modals/ChangeSubscriptionPlan/ChangeSubscriptionPlan.d.ts +3 -0
- package/typings/packages/subscriptions-manager/src/modals/ChangeSubscriptionPlan/components/Content/Content.d.ts +10 -0
- package/typings/packages/subscriptions-manager/src/modals/ChangeSubscriptionPlan/components/Content/components/ErrorAlert.d.ts +2 -0
- package/typings/packages/subscriptions-manager/src/modals/ChangeSubscriptionPlan/components/Content/index.d.ts +2 -0
- package/typings/packages/subscriptions-manager/src/modals/ChangeSubscriptionPlan/components/index.d.ts +2 -0
- package/typings/packages/subscriptions-manager/src/modals/ChangeSubscriptionPlan/index.d.ts +2 -0
- package/typings/packages/subscriptions-manager/src/modals/CreatePaymentProfile/components/Content/Content.d.ts +2 -1
- package/typings/packages/subscriptions-manager/src/modals/index.d.ts +2 -1
- package/typings/packages/subscriptions-manager/src/models/subscription/types.d.ts +2 -1
- package/typings/packages/subscriptions-manager/src/types.d.ts +1 -1
|
@@ -5,6 +5,7 @@ export declare enum SubscriptionActions {
|
|
|
5
5
|
RESUME = "RESUME",
|
|
6
6
|
CANCEL = "CANCEL",
|
|
7
7
|
UNDO_CANCELATION = "UNDO_CANCELATION",
|
|
8
|
-
REACTIVATE = "REACTIVATE"
|
|
8
|
+
REACTIVATE = "REACTIVATE",
|
|
9
|
+
CHANGE_PLAN = "CHANGE_PLAN"
|
|
9
10
|
}
|
|
10
11
|
export declare const useSubscriptionAvailableActions: (subscription: Partial<SubscriptionModel>, subscriptionScopes: SubscriptionScopes[]) => SubscriptionActions[];
|
|
@@ -8,4 +8,7 @@ import CreatePaymentProfileContainer from './CreatePaymentProfileContainer';
|
|
|
8
8
|
import CreatePaymentProfileErrorContainer from './CreatePaymentProfileErrorContainer';
|
|
9
9
|
import ComponentAllocationsContainer from './ComponentsAllocationContainer';
|
|
10
10
|
import ModalsContainer from './ModalsContainer';
|
|
11
|
-
|
|
11
|
+
import ChangePlanContainer from './ChangePlanContainer';
|
|
12
|
+
import PreviewProductMigrationContainer from './PreviewProductMigrationContainer';
|
|
13
|
+
import ReplacePaymentProfilesContainer from './ReplacePaymentProfilesContainer';
|
|
14
|
+
export { PreviewProductMigrationContainer, ChangePlanContainer, ModalsContainer, ComponentsContainer, ComponentContainer, PaymentProfilesContainer, PaymentProfileContainer, SubscriptionContainer, SubscriptionsContainer, ComponentAllocationsContainer, CreatePaymentProfileContainer, CreatePaymentProfileErrorContainer, ReplacePaymentProfilesContainer, };
|
|
@@ -14,5 +14,6 @@ import { useAvailablePaymentMethods, PaymentMethods } from './useAvailablePaymen
|
|
|
14
14
|
import { useChangePaymentProfile } from './useChangePaymentProfile';
|
|
15
15
|
import { useSortPaymentProfiles } from './useSortPaymentProfiles';
|
|
16
16
|
import { useDeletePaymentProfile } from './useDeletePaymentProfile';
|
|
17
|
-
|
|
17
|
+
import { useChangePlan } from './useChangePlan';
|
|
18
|
+
export { useChangePlan, useDeletePaymentProfile, useSortPaymentProfiles, useChangePaymentProfile, useReactivateSubscription, useCancelSubscriptionService, useSubscriptionResumeService, useServices, useDataAccess, useSubscriptionStatus, useFormatSubscriptionDetails, useComponentSettings, useCreatePaymentProfile, useAddonsConfigurationService, useUndoCancelationService, usePaymentProfileAvailableActions, useAvailablePaymentMethods, PaymentProfileActions, };
|
|
18
19
|
export type { FormattedSubscriptionDetails, PaymentMethods };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const useChangePlan: (catalogId: number, subscriptionId: number, currentPlanId: number, onSuccess: () => void) => import("xstate").Interpreter<import("../machines/changePlan/types").Context, any, import("../machines/changePlan/types").Events, {
|
|
2
|
+
value: any;
|
|
3
|
+
context: import("../machines/changePlan/types").Context;
|
|
4
|
+
}, import("xstate").ResolveTypegenMeta<import("xstate").TypegenDisabled, import("../machines/changePlan/types").Events, import("xstate").BaseActionObject, import("xstate").ServiceMap>>;
|
|
@@ -5,8 +5,9 @@ declare type Options = {
|
|
|
5
5
|
subscriptionId: number;
|
|
6
6
|
paymentMethodType: PaymentMethod;
|
|
7
7
|
onCreateSuccess: () => void;
|
|
8
|
+
activePaymentProfileId: number;
|
|
8
9
|
};
|
|
9
|
-
export declare const useCreatePaymentProfile: ({ formElementId,
|
|
10
|
+
export declare const useCreatePaymentProfile: ({ formElementId, paymentMethodType, onCreateSuccess, activePaymentProfileId, }: Options) => {
|
|
10
11
|
isProcessing: boolean;
|
|
11
12
|
isProfileConnectionError: boolean;
|
|
12
13
|
savePaymentMethod: () => import("xstate").State<import("../../machines/createPaymentProfile/types").Context, import("../../machines/createPaymentProfile/types").Events, any, {
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Context, Events } from './types';
|
|
2
|
+
export declare const changePlan: import("xstate").StateMachine<Context, any, Events, {
|
|
3
|
+
value: any;
|
|
4
|
+
context: Context;
|
|
5
|
+
}, import("xstate").BaseActionObject, import("xstate").ServiceMap, import("xstate").ResolveTypegenMeta<import("xstate").TypegenDisabled, Events, import("xstate").BaseActionObject, import("xstate").ServiceMap>>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { State } from 'xstate';
|
|
2
|
+
import { changePlan } from './changePlan';
|
|
3
|
+
declare type ChangePlanMachine = typeof changePlan;
|
|
4
|
+
declare type ChangePlanState = State<ChangePlanMachine['context']>;
|
|
5
|
+
export declare const getChangePlanStatus: (machineState: ChangePlanState) => {
|
|
6
|
+
configurePlanStep: boolean;
|
|
7
|
+
configurePlanStepLoading: boolean;
|
|
8
|
+
previewPlanStep: boolean;
|
|
9
|
+
previewPlanLoading: boolean;
|
|
10
|
+
updatePlanLoading: boolean;
|
|
11
|
+
updateSuccess: boolean;
|
|
12
|
+
isError: boolean;
|
|
13
|
+
};
|
|
14
|
+
export declare const getProducts: (machineState: ChangePlanState) => import("./types").Product[];
|
|
15
|
+
export declare const getSelectedPlan: (machineState: ChangePlanState) => number;
|
|
16
|
+
export declare const getChangePlanPreview: (machineState: ChangePlanState) => import("./types").ChangePlanPreview;
|
|
17
|
+
export declare const changePlanSelectors: {
|
|
18
|
+
getChangePlanPreview: (machineState: ChangePlanState) => import("./types").ChangePlanPreview;
|
|
19
|
+
getProducts: (machineState: ChangePlanState) => import("./types").Product[];
|
|
20
|
+
getSelectedPlan: (machineState: ChangePlanState) => number;
|
|
21
|
+
getChangePlanStatus: (machineState: ChangePlanState) => {
|
|
22
|
+
configurePlanStep: boolean;
|
|
23
|
+
configurePlanStepLoading: boolean;
|
|
24
|
+
previewPlanStep: boolean;
|
|
25
|
+
previewPlanLoading: boolean;
|
|
26
|
+
updatePlanLoading: boolean;
|
|
27
|
+
updateSuccess: boolean;
|
|
28
|
+
isError: boolean;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
export {};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Interpreter } from 'xstate';
|
|
2
|
+
import { SubscriptionModel, SubscriptionProduct } from '../../models';
|
|
3
|
+
export declare type Context = {
|
|
4
|
+
products: Product[];
|
|
5
|
+
selectedPlan: number;
|
|
6
|
+
changePlanPreview: ChangePlanPreview;
|
|
7
|
+
};
|
|
8
|
+
export declare type Events = {
|
|
9
|
+
type: 'GET_PRODUCTS';
|
|
10
|
+
} | {
|
|
11
|
+
type: 'SELECT_PLAN';
|
|
12
|
+
planId: number;
|
|
13
|
+
} | {
|
|
14
|
+
type: 'GET_PREVIEW_PRODUCT_MIGRATION';
|
|
15
|
+
} | {
|
|
16
|
+
type: 'GO_BACK';
|
|
17
|
+
} | {
|
|
18
|
+
type: 'CONFIRM_CHANGE_PLAN';
|
|
19
|
+
} | ProductChangeDoneEvent;
|
|
20
|
+
export declare type ProductChangeDoneEvent = {
|
|
21
|
+
type: 'DONE';
|
|
22
|
+
data: SubscriptionModel;
|
|
23
|
+
};
|
|
24
|
+
export declare type Product = Omit<SubscriptionProduct, 'trialPriceInCents' | 'trialInterval' | 'trialIntervalUnit' | ''>;
|
|
25
|
+
export declare type ChangePlanPreview = {
|
|
26
|
+
billingEndDate: string;
|
|
27
|
+
existingBalanceInCents: number;
|
|
28
|
+
product: {
|
|
29
|
+
priceInCents: number;
|
|
30
|
+
name: string;
|
|
31
|
+
};
|
|
32
|
+
productChangeStrategy: ProductChangeStrategy;
|
|
33
|
+
proratedAdjustmentInCents: number;
|
|
34
|
+
subtotalInCents: number;
|
|
35
|
+
totalInCents: number;
|
|
36
|
+
totalTaxInCents: number;
|
|
37
|
+
};
|
|
38
|
+
export declare type ProductChangeStrategy = 'prorated' | 'delayed' | 'instant';
|
|
39
|
+
export declare type ChangePlanInterpreter = Interpreter<Context, Record<string, any>, Events>;
|
package/typings/packages/subscriptions-manager/src/machines/createPaymentProfile/actions.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CreditCardFields } from "../../../../payments-sdk/src";
|
|
2
2
|
import { AddressFields } from "../../../../address/src";
|
|
3
|
+
import { Context } from './types';
|
|
3
4
|
export declare const resetFieldError: import("xstate").AssignAction<{
|
|
4
5
|
billingAddress: {
|
|
5
6
|
errors: {};
|
|
@@ -10,3 +11,6 @@ export declare const resetFieldError: import("xstate").AssignAction<{
|
|
|
10
11
|
values: CreditCardFields;
|
|
11
12
|
};
|
|
12
13
|
}, import("xstate").EventObject>;
|
|
14
|
+
export declare const setPaymentProfileIdForReplacement: import("xstate").AssignAction<Context, import("xstate").EventObject>;
|
|
15
|
+
export declare const assignCreatedProfile: import("xstate").AssignAction<Context, import("xstate").EventObject>;
|
|
16
|
+
export declare const serializePaymentProfilesSubscriptions: import("xstate").AssignAction<Context, import("xstate").EventObject>;
|
package/typings/packages/subscriptions-manager/src/machines/createPaymentProfile/selectors.d.ts
CHANGED
|
@@ -99,6 +99,13 @@ export declare const getRequiredFields: (machineState: PaymentProfileState) => s
|
|
|
99
99
|
export declare const getPaymentProfileErrors: (machineState: PaymentProfileState) => {
|
|
100
100
|
tokenization: import("../../../../payments-sdk").TokenizationError;
|
|
101
101
|
};
|
|
102
|
+
export declare const getPaymentProfilesReplacementError: (machineState: PaymentProfileState) => boolean;
|
|
103
|
+
export declare const getPaymentProfilesIdsForReplacement: (machineState: PaymentProfileState) => number[];
|
|
104
|
+
export declare const getPaymentProfilesSubscriptions: (machineState: PaymentProfileState) => {
|
|
105
|
+
failed: import("./types").PaymentProfileReplacementResponse[];
|
|
106
|
+
success: import("./types").PaymentProfileReplacementResponse[];
|
|
107
|
+
};
|
|
108
|
+
export declare const getPaymentProfilesReplacementProcessing: (machineState: PaymentProfileState) => boolean;
|
|
102
109
|
export declare const paymentProfileSelectors: {
|
|
103
110
|
getProfileConnectionError: (machineState: PaymentProfileState) => boolean;
|
|
104
111
|
getRequiredFields: (machineState: PaymentProfileState) => string[];
|
|
@@ -197,5 +204,12 @@ export declare const paymentProfileSelectors: {
|
|
|
197
204
|
}>>;
|
|
198
205
|
}>>;
|
|
199
206
|
};
|
|
207
|
+
getPaymentProfilesIdsForReplacement: (machineState: PaymentProfileState) => number[];
|
|
208
|
+
getPaymentProfilesSubscriptions: (machineState: PaymentProfileState) => {
|
|
209
|
+
failed: import("./types").PaymentProfileReplacementResponse[];
|
|
210
|
+
success: import("./types").PaymentProfileReplacementResponse[];
|
|
211
|
+
};
|
|
212
|
+
getPaymentProfilesReplacementError: (machineState: PaymentProfileState) => boolean;
|
|
213
|
+
getPaymentProfilesReplacementProcessing: (machineState: PaymentProfileState) => boolean;
|
|
200
214
|
};
|
|
201
215
|
export {};
|
|
@@ -7,6 +7,13 @@ export declare type FieldError = 'required' | 'invalid';
|
|
|
7
7
|
export declare type PaymentProfileFromType = 'billingAddress' | 'paymentMethod';
|
|
8
8
|
export declare type PaymentProfileFields = keyof AddressFields | keyof CreditCardFields;
|
|
9
9
|
export declare type PaymentMethod = 'creditCard' | 'bankAccount';
|
|
10
|
+
export declare type PaymentProfileReplacementResponse = {
|
|
11
|
+
id: number;
|
|
12
|
+
product: {
|
|
13
|
+
name: string;
|
|
14
|
+
productFamilyId: number;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
10
17
|
export declare type Context = {
|
|
11
18
|
token: string | null;
|
|
12
19
|
tokenizationError: TokenizationError;
|
|
@@ -28,12 +35,31 @@ export declare type Context = {
|
|
|
28
35
|
[key in keyof AddressFields]?: FieldError;
|
|
29
36
|
};
|
|
30
37
|
};
|
|
38
|
+
paymentProfiles: {
|
|
39
|
+
idsForReplacement: number[];
|
|
40
|
+
subscriptions: {
|
|
41
|
+
failed: PaymentProfileReplacementResponse[];
|
|
42
|
+
success: PaymentProfileReplacementResponse[];
|
|
43
|
+
};
|
|
44
|
+
};
|
|
31
45
|
};
|
|
32
46
|
export declare type ResetFieldErrorEvent = {
|
|
33
47
|
type: 'RESET_FIELD_ERROR';
|
|
34
48
|
form: PaymentProfileFromType;
|
|
35
49
|
field: keyof AddressFields | keyof CreditCardFields;
|
|
36
50
|
};
|
|
51
|
+
export declare type SetPaymentProfileIdForReplacementEvent = {
|
|
52
|
+
type: 'SET_PAYMENT_PROFILES_ID_FOR_REPLACEMENT';
|
|
53
|
+
paymentProfileId: number;
|
|
54
|
+
};
|
|
55
|
+
export declare type ReplacePaymentProfilesSuccessEvent = {
|
|
56
|
+
type: 'SUCCESS_REPLACE_PAYMENT_PROFILES';
|
|
57
|
+
data: {
|
|
58
|
+
subscriptions: {
|
|
59
|
+
success: PaymentProfileReplacementResponse[];
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
};
|
|
37
63
|
export declare type Events = {
|
|
38
64
|
type: 'SAVE_PAYMENT_METHOD';
|
|
39
65
|
} | ResetFieldErrorEvent | {
|
|
@@ -54,5 +80,7 @@ export declare type Events = {
|
|
|
54
80
|
field: keyof AddressFields | keyof CreditCardFields;
|
|
55
81
|
form: PaymentProfileFromType;
|
|
56
82
|
value: string | number;
|
|
57
|
-
}
|
|
83
|
+
} | SetPaymentProfileIdForReplacementEvent | {
|
|
84
|
+
type: 'RETRY_REPLACE_PAYMENT_PROFILES';
|
|
85
|
+
} | ReplacePaymentProfilesSuccessEvent;
|
|
58
86
|
export declare type PaymentProfileInterpreter = Interpreter<Context, Record<string, any>, Events>;
|
|
@@ -8,6 +8,7 @@ import { createPaymentProfile, paymentProfileSelectors, PaymentProfileInterprete
|
|
|
8
8
|
import { paymentGateway, paymentGatewaySelectors, PaymentGatewayInterpreter } from './paymentGateway';
|
|
9
9
|
import { paymentProfiles, paymentProfilesSelectors, PaymentProfilesInterpreter } from './paymentProfiles';
|
|
10
10
|
import { addOnsConfiguration, Allocation, SerializedPrice, SerializedComponent, AllocationsPreview, AddonsConfigurationContext, AllocationsError, AddonsInterpreter } from './addOnsConfiguration';
|
|
11
|
-
|
|
11
|
+
import { changePlan } from './changePlan';
|
|
12
|
+
export { changePlan, modals, modalsSelectors, createSubscriptionsMachine, subscriptionsSelectors, subscriptionSelectors, productCatalogSelectors, componentSelectors, componentsSelectors, paymentGatewaySelectors, paymentGateway, productCatalog, paymentProfiles, paymentProfilesSelectors, createPaymentProfile, paymentProfileSelectors, addOnsConfiguration, };
|
|
12
13
|
export type { PaymentProfilesInterpreter, SubscriptionsInterpreter, SubscriptionRef, ProductCatalogInterpreter, PaymentProfileInterpreter, AddonsInterpreter, PaymentProfileFromType, PaymentProfileFieldError, PaymentProfileFields, ModalsInterpreter, Allocation, SerializedComponent, SerializedPrice, AllocationsPreview, AddonsConfigurationContext, PaymentMethod, PaymentGatewayInterpreter, AllocationsError, };
|
|
13
14
|
export { DEFAULT_VISIBLE_SUBSCRIPTIONS };
|
|
@@ -8,6 +8,7 @@ export declare const getCreatePaymentProfile: (machineState: ModalsState) => {
|
|
|
8
8
|
subscriptionId: number;
|
|
9
9
|
catalogId: number;
|
|
10
10
|
paymentMethod: import("..").PaymentMethod;
|
|
11
|
+
activePaymentProfileId: number;
|
|
11
12
|
};
|
|
12
13
|
};
|
|
13
14
|
export declare const getAddonsConfiguration: (machineState: ModalsState) => {
|
|
@@ -76,6 +77,13 @@ export declare const getReactivateSubscription: (machineState: ModalsState) => {
|
|
|
76
77
|
catalogId: number;
|
|
77
78
|
};
|
|
78
79
|
};
|
|
80
|
+
export declare const getChangeSubscriptionPlan: (machineState: ModalsState) => {
|
|
81
|
+
isOpen: boolean;
|
|
82
|
+
meta: {
|
|
83
|
+
subscriptionId: number;
|
|
84
|
+
catalogId: number;
|
|
85
|
+
};
|
|
86
|
+
};
|
|
79
87
|
export declare const modalsSelectors: {
|
|
80
88
|
getCreatePaymentProfile: (machineState: ModalsState) => {
|
|
81
89
|
isOpen: boolean;
|
|
@@ -83,6 +91,7 @@ export declare const modalsSelectors: {
|
|
|
83
91
|
subscriptionId: number;
|
|
84
92
|
catalogId: number;
|
|
85
93
|
paymentMethod: import("..").PaymentMethod;
|
|
94
|
+
activePaymentProfileId: number;
|
|
86
95
|
};
|
|
87
96
|
};
|
|
88
97
|
getAddonsConfiguration: (machineState: ModalsState) => {
|
|
@@ -151,5 +160,12 @@ export declare const modalsSelectors: {
|
|
|
151
160
|
catalogId: number;
|
|
152
161
|
};
|
|
153
162
|
};
|
|
163
|
+
getChangeSubscriptionPlan: (machineState: ModalsState) => {
|
|
164
|
+
isOpen: boolean;
|
|
165
|
+
meta: {
|
|
166
|
+
subscriptionId: number;
|
|
167
|
+
catalogId: number;
|
|
168
|
+
};
|
|
169
|
+
};
|
|
154
170
|
};
|
|
155
171
|
export {};
|
|
@@ -10,6 +10,7 @@ export declare type Context = {
|
|
|
10
10
|
subscriptionId: null | number;
|
|
11
11
|
catalogId: null | number;
|
|
12
12
|
paymentMethod: PaymentMethod;
|
|
13
|
+
activePaymentProfileId: number;
|
|
13
14
|
};
|
|
14
15
|
previewPaymentProfile: {
|
|
15
16
|
catalogId: number | null;
|
|
@@ -45,6 +46,10 @@ export declare type Context = {
|
|
|
45
46
|
subscriptionId: number | null;
|
|
46
47
|
catalogId: number | null;
|
|
47
48
|
};
|
|
49
|
+
changeSubscriptionPlan: {
|
|
50
|
+
subscriptionId: number | null;
|
|
51
|
+
catalogId: number | null;
|
|
52
|
+
};
|
|
48
53
|
};
|
|
49
54
|
export declare type Events = {
|
|
50
55
|
type: 'CLOSE_MODAL';
|
|
@@ -53,6 +58,7 @@ export declare type Events = {
|
|
|
53
58
|
catalogId: number;
|
|
54
59
|
subscriptionId: number;
|
|
55
60
|
paymentMethod: PaymentMethod;
|
|
61
|
+
activePaymentProfileId: number;
|
|
56
62
|
} | {
|
|
57
63
|
type: 'SHOW_CHANGE_PAYMENT_PROFILE';
|
|
58
64
|
catalogId: number;
|
|
@@ -92,5 +98,9 @@ export declare type Events = {
|
|
|
92
98
|
type: 'SHOW_REACTIVATE_SUBSCRIPTION';
|
|
93
99
|
catalogId: number;
|
|
94
100
|
subscriptionId: number;
|
|
101
|
+
} | {
|
|
102
|
+
type: 'SHOW_SUBSCRIPTION_PLAN_CHANGE';
|
|
103
|
+
catalogId: number;
|
|
104
|
+
subscriptionId: number;
|
|
95
105
|
};
|
|
96
106
|
export declare type ModalsInterpreter = Interpreter<Context, Record<string, any>, Events>;
|
|
@@ -33,6 +33,7 @@ export declare const updateSubscription: import("xstate").AssignAction<{
|
|
|
33
33
|
snapDay: string;
|
|
34
34
|
currentPeriodEndsAt: string;
|
|
35
35
|
nextAssessmentAt: string;
|
|
36
|
+
nextProductId: number;
|
|
36
37
|
trialEndedAt: string;
|
|
37
38
|
automaticallyResumeAt: string;
|
|
38
39
|
balanceInCents: number;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare type ChangePlanProps = {
|
|
3
|
+
catalogId: number;
|
|
4
|
+
subscriptionId: number;
|
|
5
|
+
displayMode: 'layer' | 'window';
|
|
6
|
+
onClose: (successUpdate?: boolean) => void;
|
|
7
|
+
onProcessingUpdate: (isProcessing: boolean) => void;
|
|
8
|
+
};
|
|
9
|
+
declare const Content: ({ onClose, catalogId, subscriptionId, displayMode, onProcessingUpdate, }: ChangePlanProps) => JSX.Element;
|
|
10
|
+
export default Content;
|
|
@@ -3,10 +3,11 @@ import { PaymentMethod } from '../../../../machines';
|
|
|
3
3
|
declare type PaymentProfileContentProps = {
|
|
4
4
|
catalogId: number;
|
|
5
5
|
subscriptionId: number;
|
|
6
|
+
activePaymentProfileId: number;
|
|
6
7
|
paymentMethod: PaymentMethod;
|
|
7
8
|
displayMode: 'layer' | 'window';
|
|
8
9
|
onClose: (successUpdate?: boolean) => void;
|
|
9
10
|
onProcessingUpdate: (isProcessing: boolean) => void;
|
|
10
11
|
};
|
|
11
|
-
declare const Content: ({ onClose, onProcessingUpdate, paymentMethod, subscriptionId, displayMode, catalogId, }: PaymentProfileContentProps) => JSX.Element;
|
|
12
|
+
declare const Content: ({ activePaymentProfileId, onClose, onProcessingUpdate, paymentMethod, subscriptionId, displayMode, catalogId, }: PaymentProfileContentProps) => JSX.Element;
|
|
12
13
|
export default Content;
|
|
@@ -8,4 +8,5 @@ import ReactivateSubscriptionModal from './ReactivateSubscription';
|
|
|
8
8
|
import UndoCancelationModal from './UndoCancelation';
|
|
9
9
|
import DeletePaymentMethodModal from './DeletePaymentMethod';
|
|
10
10
|
import CreatePaymentProfileModal from './CreatePaymentProfile';
|
|
11
|
-
|
|
11
|
+
import ChangeSubscriptionPlanModal from './ChangeSubscriptionPlan';
|
|
12
|
+
export { CreatePaymentProfileModal, ComponentsAllocationModal, PauseSubscriptionModal, ResumeSubscriptionModal, ReactivateSubscriptionModal, CancelSubscriptionModal, DeletePaymentMethodModal, ChangePaymentMethodModal, PreviewPaymentMethod, UndoCancelationModal, ChangeSubscriptionPlanModal, };
|
|
@@ -14,6 +14,7 @@ export interface SubscriptionModel {
|
|
|
14
14
|
snapDay: string | null;
|
|
15
15
|
currentPeriodEndsAt: string | null;
|
|
16
16
|
nextAssessmentAt: string | null;
|
|
17
|
+
nextProductId: number | null;
|
|
17
18
|
trialEndedAt: string | null;
|
|
18
19
|
automaticallyResumeAt: string | null;
|
|
19
20
|
balanceInCents: number | null;
|
|
@@ -62,7 +63,7 @@ export declare type SubscriptionEvents = {
|
|
|
62
63
|
export declare type UpdateSubscriptionEvent = {
|
|
63
64
|
data: PartialDeep<SubscriptionModel>;
|
|
64
65
|
};
|
|
65
|
-
export declare type SubscriptionStatus = 'active' | 'cancellation_scheduled' | 'canceled' | 'expired' | 'on_hold' | 'past_due' | 'trial' | 'trial_expired' | 'unpaid' | 'paused';
|
|
66
|
+
export declare type SubscriptionStatus = 'active' | 'cancellation_scheduled' | 'canceled' | 'expired' | 'on_hold' | 'past_due' | 'trial' | 'trial_expired' | 'unpaid' | 'paused' | 'plan_change_scheduled';
|
|
66
67
|
export declare type SubscriptionCharge = 'prorated' | 'immediate' | 'delayed';
|
|
67
68
|
export declare type ChurnReason = {
|
|
68
69
|
id: number;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CreditCardFields } from "../../payments-sdk/src";
|
|
2
2
|
import { AddressFields } from "../../address/src";
|
|
3
3
|
declare type PaymentProfileFields = 'cvv' | 'month' | 'year' | 'number';
|
|
4
|
-
export declare type SubscriptionScopes = 'subscription:pause' | 'subscription:resume' | 'subscription:cancel-immediate' | 'subscription:cancel-delayed' | 'subscription:cancel-scheduled' | 'subscription:reactivate';
|
|
4
|
+
export declare type SubscriptionScopes = 'subscription:pause' | 'subscription:resume' | 'subscription:cancel-immediate' | 'subscription:cancel-delayed' | 'subscription:cancel-scheduled' | 'subscription:reactivate' | 'subscription:plan-change';
|
|
5
5
|
export declare type ComponentSettings = {
|
|
6
6
|
componentsAllocation: {
|
|
7
7
|
allocationFlow: 'page' | 'modal';
|