@maxio-com/self-service 1.5.0 → 1.7.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.
Files changed (51) hide show
  1. package/dist/maxio-components.cjs.js +1 -1
  2. package/dist/maxio-components.esm.js +1 -1
  3. package/dist/maxio-components.umd.js +325 -17
  4. package/package.json +1 -1
  5. package/typings/packages/data-access/src/DataAccess.d.ts +140 -0
  6. package/typings/packages/data-access/src/types/subscription.d.ts +11 -0
  7. package/typings/packages/subscriptions-manager/src/components/CouponsList/CouponsList.d.ts +10 -0
  8. package/typings/packages/subscriptions-manager/src/components/CouponsList/CouponsList.styles.d.ts +1 -0
  9. package/typings/packages/subscriptions-manager/src/components/CouponsList/components/CouponListItem.d.ts +8 -0
  10. package/typings/packages/subscriptions-manager/src/components/CouponsList/components/index.d.ts +1 -0
  11. package/typings/packages/subscriptions-manager/src/components/Subscription/Subscription.d.ts +4 -1
  12. package/typings/packages/subscriptions-manager/src/components/SubscriptionDetails/components/Notification/Notification.d.ts +3 -1
  13. package/typings/packages/subscriptions-manager/src/containers/CouponsContainer/CouponsContainer.d.ts +9 -0
  14. package/typings/packages/subscriptions-manager/src/containers/CouponsContainer/index.d.ts +2 -0
  15. package/typings/packages/subscriptions-manager/src/containers/CouponsContainer/utils.d.ts +5 -0
  16. package/typings/packages/subscriptions-manager/src/handlers/subscription.d.ts +1 -0
  17. package/typings/packages/subscriptions-manager/src/hooks/index.d.ts +3 -1
  18. package/typings/packages/subscriptions-manager/src/hooks/useChangePlan.d.ts +1 -1
  19. package/typings/packages/subscriptions-manager/src/hooks/useCoupons.d.ts +9 -0
  20. package/typings/packages/subscriptions-manager/src/hooks/useThreeDs.d.ts +10 -0
  21. package/typings/packages/subscriptions-manager/src/machines/changePlan/types.d.ts +8 -1
  22. package/typings/packages/subscriptions-manager/src/machines/coupons/coupons.d.ts +5 -0
  23. package/typings/packages/subscriptions-manager/src/machines/coupons/index.d.ts +2 -0
  24. package/typings/packages/subscriptions-manager/src/machines/coupons/selectors.d.ts +12 -0
  25. package/typings/packages/subscriptions-manager/src/machines/coupons/types.d.ts +33 -0
  26. package/typings/packages/subscriptions-manager/src/machines/coupons/utils.d.ts +2 -0
  27. package/typings/packages/subscriptions-manager/src/machines/index.d.ts +3 -1
  28. package/typings/packages/subscriptions-manager/src/machines/modals/selectors.d.ts +36 -0
  29. package/typings/packages/subscriptions-manager/src/machines/modals/types.d.ts +26 -0
  30. package/typings/packages/subscriptions-manager/src/machines/subscription/selectors.d.ts +2 -0
  31. package/typings/packages/subscriptions-manager/src/machines/subscriptions/actions.d.ts +52 -0
  32. package/typings/packages/subscriptions-manager/src/machines/subscriptions/types.d.ts +2 -1
  33. package/typings/packages/subscriptions-manager/src/machines/threeDs/index.d.ts +1 -0
  34. package/typings/packages/subscriptions-manager/src/machines/threeDs/threeDs.d.ts +5 -0
  35. package/typings/packages/subscriptions-manager/src/machines/threeDs/types.d.ts +8 -0
  36. package/typings/packages/subscriptions-manager/src/mocks/subscriptions.d.ts +2 -0
  37. package/typings/packages/subscriptions-manager/src/modals/AddCoupon/AddCoupon.d.ts +3 -0
  38. package/typings/packages/subscriptions-manager/src/modals/AddCoupon/components/Content/Content.d.ts +13 -0
  39. package/typings/packages/subscriptions-manager/src/modals/AddCoupon/components/Content/components/CouponSummary.d.ts +10 -0
  40. package/typings/packages/subscriptions-manager/src/modals/AddCoupon/components/Content/components/index.d.ts +1 -0
  41. package/typings/packages/subscriptions-manager/src/modals/AddCoupon/components/Content/index.d.ts +2 -0
  42. package/typings/packages/subscriptions-manager/src/modals/AddCoupon/components/Content/utils.d.ts +7 -0
  43. package/typings/packages/subscriptions-manager/src/modals/AddCoupon/components/index.d.ts +2 -0
  44. package/typings/packages/subscriptions-manager/src/modals/AddCoupon/index.d.ts +2 -0
  45. package/typings/packages/subscriptions-manager/src/modals/ThreeDsConfirmation/ThreeDsConfirmation.d.ts +3 -0
  46. package/typings/packages/subscriptions-manager/src/modals/ThreeDsConfirmation/components/Content/Content.d.ts +10 -0
  47. package/typings/packages/subscriptions-manager/src/modals/ThreeDsConfirmation/components/Content/index.d.ts +2 -0
  48. package/typings/packages/subscriptions-manager/src/modals/ThreeDsConfirmation/components/index.d.ts +2 -0
  49. package/typings/packages/subscriptions-manager/src/modals/ThreeDsConfirmation/index.d.ts +2 -0
  50. package/typings/packages/subscriptions-manager/src/modals/index.d.ts +3 -1
  51. package/typings/packages/subscriptions-manager/src/models/subscription/types.d.ts +13 -1
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "module": "dist/maxio-components.esm.js",
6
6
  "browser": "dist/maxio-components.umd.js",
7
7
  "types": "typings/sdk/components-sdk/src/index.d.ts",
8
- "version": "1.5.0",
8
+ "version": "1.7.0",
9
9
  "scripts": {
10
10
  "test": "jest",
11
11
  "test:coverage": "jest --coverage",
@@ -56,6 +56,7 @@ declare class DataAccess {
56
56
  canceledAt: string;
57
57
  scheduledCancellationAt: string;
58
58
  currency: string;
59
+ threeDsActionLink: string;
59
60
  billing: {
60
61
  paymentProfileConnected: boolean;
61
62
  bankAccount: {
@@ -199,6 +200,7 @@ declare class DataAccess {
199
200
  canceledAt: string;
200
201
  scheduledCancellationAt: string;
201
202
  currency: string;
203
+ threeDsActionLink: string;
202
204
  billing: {
203
205
  paymentProfileConnected: boolean;
204
206
  bankAccount: {
@@ -246,6 +248,144 @@ declare class DataAccess {
246
248
  };
247
249
  }[];
248
250
  }>;
251
+ getSubscriptionDetails(subscriptionId: number): Promise<{
252
+ id: number;
253
+ productFamilyId: number;
254
+ state: string;
255
+ balanceInCents: number;
256
+ referralCode: string;
257
+ currentPeriodEndsAt: string;
258
+ nextAssessmentAt: string;
259
+ nextProductId?: number;
260
+ currentBillingAmountInCents: number;
261
+ automaticallyResumeAt: string;
262
+ expiresAt: string;
263
+ canceledAt: string;
264
+ scheduledCancellationAt: string;
265
+ currency: string;
266
+ threeDsActionLink: string;
267
+ billing: {
268
+ paymentProfileConnected: boolean;
269
+ bankAccount: {
270
+ bankName: string;
271
+ maskedAccountNumber: string;
272
+ maskedRoutingNumber: string;
273
+ firstName: string;
274
+ lastName: string;
275
+ };
276
+ creditCard: {
277
+ firstName: string;
278
+ lastName: string;
279
+ cardType: string;
280
+ maskedNumber: string;
281
+ expirationMonth: number;
282
+ expirationYear: number;
283
+ expired: boolean;
284
+ };
285
+ address: {
286
+ address: string;
287
+ address2: string;
288
+ city: string;
289
+ country: string;
290
+ state: string;
291
+ zip: string;
292
+ };
293
+ };
294
+ product: {
295
+ id: number;
296
+ name: string;
297
+ priceInCents: number;
298
+ interval: number;
299
+ intervalUnit: "day" | "month";
300
+ trialPriceInCents: number;
301
+ trialInterval: string;
302
+ trialIntervalUnit: string;
303
+ };
304
+ components: {
305
+ updatesAllowed: boolean;
306
+ usedInBilling: boolean;
307
+ };
308
+ customFields: {
309
+ updatesAllowed: boolean;
310
+ visible: boolean;
311
+ };
312
+ coupons: {
313
+ amountInCents: number;
314
+ code: string;
315
+ expiresAt: string;
316
+ recurring: boolean;
317
+ percentage: number;
318
+ }[];
319
+ }>;
320
+ addCoupon(subscriptionId: number, couponCode: string): Promise<{
321
+ id: number;
322
+ productFamilyId: number;
323
+ state: string;
324
+ balanceInCents: number;
325
+ referralCode: string;
326
+ currentPeriodEndsAt: string;
327
+ nextAssessmentAt: string;
328
+ nextProductId?: number;
329
+ currentBillingAmountInCents: number;
330
+ automaticallyResumeAt: string;
331
+ expiresAt: string;
332
+ canceledAt: string;
333
+ scheduledCancellationAt: string;
334
+ currency: string;
335
+ threeDsActionLink: string;
336
+ billing: {
337
+ paymentProfileConnected: boolean;
338
+ bankAccount: {
339
+ bankName: string;
340
+ maskedAccountNumber: string;
341
+ maskedRoutingNumber: string;
342
+ firstName: string;
343
+ lastName: string;
344
+ };
345
+ creditCard: {
346
+ firstName: string;
347
+ lastName: string;
348
+ cardType: string;
349
+ maskedNumber: string;
350
+ expirationMonth: number;
351
+ expirationYear: number;
352
+ expired: boolean;
353
+ };
354
+ address: {
355
+ address: string;
356
+ address2: string;
357
+ city: string;
358
+ country: string;
359
+ state: string;
360
+ zip: string;
361
+ };
362
+ };
363
+ product: {
364
+ id: number;
365
+ name: string;
366
+ priceInCents: number;
367
+ interval: number;
368
+ intervalUnit: "day" | "month";
369
+ trialPriceInCents: number;
370
+ trialInterval: string;
371
+ trialIntervalUnit: string;
372
+ };
373
+ components: {
374
+ updatesAllowed: boolean;
375
+ usedInBilling: boolean;
376
+ };
377
+ customFields: {
378
+ updatesAllowed: boolean;
379
+ visible: boolean;
380
+ };
381
+ coupons: {
382
+ amountInCents: number;
383
+ code: string;
384
+ expiresAt: string;
385
+ recurring: boolean;
386
+ percentage: number;
387
+ }[];
388
+ }>;
249
389
  getCustomerDetails(): Promise<{
250
390
  address: string;
251
391
  address2: string;
@@ -14,6 +14,7 @@ export declare type Subscription = {
14
14
  canceled_at: string | null;
15
15
  scheduled_cancellation_at: string | null;
16
16
  currency: string;
17
+ three_ds_action_link: string | null;
17
18
  billing: {
18
19
  payment_profile_connected: boolean;
19
20
  } & SubscriptionPaymentProfile;
@@ -44,3 +45,13 @@ export declare type SubscriptionProduct = {
44
45
  trial_interval: string | null;
45
46
  trial_interval_unit: string | null;
46
47
  };
48
+ export declare type Coupon = {
49
+ amount_in_cents: number;
50
+ code: string;
51
+ expires_at: string;
52
+ recurring: boolean;
53
+ percentage: number;
54
+ };
55
+ export declare type SubscriptionWithCoupon = Subscription & {
56
+ coupons: Coupon[];
57
+ };
@@ -0,0 +1,10 @@
1
+ /// <reference types="react" />
2
+ declare type Props = {
3
+ coupons: {
4
+ code: string;
5
+ value: string;
6
+ description: string;
7
+ }[];
8
+ };
9
+ export declare const CouponsList: ({ coupons }: Props) => JSX.Element;
10
+ export {};
@@ -0,0 +1 @@
1
+ export declare const ListWrapper: import("styled-components").StyledComponent<"ul", any, {}, never>;
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ declare type Props = {
3
+ code: string;
4
+ value: string;
5
+ description: string;
6
+ };
7
+ export declare const CouponListItem: ({ code, value, description }: Props) => JSX.Element;
8
+ export {};
@@ -0,0 +1 @@
1
+ export { CouponListItem } from './CouponListItem';
@@ -5,6 +5,7 @@ import { SubscriptionStatus } from '../../models';
5
5
  import { SubscriptionLayout } from './types';
6
6
  import { SubscriptionBilling } from '../../models/subscription/types';
7
7
  import { SubscriptionActions } from '../../containers/SubscriptionContainer/hooks/useSubscriptionAvailableActions';
8
+ import { Currency } from "../../../../formatters/src";
8
9
  declare type SubscriptionProps = {
9
10
  id: number;
10
11
  catalogId: number;
@@ -24,10 +25,12 @@ declare type SubscriptionProps = {
24
25
  layout?: SubscriptionLayout;
25
26
  detailsVisible?: boolean;
26
27
  billingDetails: SubscriptionBilling;
28
+ currency: Currency;
27
29
  renderComponentsSection?: boolean;
28
30
  renderCustomFieldsSection?: boolean;
29
31
  availableActions?: SubscriptionActions[];
30
32
  referralCode?: string;
33
+ threeDsActionLink?: string;
31
34
  } & FormattedSubscriptionDetails;
32
- declare const Subscription: ({ id, catalogId, name, price, statusTag, description, status, onShowDetails, detailsVisible, cardColor, nextBillingAmount, nextBillingDate, basePlanPrice, cancellationDate, expirationDate, layout, autoResumeDate, trialExpirationDate, priceAfterTrial, trialPrice, currentBalance, nextBillingAttempt, interval, billingDetails, renderComponentsSection, renderCustomFieldsSection, scheduledCancellationDate, availableActions, referralCode, }: SubscriptionProps) => JSX.Element;
35
+ declare const Subscription: ({ id, catalogId, name, price, statusTag, description, status, onShowDetails, detailsVisible, cardColor, nextBillingAmount, nextBillingDate, basePlanPrice, cancellationDate, expirationDate, layout, autoResumeDate, trialExpirationDate, priceAfterTrial, trialPrice, currentBalance, nextBillingAttempt, interval, billingDetails, renderComponentsSection, renderCustomFieldsSection, scheduledCancellationDate, availableActions, referralCode, threeDsActionLink, currency, }: SubscriptionProps) => JSX.Element;
33
36
  export default Subscription;
@@ -3,6 +3,8 @@ import { SubscriptionStatus } from '../../../../models';
3
3
  import { MarginProps } from 'styled-system';
4
4
  interface Props {
5
5
  status: SubscriptionStatus;
6
+ show3DSModal: () => void;
7
+ existingBalance: string;
6
8
  }
7
- declare const Notification: ({ status, ...rest }: Props & MarginProps) => JSX.Element;
9
+ declare const Notification: ({ status, show3DSModal, existingBalance, ...rest }: Props & MarginProps) => JSX.Element;
8
10
  export default Notification;
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ import { Currency } from "../../../../formatters/src";
3
+ declare type Props = {
4
+ subscriptionId: number;
5
+ catalogId: number;
6
+ currency: Currency;
7
+ };
8
+ declare const CouponsContainer: ({ subscriptionId, catalogId, currency }: Props) => JSX.Element;
9
+ export default CouponsContainer;
@@ -0,0 +1,2 @@
1
+ import CouponsContainer from './CouponsContainer';
2
+ export default CouponsContainer;
@@ -0,0 +1,5 @@
1
+ import { TFunction } from 'react-i18next';
2
+ import { Currency } from "../../../../formatters/src";
3
+ import { Coupon } from '../../models/subscription/types';
4
+ export declare function formatCouponValue({ percentage, amountInCents }: Coupon, currency: Currency): string;
5
+ export declare function getCouponDescription(coupon: Coupon, t: TFunction<'subscriptions-manager'[]>): string;
@@ -1 +1,2 @@
1
1
  export declare const subscriptionsRequestHandler: import("msw").RestHandler<import("msw").MockedRequest<import("msw").DefaultRequestBody>>;
2
+ export declare const subscriptionsDetailsRequestHandler: import("msw").RestHandler<import("msw").MockedRequest<import("msw").DefaultRequestBody>>;
@@ -15,5 +15,7 @@ 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
+ import { useThreeDs } from './useThreeDs';
19
+ import { useCoupons } from './useCoupons';
20
+ export { useCoupons, useChangePlan, useDeletePaymentProfile, useSortPaymentProfiles, useChangePaymentProfile, useReactivateSubscription, useCancelSubscriptionService, useSubscriptionResumeService, useServices, useDataAccess, useSubscriptionStatus, useFormatSubscriptionDetails, useComponentSettings, useCreatePaymentProfile, useAddonsConfigurationService, useUndoCancelationService, usePaymentProfileAvailableActions, useAvailablePaymentMethods, PaymentProfileActions, useThreeDs, };
19
21
  export type { FormattedSubscriptionDetails, PaymentMethods };
@@ -1,4 +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, {
1
+ export declare const useChangePlan: (catalogId: number, subscriptionId: number, currentPlanId: number, onSuccess: () => void, onThreeDsConfirmation: (threeDsActionLink: string) => void) => import("xstate").Interpreter<import("../machines/changePlan/types").Context, any, import("../machines/changePlan/types").Events, {
2
2
  value: any;
3
3
  context: import("../machines/changePlan/types").Context;
4
4
  }, import("xstate").ResolveTypegenMeta<import("xstate").TypegenDisabled, import("../machines/changePlan/types").Events, import("xstate").BaseActionObject, import("xstate").ServiceMap>>;
@@ -0,0 +1,9 @@
1
+ declare type Props = {
2
+ subscriptionId: number;
3
+ catalogId: number;
4
+ };
5
+ export declare const useCoupons: ({ subscriptionId, catalogId }: Props) => import("xstate").Interpreter<import("../machines/coupons/types").Context, any, import("../machines/coupons/types").Events, {
6
+ value: any;
7
+ context: import("../machines/coupons/types").Context;
8
+ }, import("xstate").ResolveTypegenMeta<import("xstate").TypegenDisabled, import("../machines/coupons/types").Events, import("xstate").BaseActionObject, import("xstate").ServiceMap>>;
9
+ export {};
@@ -0,0 +1,10 @@
1
+ declare type Props = {
2
+ subscriptionId: number;
3
+ catalogId: number;
4
+ onSuccess: () => void;
5
+ };
6
+ export declare const useThreeDs: ({ subscriptionId, catalogId, onSuccess }: Props) => import("xstate").Interpreter<null, any, import("../machines/threeDs/types").Events, {
7
+ value: any;
8
+ context: null;
9
+ }, import("xstate").ResolveTypegenMeta<import("xstate").TypegenDisabled, import("../machines/threeDs/types").Events, import("xstate").BaseActionObject, import("xstate").ServiceMap>>;
10
+ export {};
@@ -4,6 +4,7 @@ export declare type Context = {
4
4
  products: Product[];
5
5
  selectedPlan: number;
6
6
  changePlanPreview: ChangePlanPreview;
7
+ threeDsActionLink: string;
7
8
  };
8
9
  export declare type Events = {
9
10
  type: 'GET_PRODUCTS';
@@ -16,7 +17,13 @@ export declare type Events = {
16
17
  type: 'GO_BACK';
17
18
  } | {
18
19
  type: 'CONFIRM_CHANGE_PLAN';
19
- } | ProductChangeDoneEvent;
20
+ } | ProductChangeDoneEvent | ThreeDsConfirmationEvent;
21
+ export declare type ThreeDsConfirmationEvent = {
22
+ type: '3DS_CONFIRMATION';
23
+ data: {
24
+ threeDsActionLink: string;
25
+ };
26
+ };
20
27
  export declare type ProductChangeDoneEvent = {
21
28
  type: 'DONE';
22
29
  data: SubscriptionModel;
@@ -0,0 +1,5 @@
1
+ import { Events, Context } from './types';
2
+ export declare const coupons: 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,2 @@
1
+ export { coupons } from './coupons';
2
+ export { couponsSelectors } from './selectors';
@@ -0,0 +1,12 @@
1
+ import { CouponsMachineState } from './types';
2
+ export declare const couponsSelectors: {
3
+ getError: (state: CouponsMachineState) => import("./types").CouponErrorCodes;
4
+ getCoupons: (state: CouponsMachineState) => import("../../models/subscription/types").Coupon[];
5
+ getCouponsStatus: (state: CouponsMachineState) => {
6
+ isError: boolean;
7
+ isLoading: boolean;
8
+ isAddingCoupon: boolean;
9
+ isCouponAdded: boolean;
10
+ };
11
+ getAddedCoupon: (state: CouponsMachineState) => import("../../models/subscription/types").Coupon;
12
+ };
@@ -0,0 +1,33 @@
1
+ import { Coupon, SubscriptionModelWithCoupons } from '../../models/subscription/types';
2
+ import { coupons } from './coupons';
3
+ import { Interpreter, State } from 'xstate';
4
+ export declare type CouponsMachine = typeof coupons;
5
+ export declare type CouponsMachineState = State<CouponsMachine['context']>;
6
+ export declare type Events = GetCouponsEvent | GetCouponsSuccessEvent | AddCouponEvent | AddAnotherCouponEvent | ErrorEvent;
7
+ export declare type Context = {
8
+ error: CouponErrorCodes | null;
9
+ coupons: SubscriptionModelWithCoupons['coupons'];
10
+ addedCoupon: Coupon;
11
+ };
12
+ export declare type GetCouponsEvent = {
13
+ type: 'GET_COUPONS';
14
+ };
15
+ export declare type GetCouponsSuccessEvent = {
16
+ type: 'GET_COUPONS_SUCCESS';
17
+ data: SubscriptionModelWithCoupons;
18
+ };
19
+ export declare type AddCouponEvent = {
20
+ type: 'ADD_COUPON';
21
+ couponCode: string;
22
+ };
23
+ export declare type AddAnotherCouponEvent = {
24
+ type: 'ADD_ANOTHER_COUPON';
25
+ };
26
+ export declare type ErrorEvent = {
27
+ type: 'ERROR';
28
+ data: {
29
+ errorCode: CouponErrorCodes;
30
+ };
31
+ };
32
+ export declare type CouponErrorCodes = 'CouponNotFound' | 'NonStackableCoupon' | 'CouponNoLongerActive' | 'InvalidCoupon';
33
+ export declare type CouponsMachineInterpreter = Interpreter<Context, any, Events>;
@@ -0,0 +1,2 @@
1
+ import { Coupon } from '../../models/subscription/types';
2
+ export declare const getUniqueCoupons: (coupons: Coupon[]) => Coupon[];
@@ -9,6 +9,8 @@ import { paymentGateway, paymentGatewaySelectors, PaymentGatewayInterpreter } fr
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
+ import { threeDs as threeDsMachine } from './threeDs';
13
+ import { coupons } from './coupons';
14
+ export { changePlan, modals, modalsSelectors, createSubscriptionsMachine, subscriptionsSelectors, subscriptionSelectors, productCatalogSelectors, componentSelectors, componentsSelectors, paymentGatewaySelectors, paymentGateway, productCatalog, paymentProfiles, paymentProfilesSelectors, createPaymentProfile, paymentProfileSelectors, addOnsConfiguration, threeDsMachine, coupons, };
13
15
  export type { PaymentProfilesInterpreter, SubscriptionsInterpreter, SubscriptionRef, ProductCatalogInterpreter, PaymentProfileInterpreter, AddonsInterpreter, PaymentProfileFromType, PaymentProfileFieldError, PaymentProfileFields, ModalsInterpreter, Allocation, SerializedComponent, SerializedPrice, AllocationsPreview, AddonsConfigurationContext, PaymentMethod, PaymentGatewayInterpreter, AllocationsError, };
14
16
  export { DEFAULT_VISIBLE_SUBSCRIPTIONS };
@@ -84,7 +84,34 @@ export declare const getChangeSubscriptionPlan: (machineState: ModalsState) => {
84
84
  catalogId: number;
85
85
  };
86
86
  };
87
+ export declare const getThreeDsConfirmation: (machineState: ModalsState) => {
88
+ isOpen: boolean;
89
+ meta: {
90
+ catalogId: number;
91
+ subscriptionId: number;
92
+ threeDsActionLink: string;
93
+ onClose: () => void;
94
+ };
95
+ };
96
+ export declare const getAddCoupon: (machineState: ModalsState) => {
97
+ isOpen: boolean;
98
+ meta: {
99
+ subscriptionId: number;
100
+ catalogId: number;
101
+ couponService: import("../coupons/types").CouponsMachineInterpreter;
102
+ currency: "DKK" | "AUD" | "BRL" | "CAD" | "CHF" | "CNY" | "CZK" | "EUR" | "GBP" | "HKD" | "INR" | "JPY" | "MXN" | "MYR" | "NOK" | "NZD" | "PHP" | "PLN" | "RON" | "RUB" | "SEK" | "SGD" | "USD" | "ZAR" | "AED" | "SAR" | "ILS";
103
+ };
104
+ };
87
105
  export declare const modalsSelectors: {
106
+ getAddCoupon: (machineState: ModalsState) => {
107
+ isOpen: boolean;
108
+ meta: {
109
+ subscriptionId: number;
110
+ catalogId: number;
111
+ couponService: import("../coupons/types").CouponsMachineInterpreter;
112
+ currency: "DKK" | "AUD" | "BRL" | "CAD" | "CHF" | "CNY" | "CZK" | "EUR" | "GBP" | "HKD" | "INR" | "JPY" | "MXN" | "MYR" | "NOK" | "NZD" | "PHP" | "PLN" | "RON" | "RUB" | "SEK" | "SGD" | "USD" | "ZAR" | "AED" | "SAR" | "ILS";
113
+ };
114
+ };
88
115
  getCreatePaymentProfile: (machineState: ModalsState) => {
89
116
  isOpen: boolean;
90
117
  meta: {
@@ -167,5 +194,14 @@ export declare const modalsSelectors: {
167
194
  catalogId: number;
168
195
  };
169
196
  };
197
+ getThreeDsConfirmation: (machineState: ModalsState) => {
198
+ isOpen: boolean;
199
+ meta: {
200
+ catalogId: number;
201
+ subscriptionId: number;
202
+ threeDsActionLink: string;
203
+ onClose: () => void;
204
+ };
205
+ };
170
206
  };
171
207
  export {};
@@ -1,5 +1,7 @@
1
1
  import { Interpreter } from 'xstate';
2
2
  import { PaymentMethod } from '../createPaymentProfile';
3
+ import { CouponsMachineInterpreter } from '../coupons/types';
4
+ import { Currency } from "../../../../formatters/src";
3
5
  export declare type Context = {
4
6
  deletePaymentProfile: {
5
7
  catalogId: number | null;
@@ -50,6 +52,18 @@ export declare type Context = {
50
52
  subscriptionId: number | null;
51
53
  catalogId: number | null;
52
54
  };
55
+ threeDSecure: {
56
+ catalogId: number;
57
+ subscriptionId: null | number;
58
+ threeDsActionLink: null | string;
59
+ onClose: null | (() => void);
60
+ };
61
+ addCoupon: {
62
+ subscriptionId: number | null;
63
+ catalogId: number | null;
64
+ couponService: null | CouponsMachineInterpreter;
65
+ currency: Currency;
66
+ };
53
67
  };
54
68
  export declare type Events = {
55
69
  type: 'CLOSE_MODAL';
@@ -102,5 +116,17 @@ export declare type Events = {
102
116
  type: 'SHOW_SUBSCRIPTION_PLAN_CHANGE';
103
117
  catalogId: number;
104
118
  subscriptionId: number;
119
+ } | {
120
+ type: 'SHOW_THREE_D_SECURE';
121
+ catalogId: number;
122
+ subscriptionId: number;
123
+ threeDsActionLink: string;
124
+ onClose?: () => void;
125
+ } | {
126
+ type: 'SHOW_ADD_COUPON';
127
+ catalogId: number;
128
+ subscriptionId: number;
129
+ couponService: CouponsMachineInterpreter;
130
+ currency: Currency;
105
131
  };
106
132
  export declare type ModalsInterpreter = Interpreter<Context, Record<string, any>, Events>;
@@ -28,6 +28,7 @@ export declare const getSubscriptionDetails: (machineState: SubscriptionState) =
28
28
  visible: null;
29
29
  };
30
30
  referralCode: string;
31
+ threeDsActionLink: string;
31
32
  };
32
33
  export declare const subscriptionSelectors: {
33
34
  getSubscriptionState: (machineState: SubscriptionState) => import("../../models").SubscriptionStatus;
@@ -56,6 +57,7 @@ export declare const subscriptionSelectors: {
56
57
  visible: null;
57
58
  };
58
59
  referralCode: string;
60
+ threeDsActionLink: string;
59
61
  };
60
62
  };
61
63
  export {};
@@ -38,6 +38,7 @@ export declare const updateSubscription: import("xstate").AssignAction<{
38
38
  automaticallyResumeAt: string;
39
39
  balanceInCents: number;
40
40
  referralCode: string;
41
+ threeDsActionLink: string;
41
42
  product: import("type-fest/source/partial-deep").PartialObjectDeep<import("../../models").SubscriptionProduct, {}>;
42
43
  billing: import("type-fest/source/partial-deep").PartialObjectDeep<import("../../models/subscription/types").SubscriptionBilling, {}>;
43
44
  components: import("type-fest/source/partial-deep").PartialObjectDeep<{
@@ -48,6 +49,57 @@ export declare const updateSubscription: import("xstate").AssignAction<{
48
49
  updatesAllowed: null;
49
50
  visible: null;
50
51
  }, {}>;
52
+ } | {
53
+ id: number;
54
+ product_family_id?: number;
55
+ state?: string;
56
+ balance_in_cents?: number;
57
+ referral_code?: string;
58
+ current_period_ends_at?: string;
59
+ next_assessment_at?: string;
60
+ next_product_id?: number;
61
+ current_billing_amount_in_cents?: number;
62
+ automatically_resume_at?: string;
63
+ expires_at?: string;
64
+ canceled_at?: string;
65
+ scheduled_cancellation_at?: string;
66
+ currency: string;
67
+ three_ds_action_link?: string;
68
+ billing: import("../../models/subscription/types").SubscriptionBilling | import("type-fest/source/partial-deep").PartialObjectDeep<{
69
+ payment_profile_connected: boolean;
70
+ } & import("../../../../data-access/src/types").SubscriptionPaymentProfile, {}>;
71
+ product: import("../../models").SubscriptionProduct | import("type-fest/source/partial-deep").PartialObjectDeep<import("../../../../data-access/src/types").SubscriptionProduct, {}>;
72
+ components: {
73
+ updatesAllowed: null;
74
+ usedInBilling: null;
75
+ } | import("type-fest/source/partial-deep").PartialObjectDeep<{
76
+ updates_allowed: boolean;
77
+ used_in_billing: boolean;
78
+ }, {}>;
79
+ custom_fields?: import("type-fest/source/partial-deep").PartialObjectDeep<{
80
+ updates_allowed: boolean;
81
+ visible: boolean;
82
+ }, {}>;
83
+ coupons?: import("type-fest/source/partial-deep").PartialObjectDeep<import("../../models/subscription/types").Coupon, {}>[];
84
+ productFamilyId: number;
85
+ scheduledCancellationAt: string;
86
+ currentBillingAmountInCents: number;
87
+ status: import("../../models").SubscriptionStatus;
88
+ canceledAt: string;
89
+ expiresAt: string;
90
+ snapDay: string;
91
+ currentPeriodEndsAt: string;
92
+ nextAssessmentAt: string;
93
+ nextProductId: number;
94
+ trialEndedAt: string;
95
+ automaticallyResumeAt: string;
96
+ balanceInCents: number;
97
+ referralCode: string;
98
+ threeDsActionLink: string;
99
+ customFields: {
100
+ updatesAllowed: null;
101
+ visible: null;
102
+ };
51
103
  };
52
104
  componentsRef: import("xstate").ActorRefWithDeprecatedState<import("../components").ComponentsContext, import("../components").ComponentsEvents, {
53
105
  value: any;
@@ -3,6 +3,7 @@ import { subscriptionModel, SubscriptionModel } from '../../models';
3
3
  import { createComponentsMachine } from '../components';
4
4
  import { createCustomFieldsMachine } from '../customFields/customFields';
5
5
  import { PartialDeep } from 'type-fest';
6
+ import { SubscriptionModelWithCoupons } from '../../models/subscription/types';
6
7
  export declare type SubscriptionRef = ReturnType<typeof subscriptionModel.createMachine>;
7
8
  export declare type ComponentsRef = ReturnType<typeof createComponentsMachine>;
8
9
  export declare type CustomFieldsRef = ReturnType<typeof createCustomFieldsMachine>;
@@ -39,7 +40,7 @@ export declare type UpdateSubscription = {
39
40
  type: 'UPDATE_SUBSCRIPTION';
40
41
  subscriptionId: number;
41
42
  catalogId: number;
42
- } & PartialDeep<SubscriptionModel>;
43
+ } & PartialDeep<SubscriptionModel | SubscriptionModelWithCoupons>;
43
44
  export declare type Events = {
44
45
  type: 'FETCH_SUBSCRIPTIONS';
45
46
  } | {
@@ -0,0 +1 @@
1
+ export { threeDs } from './threeDs';
@@ -0,0 +1,5 @@
1
+ import { Events } from './types';
2
+ export declare const threeDs: import("xstate").StateMachine<null, any, Events, {
3
+ value: any;
4
+ context: null;
5
+ }, import("xstate").BaseActionObject, import("xstate").ServiceMap, import("xstate").ResolveTypegenMeta<import("xstate").TypegenDisabled, Events, import("xstate").BaseActionObject, import("xstate").ServiceMap>>;
@@ -0,0 +1,8 @@
1
+ import { SubscriptionModelWithCoupons } from '../../models/subscription/types';
2
+ export declare type Events = {
3
+ type: 'THREE_DS_SUCCESS';
4
+ } | UpdateSubscriptionEvent;
5
+ export declare type UpdateSubscriptionEvent = {
6
+ type: 'UPDATE_SUBSCRIPTION';
7
+ data: SubscriptionModelWithCoupons;
8
+ };
@@ -1,3 +1,5 @@
1
1
  import { Subscription } from "../../../data-access/src";
2
+ import { SubscriptionWithCoupon } from '../../../data-access/src/types/subscription';
2
3
  export declare const activeSubscription: Subscription;
3
4
  export declare const pastDueSubscription: Subscription;
5
+ export declare const subscriptionWithCoupon: SubscriptionWithCoupon;