@frontegg/redux-store 4.16.1 → 4.19.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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../src/subscriptions/utils.ts","../../src/subscriptions/Plans/index.ts","../../src/subscriptions/general.interfaces.ts","../../src/subscriptions/Config/index.ts","../../src/subscriptions/Billing/Information/index.ts","../../src/subscriptions/Billing/PaymentMethod/index.ts","../../src/subscriptions/Billing/Invoices/index.ts","../../src/subscriptions/Billing/index.ts","../../src/subscriptions/Checkout/interfaces.ts","../../src/subscriptions/Checkout/index.ts","../../src/subscriptions/reducer.ts","../../src/subscriptions/Stripe/index.ts","../../src/subscriptions/Stripe/saga.ts","../../src/subscriptions/mapper.ts","../../src/subscriptions/Billing/Information/saga.ts","../../src/subscriptions/Billing/PaymentMethod/saga.ts","../../src/subscriptions/Billing/Invoices/saga.ts","../../src/subscriptions/Billing/saga.ts","../../src/subscriptions/Checkout/saga.ts","../../src/subscriptions/Plans/saga.ts","../../src/subscriptions/Config/saga.ts","../../src/subscriptions/saga.ts","../../src/subscriptions/Billing/PaymentMethod/interfaces.ts","../../src/subscriptions/index.ts"],"sourcesContent":["import { AnyAction, PayloadAction } from '@reduxjs/toolkit';\n\nexport interface ModuleCaseState {\n loading: boolean;\n error: string | null;\n}\n\nexport type ModuleCaseActions = {\n setLoading: (payload: boolean) => void;\n setError: (payload: string | null) => void;\n};\n\nexport function createModuleCaseReducers<State>() {\n return {\n setLoading: {\n prepare: (payload: boolean) => ({ payload }),\n reducer: (state: State, action: PayloadAction<boolean>) => ({ ...state, loading: action.payload, ...(action.payload?{error: null}:{}) }),\n },\n setError: {\n prepare: (payload: string | null) => ({ payload }),\n reducer: (state: State, action: PayloadAction<string | null>) => ({\n ...state,\n error: action.payload,\n loading: false,\n }),\n },\n };\n}\n\nexport type RequiredReducer<State, Action extends AnyAction> = (state: State, action: Action) => State;\n\nexport function createKeyCaseReducer<State, Key extends keyof State, Action extends AnyAction>(\n key: Key,\n setState: RequiredReducer<State[Key], Action>\n) {\n return {\n prepare: (payload: Action['payload']) => ({ payload }),\n reducer: (state: State, action: Action) => ({\n ...state,\n [key]: setState(state[key], action),\n }),\n };\n}\n\nexport function createKeyCaseLoadingReducer<State extends ModuleCaseState>(key: keyof State) {\n return createKeyCaseReducer<State, keyof State, PayloadAction<boolean>>(key, (state, action) => ({\n ...state,\n loading: action.payload,\n }));\n}\n\nexport function createKeyCaseErrorReducer<State extends ModuleCaseState>(key: keyof State) {\n return createKeyCaseReducer<State, keyof State, PayloadAction<string | null>>(key, (state, action) => ({\n ...state,\n error: action.payload,\n loading: false,\n }));\n}\n","import { PlansState } from './interfaces';\nimport { createAction, createSlice, PayloadAction } from '@reduxjs/toolkit';\nimport { subscriptionsStoreName } from '../../constants';\nimport { Plan } from '../general.interfaces';\nimport { createModuleCaseReducers } from '../utils';\n\nexport const plansInitialState: PlansState = {\n loading: false,\n error: null,\n plans: [],\n};\n\nconst { actions: sliceActions, reducer, name } = createSlice({\n name: `${subscriptionsStoreName}/plans`,\n initialState: plansInitialState,\n reducers: {\n ...createModuleCaseReducers<PlansState>(),\n setPlans: {\n prepare: (payload: Plan[]) => ({ payload }),\n reducer: (state, action: PayloadAction<Plan[]>) => ({\n ...state,\n plans: action.payload,\n }),\n },\n },\n});\n\nconst actions = {\n loadPlans: createAction(`${name}/loadPlans`),\n ...sliceActions,\n};\n\nexport { actions as plansActions, reducer as plansReducer };\n","export enum PaymentProvider {\n DEFAULT = 'Default',\n STRIPE = 'Stripe',\n}\n\nexport interface Plan {\n id: string;\n name: string;\n description: string;\n price: number;\n currency: string;\n recurringInterval: string;\n}\n\nexport enum SubscriptionStatus {\n ACTIVE = 'ACTIVE',\n CANCELED = 'CANCELED',\n INCOMPLETE = 'INCOMPLETE',\n EXPIRED = 'EXPIRED',\n}\n\nexport interface Subscription {\n id: string;\n externalId: string;\n startDate: Date;\n currentPeriodStart: Date;\n currentPeriodEnd: Date;\n status: SubscriptionStatus;\n cancellation: SubscriptionCancellation | null;\n items: SubscriptionItem[];\n}\n\nexport interface SubscriptionItem {\n id: string;\n planId: string;\n}\n\nexport interface SubscriptionCancellation {\n policy: SubscriptionCancellationPolicy;\n}\n\nexport enum SubscriptionCancellationPolicy {\n AT_PERIOD_END = 'atPeriodEnd',\n}\n\nexport interface Invoice {\n id: string;\n externalId?: string;\n subscriptionId: string;\n selectedPlan: string;\n paymentDate: Date;\n totalAmount: number;\n currency: string;\n paid: boolean;\n receiptNumber?: string;\n}\n","import { PaymentProviderConfigState } from './interfaces';\nimport { createAction, createSlice, PayloadAction } from '@reduxjs/toolkit';\nimport { subscriptionsStoreName } from '../../constants';\nimport { PaymentProvider } from '../general.interfaces';\nimport { createModuleCaseReducers } from '../utils';\n\nexport const configInitialState: PaymentProviderConfigState = {\n loading: false,\n error: null,\n config: {\n paymentProvider: PaymentProvider.DEFAULT,\n },\n};\n\nconst reducers = {\n ...createModuleCaseReducers<PaymentProviderConfigState>(),\n setStripePaymentProvider: {\n prepare: (payload: string) => ({ payload }),\n reducer(state: PaymentProviderConfigState, action: PayloadAction<string>) {\n state.config.paymentProvider = PaymentProvider.STRIPE;\n if (state.config.paymentProvider === PaymentProvider.STRIPE) {\n state.config.apiKey = action.payload;\n }\n },\n },\n};\n\nconst { actions: configActions, reducer, name } = createSlice<PaymentProviderConfigState, typeof reducers>({\n name: `${subscriptionsStoreName}/config`,\n initialState: configInitialState,\n reducers,\n});\n\nconst actions = {\n loadPaymentConfiguration: createAction(`${name}/loadPaymentConfiguration`),\n ...configActions,\n};\n\nexport { reducer as configReducer, actions as configActions };\n","import { createAction, createSlice, PayloadAction } from '@reduxjs/toolkit';\nimport { createKeyCaseErrorReducer, createKeyCaseLoadingReducer, createModuleCaseReducers } from '../../utils';\nimport { subscriptionsStoreName } from '../../../constants';\nimport { BillingInformationState } from './interfaces';\n\nexport const initialBillingInformationState: BillingInformationState = {\n loading: false,\n error: null,\n externallyManaged: false,\n cancellation: {\n loading: false,\n error: null,\n },\n renewal: {\n loading: false,\n error: null,\n },\n};\n\nconst reducers = {\n ...createModuleCaseReducers<BillingInformationState>(),\n setBillingInformation: {\n prepare: (payload: Partial<BillingInformationState>) => ({ payload }),\n reducer: (\n state: BillingInformationState,\n action: PayloadAction<Partial<BillingInformationState>>\n ): BillingInformationState => ({\n ...state,\n ...action.payload,\n }),\n },\n setCancellationLoading: createKeyCaseLoadingReducer<BillingInformationState>('cancellation'),\n setCancellationError: createKeyCaseErrorReducer<BillingInformationState>('cancellation'),\n setRenewalLoading: createKeyCaseLoadingReducer<BillingInformationState>('renewal'),\n setRenewalError: createKeyCaseErrorReducer<BillingInformationState>('renewal'),\n};\n\nconst {\n reducer,\n actions: overviewActions,\n name,\n} = createSlice<BillingInformationState, typeof reducers>({\n name: `${subscriptionsStoreName}/billing/information`,\n initialState: initialBillingInformationState,\n reducers,\n});\n\nconst actions = {\n loadBillingInformation: createAction(`${name}/loadBillingInformation`),\n cancelSubscription: createAction(`${name}/cancelSubscription`),\n renewSubscription: createAction(`${name}/renewSubscription`),\n ...overviewActions,\n};\n\nexport { reducer as informationReducer, actions as informationActions };\n","import { createModuleCaseReducers } from '../../utils';\nimport { subscriptionsStoreName } from '../../../constants';\nimport { PaymentMethodState, PaymentMethod } from './interfaces';\nimport { createAction, createSlice, PayloadAction } from '@reduxjs/toolkit';\nimport { ISubscriptionUpdatePaymentMethodBillingDetails } from '@frontegg/rest-api';\nimport { WithCallback } from '../../../interfaces';\n\nexport const initialPaymentMethodState: PaymentMethodState = {\n loading: false,\n error: null,\n};\n\nconst reducers = {\n ...createModuleCaseReducers<PaymentMethodState>(),\n setPaymentMethod: {\n prepare: (payload: PaymentMethod) => ({ payload }),\n reducer: (state: PaymentMethodState, action: PayloadAction<PaymentMethod>): PaymentMethodState => ({\n ...state,\n paymentMethod: action.payload,\n }),\n },\n};\n\nconst { reducer, actions: paymentActions, name } = createSlice({\n name: `${subscriptionsStoreName}/billing/payment`,\n initialState: initialPaymentMethodState,\n reducers,\n});\n\nconst actions = {\n loadPaymentMethod: createAction(`${name}/loadPaymentMethod`),\n updatePaymentMethodBillingDetails: createAction(\n `${name}/updatePaymentMethodBillingDetails`,\n (payload: WithCallback<ISubscriptionUpdatePaymentMethodBillingDetails & { id: string }>) => ({ payload })\n ),\n ...paymentActions,\n};\n//TODO: refactor to general code-style like export type ConnectivityActions = DispatchedActions;\nexport { reducer as subscriptionsPaymentMethodReducer, actions as subscriptionsPaymentMethodActions };\n","import { createModuleCaseReducers } from '../../utils';\nimport { createAction, createSlice, PayloadAction } from '@reduxjs/toolkit';\nimport { subscriptionsStoreName } from '../../../constants';\nimport { DownloadInvoiceActionPayload, InvoicesState } from './interfaces';\nimport { Invoice } from '../../general.interfaces';\n\nexport const initialInvoicesState: InvoicesState = {\n loading: false,\n error: null,\n invoices: [],\n};\n\nconst reducers = {\n ...createModuleCaseReducers<InvoicesState>(),\n setInvoices: {\n prepare: (payload: Invoice[]) => ({ payload }),\n reducer: (state: InvoicesState, action: PayloadAction<Invoice[]>): InvoicesState => ({\n ...state,\n invoices: action.payload,\n }),\n },\n};\n\nconst {\n reducer,\n actions: sliceActions,\n name,\n} = createSlice<InvoicesState, typeof reducers>({\n name: `${subscriptionsStoreName}/billing/invoices`,\n initialState: initialInvoicesState,\n reducers,\n});\n\nconst actions = {\n loadInvoices: createAction(`${name}/loadInvoices`),\n downloadInvoice: createAction(`${name}/downloadInvoice`, (payload: DownloadInvoiceActionPayload) => ({ payload })),\n ...sliceActions,\n};\n\nexport { reducer as invoicesReducer, actions as invoicesActions };\n","import { AnyAction, combineReducers, createReducer } from '@reduxjs/toolkit';\nimport { informationActions, informationReducer, initialBillingInformationState } from './Information';\nimport { BillingState } from './interfaces';\nimport { initialPaymentMethodState, subscriptionsPaymentMethodActions, subscriptionsPaymentMethodReducer } from './PaymentMethod';\nimport { initialInvoicesState, invoicesActions, invoicesReducer } from './Invoices';\n\nexport const billingInitialState: BillingState = {\n information: initialBillingInformationState,\n invoices: initialInvoicesState,\n paymentMethod: initialPaymentMethodState,\n};\n\nexport const billingActions = {\n invoices: invoicesActions,\n information: informationActions,\n paymentMethod: subscriptionsPaymentMethodActions,\n};\n\nexport const billingReducer = combineReducers<BillingState, AnyAction>({\n invoices: invoicesReducer,\n information: informationReducer,\n paymentMethod: subscriptionsPaymentMethodReducer,\n});\n","export enum CheckoutStatus {\n SELECTION = 'SELECTION',\n CHECKOUT = 'CHECKOUT',\n CONFIRM = 'CONFIRM',\n ERROR = 'ERROR',\n CANCEL = 'CANCEL',\n}\n\nexport interface CheckoutState {\n loading: boolean;\n error: string | null;\n status: CheckoutStatus;\n checkoutPlanId: string | null;\n checkoutClientSecret: string | null;\n}\n\nexport enum CheckoutEvent {\n SUBMITTED = 'SUBMITTED',\n ABORT = 'ABORT',\n CANCEL = 'CANCEL',\n ERROR = 'ERROR',\n CONFIRMED = 'CONFIRMED',\n}\n\nexport interface CheckoutActions {\n loadCheckoutSecret: () => void;\n checkoutPlan: (planId: string) => void;\n resetCheckout: () => void;\n confirmCheckout: () => void;\n cancelCheckout: () => void;\n submitCheckout: () => void;\n errorCheckout: (error: string) => void;\n}\n","import { CheckoutEvent, CheckoutState, CheckoutStatus } from './interfaces';\nimport { createAction, createSlice, PayloadAction } from '@reduxjs/toolkit';\nimport { createModuleCaseReducers } from '../utils';\nimport { subscriptionsStoreName } from '../../constants';\n\nexport const checkoutInitialState: CheckoutState = {\n loading: false,\n error: null,\n status: CheckoutStatus.SELECTION,\n checkoutPlanId: null,\n checkoutClientSecret: null,\n};\n\nconst reducers = {\n ...createModuleCaseReducers<CheckoutState>(),\n setStatus: {\n prepare: (payload: CheckoutStatus) => ({ payload }),\n reducer: (state: CheckoutState, action: PayloadAction<CheckoutStatus>) => ({\n ...state,\n status: action.payload,\n }),\n },\n selectPlan: {\n prepare: (payload: string | null) => ({ payload }),\n reducer: (state: CheckoutState, action: PayloadAction<string | null>) => ({\n ...state,\n checkoutPlanId: action.payload,\n }),\n },\n setStripeClientSecret: {\n prepare: (payload: string | null) => ({ payload }),\n reducer(state: CheckoutState, action: PayloadAction<string | null>) {\n state.checkoutClientSecret = action.payload;\n },\n },\n};\n\nconst { actions: checkoutActions, reducer, name } = createSlice<CheckoutState, typeof reducers>({\n name: `${subscriptionsStoreName}/checkout`,\n initialState: checkoutInitialState,\n reducers,\n});\n\nconst actions = {\n loadCheckoutSecret: createAction(`${name}/loadCheckoutSecret`),\n checkoutPlan: createAction(`${name}/checkoutPlan`, (payload: string) => ({ payload })),\n resetCheckout: createAction(`${name}/resetCheckout`),\n confirmCheckout: createAction(`${name}/confirmCheckout`),\n cancelCheckout: createAction(`${name}/cancelCheckout`),\n submitCheckout: createAction(`${name}/submitCheckout`),\n errorCheckout: createAction(`${name}/errorCheckout`, (payload: string) => ({ payload, })),\n checkoutEvent: createAction(`${name}/checkoutEvent`, (payload: CheckoutEvent) => ({ payload, })),\n ...checkoutActions,\n};\n\nexport { reducer as checkoutReducer, actions as checkoutActions };\n","import { SubscriptionsState } from './interfaces';\nimport { combineReducers } from '@reduxjs/toolkit';\nimport { subscriptionsStoreName } from '../constants';\nimport { plansActions, plansInitialState, plansReducer } from './Plans';\nimport { configActions, configInitialState, configReducer } from './Config';\nimport { billingActions, billingInitialState, billingReducer } from './Billing';\nimport { checkoutActions, checkoutInitialState, checkoutReducer } from './Checkout';\n\nexport const initialState: SubscriptionsState = {\n config: configInitialState,\n plans: plansInitialState,\n checkout: checkoutInitialState,\n billing: billingInitialState,\n};\n\nconst actions = {\n config: configActions,\n billing: billingActions,\n plans: plansActions,\n checkout: checkoutActions,\n};\n\nconst reducer = combineReducers({\n config: configReducer,\n billing: billingReducer,\n plans: plansReducer,\n checkout: checkoutReducer,\n});\n\nexport { subscriptionsStoreName as name, reducer, actions };\n","import { createAction, createSlice, PayloadAction } from '@reduxjs/toolkit';\n\nimport { StripeState } from './interfaces';\nimport { createModuleCaseReducers } from '../utils';\nimport { subscriptionsStoreName } from '../../constants';\n\nexport const initialSubscriptionStripeState: StripeState = {\n loading: false,\n error: null,\n};\n\nconst reducers = {\n ...createModuleCaseReducers<StripeState>(),\n setStripeState: {\n prepare: (payload: Partial<StripeState>) => ({ payload }),\n reducer: (\n state: StripeState,\n action: PayloadAction<Partial<StripeState>>\n ): StripeState => ({\n ...state,\n ...action.payload,\n }),\n },\n};\n\nconst {\n reducer,\n actions: reducerActions,\n name,\n} = createSlice<StripeState, typeof reducers>({\n name: `${subscriptionsStoreName}/stripe`,\n initialState: initialSubscriptionStripeState,\n reducers,\n});\n\nconst actions = {\n loadCustomer: createAction(`${name}/loadCustomer`),\n ...reducerActions,\n};\n\nexport { reducer as stripeReducer, actions as stripeActions };\n","import { call, put, select, takeEvery } from 'redux-saga/effects';\nimport { stripeActions } from './index';\nimport { api, FronteggApiError, IStripeCustomerResponse, IUserProfile } from '@frontegg/rest-api';\n\nexport function* subscriptionStripeSagas() {\n yield takeEvery(stripeActions.loadCustomer, loadStripeCustomer);\n}\n\nexport function* loadStripeCustomer() {\n const profile: IUserProfile = yield select(({ auth }) => auth.profileState && auth.profileState.profile);\n if (!profile || !profile.id) {\n yield put(stripeActions.setError('Not authorized'));\n return;\n }\n yield put(stripeActions.setLoading(true));\n try {\n const response: IStripeCustomerResponse = yield call(api.subscriptions.getStripeCustomer, profile.tenantId);\n if (!response || !response.stripeCustomerId) {\n yield createCustomer(profile);\n }\n\n yield put(stripeActions.setLoading(false));\n } catch (e) {\n if (e instanceof FronteggApiError && e.statusCode === 404) {\n yield createCustomer(profile);\n } else {\n yield put(stripeActions.setError(e.message));\n }\n }\n}\n\nfunction* createCustomer(profile: IUserProfile) {\n try {\n yield call(api.subscriptions.createStripeCustomer, {\n name: profile.name,\n email: profile.email,\n });\n } catch (e) {\n yield put(stripeActions.setError(e.message));\n }\n}\n","import {\n ISubscriptionCancellationPolicy,\n ISubscriptionCancellationResponse,\n ISubscriptionStatus,\n ProviderType,\n} from '@frontegg/rest-api';\nimport {\n PaymentProvider,\n SubscriptionCancellation,\n SubscriptionCancellationPolicy,\n SubscriptionStatus,\n} from './general.interfaces';\n\nexport function toApiPaymentProviderType(paymentProvider: PaymentProvider): ProviderType {\n return ProviderType.Stripe;\n}\n\nexport function toPrice(amount: number): number {\n return +(amount / 100).toFixed(2);\n}\n\nexport function toSubscriptionCancellation({ policy }: ISubscriptionCancellationResponse): SubscriptionCancellation {\n return {\n policy: toSubscriptionCancellationPolicy(policy),\n };\n}\n\nexport function toSubscriptionCancellationPolicy(\n policy: ISubscriptionCancellationPolicy\n): SubscriptionCancellationPolicy {\n return SubscriptionCancellationPolicy.AT_PERIOD_END;\n}\n\nexport function toSubscriptionStatus(status: ISubscriptionStatus): SubscriptionStatus {\n switch (status) {\n case ISubscriptionStatus.ACTIVE:\n return SubscriptionStatus.ACTIVE;\n case ISubscriptionStatus.INCOMPLETE:\n return SubscriptionStatus.INCOMPLETE;\n case ISubscriptionStatus.CANCELED:\n return SubscriptionStatus.CANCELED;\n case ISubscriptionStatus.EXPIRED:\n return SubscriptionStatus.EXPIRED;\n default:\n return SubscriptionStatus.EXPIRED;\n }\n}\n","import { call, put, select, takeEvery } from 'redux-saga/effects';\nimport {\n api,\n FronteggApiError,\n IPlanResponse,\n ISubscriptionResponse,\n ISubscriptionSummariesResponse,\n ITenantConfigurationResponse,\n} from '@frontegg/rest-api';\nimport { informationActions } from './index';\nimport { BillingInformationState } from './interfaces';\nimport { PaymentProvider, SubscriptionCancellationPolicy, SubscriptionStatus } from '../../general.interfaces';\nimport { checkoutActions } from '../../Checkout';\nimport { PayloadAction } from '@reduxjs/toolkit';\nimport { CheckoutEvent } from '../../Checkout/interfaces';\nimport { loadStripeCustomer } from '../../Stripe/saga';\nimport { toApiPaymentProviderType, toPrice, toSubscriptionCancellation, toSubscriptionStatus } from '../../mapper';\n\nexport function* subscriptionBillingInformationSagas() {\n yield takeEvery(informationActions.loadBillingInformation, loadBillingInformation);\n yield takeEvery(informationActions.cancelSubscription, cancelSubscription);\n yield takeEvery(informationActions.renewSubscription, renewSubscription);\n yield takeEvery(checkoutActions.checkoutEvent, checkoutEvent);\n}\n\nfunction* loadBillingInformation() {\n const paymentProvider: PaymentProvider = yield select((state) => state.subscriptions.config.config.paymentProvider);\n const tenantId: string = yield select((state) => state.auth?.profileState?.profile?.tenantId);\n yield put(informationActions.setLoading(true));\n\n if (!paymentProvider || !tenantId) {\n yield put(informationActions.setError(!paymentProvider ? 'Internal feature failure' : 'Not authorized'));\n return;\n }\n\n try {\n yield loadStripeCustomer();\n yield loadSummaries(tenantId);\n } catch (e) {\n yield put(informationActions.setError(e.message));\n }\n}\n\nfunction* loadTenantConfiguration(tenantId: string, paymentProvider: PaymentProvider) {\n try {\n const tenantConfigurationResponse: ITenantConfigurationResponse = yield call(\n api.subscriptions.getTenantConfiguration,\n tenantId\n );\n if (!tenantConfigurationResponse) {\n yield createTenantConfiguration(tenantId, paymentProvider);\n }\n yield put(informationActions.setLoading(false));\n } catch (e) {\n if (e instanceof FronteggApiError && e.statusCode === 404) {\n yield createTenantConfiguration(tenantId, paymentProvider);\n } else {\n throw e;\n }\n }\n}\n\nfunction* createTenantConfiguration(tenantId: string, providerType: PaymentProvider) {\n if (providerType === PaymentProvider.STRIPE) {\n yield call(api.subscriptions.createTenantConfiguration, {\n tenantId,\n providerType: toApiPaymentProviderType(providerType),\n });\n }\n}\n\nfunction* loadSummaries(tenantId: string) {\n yield put(informationActions.setLoading(true));\n\n try {\n const { currentPlanId, subscriptionId, externallyManaged }: ISubscriptionSummariesResponse = yield call(\n api.subscriptions.getSubscriptionSummaries,\n tenantId\n );\n const subscriptionResponse: ISubscriptionResponse = yield call(api.subscriptions.getSubscription, subscriptionId);\n const planResponse: IPlanResponse = yield call(api.subscriptions.getSubscriptionPlan, currentPlanId);\n\n yield put(\n informationActions.setBillingInformation({\n loading: false,\n externallyManaged,\n ...(subscriptionResponse\n ? {\n subscription: {\n id: subscriptionResponse.id,\n externalId: subscriptionResponse.externalId,\n startDate: new Date(subscriptionResponse.startDate),\n currentPeriodStart: new Date(subscriptionResponse.currentPeriodStart),\n currentPeriodEnd: new Date(subscriptionResponse.currentPeriodEnd),\n status: toSubscriptionStatus(subscriptionResponse.status),\n cancellation:\n subscriptionResponse.cancellation && toSubscriptionCancellation(subscriptionResponse.cancellation),\n items: subscriptionResponse.items.map((subscriptionItem) => ({\n id: subscriptionItem.id,\n planId: subscriptionItem.planId,\n })),\n },\n }\n : {}),\n ...(planResponse\n ? {\n plan: {\n id: planResponse.id,\n name: planResponse.name,\n description: planResponse.description,\n price: toPrice(planResponse.price?.amount || 0),\n currency: planResponse.price?.currency || 'usd',\n recurringInterval: 'month',\n },\n }\n : {}),\n })\n );\n } catch (e) {\n yield put(informationActions.setError(e.message));\n }\n}\n\nfunction* cancelSubscription() {\n const overview: BillingInformationState = yield select((state) => state.subscriptions.billing.information);\n if (!overview.subscription) {\n return;\n }\n if (overview.externallyManaged) {\n yield put(informationActions.setCancellationError('Billing is externally managed'));\n return;\n }\n const { id: subscriptionId, cancellation, status } = overview.subscription;\n const isCancellable = !cancellation && status === SubscriptionStatus.ACTIVE;\n if (isCancellable) {\n try {\n yield put(informationActions.setCancellationLoading(true));\n yield call(api.subscriptions.cancelSubscription, subscriptionId);\n yield put(\n informationActions.setBillingInformation({\n subscription: {\n ...overview.subscription,\n cancellation: {\n policy: SubscriptionCancellationPolicy.AT_PERIOD_END,\n },\n },\n })\n );\n\n yield put(informationActions.setCancellationLoading(false));\n } catch (e) {\n yield put(informationActions.setCancellationError(e.message));\n }\n }\n}\n\n\n\nfunction* renewSubscription() {\n const overview: BillingInformationState = yield select((state) => state.subscriptions.billing.overview);\n if (!overview.subscription) {\n return;\n }\n if (overview.externallyManaged) {\n yield put(informationActions.setCancellationError('Billing is externally managed'));\n return;\n }\n const { id: subscriptionId, cancellation } = overview.subscription;\n const renewable = cancellation && cancellation.policy === SubscriptionCancellationPolicy.AT_PERIOD_END;\n if (renewable) {\n try {\n yield put(informationActions.setRenewalLoading(true));\n yield call(api.subscriptions.renewSubscription, subscriptionId);\n yield put(\n informationActions.setBillingInformation({\n subscription: {\n ...overview.subscription,\n cancellation: null,\n },\n })\n );\n\n yield put(informationActions.setRenewalLoading(false));\n } catch (e) {\n yield put(informationActions.setCancellationError(e.message));\n }\n }\n}\n\nfunction* checkoutEvent({ payload }: PayloadAction<CheckoutEvent>) {\n if (payload === CheckoutEvent.CONFIRMED) {\n yield loadBillingInformation();\n }\n}\n","import { call, put, takeEvery } from 'redux-saga/effects';\nimport { subscriptionsPaymentMethodActions } from './index';\nimport {\n api,\n ISubscriptionPaymentMethodCardResponse,\n ISubscriptionUpdatePaymentMethodBillingDetails,\n} from '@frontegg/rest-api';\nimport { checkoutActions } from '../../Checkout';\nimport { PayloadAction } from '@reduxjs/toolkit';\nimport { CheckoutEvent } from '../../Checkout/interfaces';\nimport { WithCallback } from '../../../interfaces';\n\nexport function* subscriptionsPaymentMethodSagas() {\n yield takeEvery(subscriptionsPaymentMethodActions.loadPaymentMethod, loadPaymentMethod);\n yield takeEvery(\n subscriptionsPaymentMethodActions.updatePaymentMethodBillingDetails,\n updatePaymentMethodBillingDetails\n );\n yield takeEvery(checkoutActions.checkoutEvent, checkoutEvent);\n}\n\nfunction* loadPaymentMethod() {\n yield put(subscriptionsPaymentMethodActions.setLoading(true));\n try {\n const paymentMethods: ISubscriptionPaymentMethodCardResponse[] = yield call(api.subscriptions.getPaymentMethods);\n const paymentMethod = paymentMethods[0];\n if (paymentMethod) {\n yield put(subscriptionsPaymentMethodActions.setPaymentMethod({ ...paymentMethod }));\n }\n } catch (e) {\n yield put(subscriptionsPaymentMethodActions.setError(e.message));\n }\n yield put(subscriptionsPaymentMethodActions.setLoading(false));\n}\n\nfunction* checkoutEvent({ payload }: PayloadAction<CheckoutEvent>) {\n if (payload === CheckoutEvent.CONFIRMED) {\n yield loadPaymentMethod();\n }\n}\n\nfunction* updatePaymentMethodBillingDetails({\n payload,\n}: PayloadAction<WithCallback<ISubscriptionUpdatePaymentMethodBillingDetails & { id: string }>>) {\n yield put(subscriptionsPaymentMethodActions.setLoading(true));\n const { id, email, address, callback } = payload;\n try {\n yield call(api.subscriptions.updatePaymentMethodBillingDetails, id, { email, ...address });\n yield call(loadPaymentMethod);\n callback?.(true);\n } catch (e) {\n yield put(subscriptionsPaymentMethodActions.setError(e.message));\n callback?.(false);\n }\n yield put(subscriptionsPaymentMethodActions.setLoading(false));\n}\n","import { all, call, put, takeEvery } from 'redux-saga/effects';\nimport { invoicesActions } from './index';\nimport { api, IPlanResponse, ISubscriptionInvoiceResponse, ISubscriptionResponse } from '@frontegg/rest-api';\nimport { PayloadAction } from '@reduxjs/toolkit';\nimport { DownloadInvoiceActionPayload } from './interfaces';\nimport { CheckoutEvent } from '../../Checkout/interfaces';\nimport { checkoutActions } from '../../Checkout';\n\nexport function* subscriptionInvoicesSagas() {\n yield takeEvery(invoicesActions.loadInvoices, loadInvoices);\n yield takeEvery(invoicesActions.downloadInvoice, downloadInvoice);\n yield takeEvery(checkoutActions.checkoutEvent, checkoutEvent);\n}\n\nfunction* loadInvoices() {\n yield put(invoicesActions.setLoading(true));\n try {\n const invoices: ISubscriptionInvoiceResponse[] = yield call(api.subscriptions.getSubscriptionInvoices);\n\n const fetchSubscriptions = invoices\n .filter((invoice) => invoice.subscriptionId)\n .map((invoice) => call(api.subscriptions.getSubscription, invoice.subscriptionId));\n\n const subscriptions: ISubscriptionResponse[] = yield all(fetchSubscriptions);\n\n const fetchPlans = [];\n const subscriptionPlanMap: { [subscriptionId: string]: string[] } = {};\n for (let subscription of subscriptions) {\n const listPlans = [];\n for (let item of subscription.items) {\n listPlans.push(item.planId);\n fetchPlans.push(call(api.subscriptions.getSubscriptionPlan, item.planId));\n }\n subscriptionPlanMap[subscription.id] = listPlans;\n }\n\n const plans: IPlanResponse[] = yield all(fetchPlans);\n const planMap = plans.reduce<{ [planId: string]: IPlanResponse }>(\n (previousValue, currentValue) => ({\n ...previousValue,\n [currentValue.id]: currentValue,\n }),\n {}\n );\n\n const selectPlanTitle = (subscriptionId: string): string => {\n const subscriptionPlanIds = subscriptionPlanMap[subscriptionId];\n if (subscriptionPlanIds && subscriptionPlanIds.length > 0) {\n const firstSubscriptionPlanId = subscriptionPlanIds[0];\n if (planMap[firstSubscriptionPlanId]) {\n return planMap[firstSubscriptionPlanId].name;\n }\n }\n\n return '';\n };\n\n yield put(\n invoicesActions.setInvoices(\n invoices.map((invoice) => ({\n id: invoice.id,\n externalId: invoice.externalId,\n subscriptionId: invoice.subscriptionId,\n selectedPlan: selectPlanTitle(invoice.subscriptionId),\n paymentDate: new Date(Date.parse(invoice.paymentDate)),\n totalAmount: +((invoice.totalAmount || 0) / 100).toFixed(2),\n currency: invoice.currency || 'usd',\n paid: invoice.paid || false,\n receiptNumber: invoice.receiptNumber,\n }))\n )\n );\n yield put(invoicesActions.setLoading(false));\n } catch (e) {\n yield put(invoicesActions.setError(e.message));\n }\n}\n\nfunction* downloadInvoice({ payload }: PayloadAction<DownloadInvoiceActionPayload>) {\n yield put(invoicesActions.setLoading(true));\n try {\n yield call(api.subscriptions.getSubscriptionInvoicePdf, payload.invoiceId, payload.filename);\n yield put(invoicesActions.setLoading(false));\n } catch (e) {\n yield put(invoicesActions.setError(e.message));\n }\n}\n\nfunction* checkoutEvent({ payload }: PayloadAction<CheckoutEvent>) {\n if (payload === CheckoutEvent.CONFIRMED) {\n yield loadInvoices();\n }\n}\n","import { all, call } from 'redux-saga/effects';\nimport { subscriptionBillingInformationSagas } from './Information/saga';\nimport { subscriptionsPaymentMethodSagas } from './PaymentMethod/saga';\nimport { subscriptionInvoicesSagas } from './Invoices/saga';\n\nexport function* billingSagas() {\n yield all([\n call(subscriptionBillingInformationSagas),\n call(subscriptionsPaymentMethodSagas),\n call(subscriptionInvoicesSagas),\n ]);\n}\n","import { call, put, select, takeEvery } from 'redux-saga/effects';\nimport { checkoutActions } from './index';\nimport { PayloadAction } from '@reduxjs/toolkit';\nimport { CheckoutState, CheckoutStatus, CheckoutEvent } from './interfaces';\nimport { api, ICreateSubscriptionResponse } from '@frontegg/rest-api';\nimport { PaymentProvider } from '../general.interfaces';\nimport { PaymentProviderConfigState } from '../Config/interfaces';\n\nexport function* checkoutSagas() {\n yield takeEvery(checkoutActions.loadCheckoutSecret, loadCheckoutSecret);\n yield takeEvery(checkoutActions.checkoutPlan, checkoutPlan);\n yield takeEvery(checkoutActions.resetCheckout, resetCheckout);\n yield takeEvery(checkoutActions.confirmCheckout, confirmPlan);\n yield takeEvery(checkoutActions.cancelCheckout, cancelPlan);\n yield takeEvery(checkoutActions.submitCheckout, submitCheckout);\n yield takeEvery(checkoutActions.errorCheckout, errorCheckout);\n}\n\nfunction* checkoutPlan({ payload: planId }: PayloadAction<string>) {\n yield put(checkoutActions.setError(null));\n yield put(checkoutActions.setLoading(true));\n yield put(checkoutActions.selectPlan(planId));\n yield put(checkoutActions.setStatus(CheckoutStatus.CHECKOUT));\n yield put(checkoutActions.setLoading(false));\n}\n\nfunction* resetCheckout() {\n yield put(checkoutActions.selectPlan(null));\n yield put(checkoutActions.setStatus(CheckoutStatus.SELECTION));\n}\n\nfunction* confirmPlan() {\n const checkout: CheckoutState = yield select((state) => state.subscriptions.checkout);\n if (checkout.status === CheckoutStatus.CHECKOUT) {\n yield put(checkoutActions.setError(null));\n yield put(checkoutActions.setLoading(true));\n yield put(checkoutActions.selectPlan(null));\n yield put(checkoutActions.setStatus(CheckoutStatus.CONFIRM));\n yield put(checkoutActions.setLoading(false));\n yield put(checkoutActions.checkoutEvent(CheckoutEvent.CONFIRMED));\n }\n}\n\nfunction* cancelPlan() {\n const checkout: CheckoutState = yield select((state) => state.subscriptions.checkout);\n if (checkout.status === CheckoutStatus.CHECKOUT) {\n yield put(checkoutActions.setError(null));\n yield put(checkoutActions.setLoading(true));\n yield put(checkoutActions.selectPlan(null));\n yield put(checkoutActions.setStatus(CheckoutStatus.CANCEL));\n yield put(checkoutActions.setLoading(false));\n yield put(checkoutActions.checkoutEvent(CheckoutEvent.CANCEL));\n }\n}\n\nfunction* loadCheckoutSecret() {\n const { config }: PaymentProviderConfigState = yield select((state) => state.subscriptions.config);\n if (config.paymentProvider === PaymentProvider.STRIPE) {\n yield put(checkoutActions.setLoading(true));\n const { checkoutPlanId }: CheckoutState = yield select((state) => state.subscriptions.checkout);\n if (checkoutPlanId) {\n try {\n const response: ICreateSubscriptionResponse = yield call(api.subscriptions.createSubscription, {\n stripePlanId: checkoutPlanId,\n });\n\n yield put(checkoutActions.setStripeClientSecret(response.subscriptionSecret));\n yield put(checkoutActions.setLoading(false));\n } catch (e) {\n yield put(checkoutActions.setError(e.message));\n }\n }\n }\n}\n\n/**\n * Based on payment provider type\n */\nfunction* submitCheckout() {\n const { config }: PaymentProviderConfigState = yield select((state) => state.subscriptions.config);\n if (config.paymentProvider === PaymentProvider.STRIPE) {\n yield put(checkoutActions.setError(null));\n yield put(checkoutActions.setLoading(true));\n yield put(checkoutActions.checkoutEvent(CheckoutEvent.SUBMITTED));\n }\n}\n\nfunction* errorCheckout({ payload }: PayloadAction<string>) {\n yield put(checkoutActions.setStatus(CheckoutStatus.ERROR));\n yield put(checkoutActions.setError(payload));\n yield put(checkoutActions.checkoutEvent(CheckoutEvent.ERROR));\n}\n","import { call, put, takeEvery } from 'redux-saga/effects';\nimport { plansActions } from './index';\nimport { api, IPlanResponse } from '@frontegg/rest-api';\n\nexport function* plansSagas() {\n yield takeEvery(plansActions.loadPlans, loadPlans);\n}\n\nfunction* loadPlans() {\n yield put(plansActions.setLoading(true));\n\n try {\n const products: IPlanResponse[] = yield call(api.subscriptions.getSubscriptionPlans);\n yield put(\n plansActions.setPlans(\n products.map((item) => ({\n id: item.id,\n name: item.name,\n description: item.description,\n price: +((item.price?.amount || 0) / 100).toFixed(2),\n currency: item.price?.currency || 'usd',\n recurringInterval: 'month',\n }))\n )\n );\n yield put(plansActions.setLoading(false));\n } catch (e) {\n yield put(plansActions.setError(e.message));\n }\n}\n","import { call, put, takeEvery } from 'redux-saga/effects';\nimport { configActions } from './index';\nimport {\n api,\n IPaymentProviderResponse,\n IStripePaymentProviderConfigurationResponse,\n ProviderType,\n} from '@frontegg/rest-api';\n\nexport function* configSagas() {\n yield takeEvery(configActions.loadPaymentConfiguration, loadPaymentConfiguration);\n}\n\nfunction* loadPaymentConfiguration() {\n yield put(configActions.setLoading(true));\n try {\n const response: IPaymentProviderResponse[] = yield call(api.subscriptions.getPaymentProviders) || [];\n const stripePaymentProvider = response.find(\n (paymentProvider) => paymentProvider.status === '1' && paymentProvider.providerType === ProviderType.Stripe\n );\n\n if (stripePaymentProvider) {\n yield loadStripePaymentConfiguration();\n } else {\n yield put(configActions.setError('Payment provider not configured'));\n }\n } catch (e) {\n yield put(configActions.setError(e.message));\n }\n}\n\nfunction* loadStripePaymentConfiguration() {\n yield put(configActions.setLoading(true));\n try {\n const response: IStripePaymentProviderConfigurationResponse = yield call(\n api.subscriptions.getStripePaymentProviderConfiguration\n );\n yield put(configActions.setStripePaymentProvider(response.publishableKey));\n yield put(configActions.setLoading(false));\n } catch (e) {\n yield put(configActions.setError(e.message));\n }\n}\n","import { all, call } from 'redux-saga/effects';\nimport { billingSagas } from './Billing/saga';\nimport { checkoutSagas } from './Checkout/saga';\nimport { plansSagas } from './Plans/saga';\nimport { configSagas } from './Config/saga';\n\nexport function* sagas() {\n yield all([call(billingSagas), call(checkoutSagas), call(plansSagas), call(configSagas)]);\n}\n","import { WithCallback } from \"../../../interfaces\";\nimport { ISubscriptionUpdatePaymentMethodBillingDetails } from \"@frontegg/rest-api\";\nimport { subscriptionsPaymentMethodActions } from './index';\n//TODO: consider use types from typescript-rest-api or duplicate them.\nexport type PaymentMethod = {\n id: string;\n type: 'card';\n externalId?: string;\n isDefault?: boolean;\n last4?: string;\n expMonth?: number;\n expYear?: number;\n brand?: string;\n billingDetails?: BillingDetailsResponse;\n};\n\nexport interface PaymentMethodState {\n loading: boolean;\n error: string | null;\n paymentMethod?: PaymentMethod;\n}\n\nexport interface PaymentMethodActions {\n loadPaymentMethod: () => void;\n updatePaymentMethodBillingDetails: (payload: WithCallback<ISubscriptionUpdatePaymentMethodBillingDetails & { id: string }>) => void;\n setError: typeof subscriptionsPaymentMethodActions.setError\n}\n\nexport interface BillingDetailsResponse {\n name?: string;\n email?: string;\n address?: AddressResponse;\n}\n\nexport interface AddressResponse {\n addressLine1?: string;\n addressLine2?: string;\n city?: string;\n state?: string;\n postalCode?: string;\n country?: string;\n}\n\nexport enum PaymentMethodType {\n UNKNWON = 'unknown',\n CARD = 'card',\n}\n","// export store\n\nimport { subscriptionsStoreName as storeName } from '../constants';\nimport { actions, initialState, reducer } from './reducer';\nimport { sagas } from './saga';\n\nexport * from './interfaces';\n\nexport {\n sagas as subscriptionSagas,\n reducer as subscriptionReducers,\n actions as subscriptionActions,\n initialState as subscriptionInitialState,\n storeName as subscriptionsStoreName,\n};\n\n// export store\nexport default {\n sagas,\n reducer,\n actions,\n initialState,\n storeName,\n};\n"],"names":["_a","createSlice","subscriptionsStoreName","sliceActions","reducer","name","actions","createAction","PaymentProvider","SubscriptionStatus","SubscriptionCancellationPolicy","reducers","invoicesActions","informationActions","subscriptionsPaymentMethodActions","combineReducers","invoicesReducer","informationReducer","subscriptionsPaymentMethodReducer","CheckoutStatus","CheckoutEvent","configActions","plansActions","checkoutActions","configReducer","plansReducer","checkoutReducer","select","put","stripeActions","call","api","FronteggApiError","ISubscriptionStatus","takeEvery","checkoutEvent","all","ProviderType","PaymentMethodType"],"mappings":";;;;;;;;;;SAYgB,wBAAwB;IACtC,OAAO;QACL,UAAU,EAAE;YACV,OAAO,EAAE,UAAC,OAAgB,IAAK,QAAC,EAAE,OAAO,SAAA,EAAE,IAAC;YAC5C,OAAO,EAAE,UAAC,KAAY,EAAE,MAA8B,IAAK,yDAAM,KAAK,KAAE,OAAO,EAAE,MAAM,CAAC,OAAO,MAAM,MAAM,CAAC,OAAO,GAAC,EAAC,KAAK,EAAE,IAAI,EAAC,GAAC,EAAE,MAAI;SACzI;QACD,QAAQ,E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ts","../../src/subscriptions/general.interfaces.ts","../../src/subscriptions/Config/index.ts","../../src/subscriptions/Billing/Information/index.ts","../../src/subscriptions/Billing/PaymentMethod/index.ts","../../src/subscriptions/Billing/Invoices/index.ts","../../src/subscriptions/Billing/index.ts","../../src/subscriptions/Checkout/interfaces.ts","../../src/subscriptions/Checkout/index.ts","../../src/subscriptions/Stripe/index.ts","../../src/subscriptions/reducer.ts","../../src/subscriptions/Stripe/saga.ts","../../src/subscriptions/mapper.ts","../../src/subscriptions/Billing/Information/saga.ts","../../src/subscriptions/Billing/PaymentMethod/saga.ts","../../src/subscriptions/Billing/Invoices/saga.ts","../../src/subscriptions/Billing/saga.ts","../../src/subscriptions/Checkout/saga.ts","../../src/subscriptions/Plans/saga.ts","../../src/subscriptions/Config/saga.ts","../../src/subscriptions/saga.ts","../../src/subscriptions/Billing/PaymentMethod/interfaces.ts","../../src/subscriptions/index.ts"],"sourcesContent":["import { AnyAction, PayloadAction } from '@reduxjs/toolkit';\n\nexport interface ModuleCaseState {\n loading: boolean;\n error: string | null;\n}\n\nexport type ModuleCaseActions = {\n setLoading: (payload: boolean) => void;\n setError: (payload: string | null) => void;\n};\n\nexport function createModuleCaseReducers<State>() {\n return {\n setLoading: {\n prepare: (payload: boolean) => ({ payload }),\n reducer: (state: State, action: PayloadAction<boolean>) => ({ ...state, loading: action.payload, ...(action.payload?{error: null}:{}) }),\n },\n setError: {\n prepare: (payload: string | null) => ({ payload }),\n reducer: (state: State, action: PayloadAction<string | null>) => ({\n ...state,\n error: action.payload,\n loading: false,\n }),\n },\n setState: {\n prepare: (payload: Partial<State>) => ({ payload }),\n reducer: (state: State, action: PayloadAction<Partial<State>>) => ({\n ...state,\n ...action.payload,\n }),\n },\n };\n}\n\nexport type RequiredReducer<State, Action extends AnyAction> = (state: State, action: Action) => State;\n\nexport function createKeyCaseReducer<State, Key extends keyof State, Action extends AnyAction>(\n key: Key,\n setState: RequiredReducer<State[Key], Action>\n) {\n return {\n prepare: (payload: Action['payload']) => ({ payload }),\n reducer: (state: State, action: Action) => ({\n ...state,\n [key]: setState(state[key], action),\n }),\n };\n}\n\nexport function createKeyCaseLoadingReducer<State extends ModuleCaseState>(key: keyof State) {\n return createKeyCaseReducer<State, keyof State, PayloadAction<boolean>>(key, (state, action) => ({\n ...state,\n loading: action.payload,\n }));\n}\n\nexport function createKeyCaseErrorReducer<State extends ModuleCaseState>(key: keyof State) {\n return createKeyCaseReducer<State, keyof State, PayloadAction<string | null>>(key, (state, action) => ({\n ...state,\n error: action.payload,\n loading: false,\n }));\n}\n","import { PlansState } from './interfaces';\nimport { createAction, createSlice, PayloadAction } from '@reduxjs/toolkit';\nimport { subscriptionsStoreName } from '../../constants';\nimport { Plan } from '../general.interfaces';\nimport { createModuleCaseReducers } from '../utils';\n\nexport const plansInitialState: PlansState = {\n loading: false,\n error: null,\n plans: [],\n};\n\nconst { actions: sliceActions, reducer, name } = createSlice({\n name: `${subscriptionsStoreName}/plans`,\n initialState: plansInitialState,\n reducers: {\n ...createModuleCaseReducers<PlansState>(),\n setPlans: {\n prepare: (payload: Plan[]) => ({ payload }),\n reducer: (state, action: PayloadAction<Plan[]>) => ({\n ...state,\n plans: action.payload,\n }),\n },\n },\n});\n\nconst actions = {\n loadPlans: createAction(`${name}/loadPlans`),\n ...sliceActions,\n};\n\nexport { actions as plansActions, reducer as plansReducer };\n","export enum PaymentProvider {\n DEFAULT = 'Default',\n STRIPE = 'Stripe',\n}\n\nexport interface Plan {\n id: string;\n name: string;\n description: string;\n price: number;\n currency: string;\n recurringInterval: string;\n}\n\nexport enum SubscriptionStatus {\n ACTIVE = 'ACTIVE',\n CANCELED = 'CANCELED',\n INCOMPLETE = 'INCOMPLETE',\n EXPIRED = 'EXPIRED',\n}\n\nexport interface Subscription {\n id: string;\n externalId: string;\n startDate: Date;\n currentPeriodStart: Date;\n currentPeriodEnd: Date;\n status: SubscriptionStatus;\n cancellation: SubscriptionCancellation | null;\n items: SubscriptionItem[];\n}\n\nexport interface SubscriptionItem {\n id: string;\n planId: string;\n}\n\nexport interface SubscriptionCancellation {\n policy: SubscriptionCancellationPolicy;\n}\n\nexport enum SubscriptionCancellationPolicy {\n AT_PERIOD_END = 'atPeriodEnd',\n}\n\nexport interface Invoice {\n id: string;\n externalId?: string;\n subscriptionId: string;\n selectedPlan: string;\n paymentDate: Date;\n totalAmount: number;\n currency: string;\n paid: boolean;\n receiptNumber?: string;\n}\n","import { PaymentProviderConfigState } from './interfaces';\nimport { createAction, createSlice, PayloadAction } from '@reduxjs/toolkit';\nimport { subscriptionsStoreName } from '../../constants';\nimport { PaymentProvider } from '../general.interfaces';\nimport { createModuleCaseReducers } from '../utils';\n\nexport const configInitialState: PaymentProviderConfigState = {\n loading: false,\n error: null,\n config: {\n paymentProvider: PaymentProvider.DEFAULT,\n },\n};\n\nconst reducers = {\n ...createModuleCaseReducers<PaymentProviderConfigState>(),\n setStripePaymentProvider: {\n prepare: (payload: string) => ({ payload }),\n reducer(state: PaymentProviderConfigState, action: PayloadAction<string>) {\n state.config.paymentProvider = PaymentProvider.STRIPE;\n if (state.config.paymentProvider === PaymentProvider.STRIPE) {\n state.config.apiKey = action.payload;\n }\n },\n },\n};\n\nconst { actions: configActions, reducer, name } = createSlice<PaymentProviderConfigState, typeof reducers>({\n name: `${subscriptionsStoreName}/config`,\n initialState: configInitialState,\n reducers,\n});\n\nconst actions = {\n loadPaymentConfiguration: createAction(`${name}/loadPaymentConfiguration`),\n ...configActions,\n};\n\nexport { reducer as configReducer, actions as configActions };\n","import { createAction, createSlice, PayloadAction } from '@reduxjs/toolkit';\nimport { createKeyCaseErrorReducer, createKeyCaseLoadingReducer, createModuleCaseReducers } from '../../utils';\nimport { subscriptionsStoreName } from '../../../constants';\nimport { BillingInformationState } from './interfaces';\n\nexport const initialBillingInformationState: BillingInformationState = {\n loading: false,\n error: null,\n externallyManaged: false,\n cancellation: {\n loading: false,\n error: null,\n },\n renewal: {\n loading: false,\n error: null,\n },\n};\n\nconst reducers = {\n ...createModuleCaseReducers<BillingInformationState>(),\n setBillingInformation: {\n prepare: (payload: Partial<BillingInformationState>) => ({ payload }),\n reducer: (\n state: BillingInformationState,\n action: PayloadAction<Partial<BillingInformationState>>\n ): BillingInformationState => ({\n ...state,\n ...action.payload,\n }),\n },\n setCancellationLoading: createKeyCaseLoadingReducer<BillingInformationState>('cancellation'),\n setCancellationError: createKeyCaseErrorReducer<BillingInformationState>('cancellation'),\n setRenewalLoading: createKeyCaseLoadingReducer<BillingInformationState>('renewal'),\n setRenewalError: createKeyCaseErrorReducer<BillingInformationState>('renewal'),\n};\n\nconst {\n reducer,\n actions: overviewActions,\n name,\n} = createSlice<BillingInformationState, typeof reducers>({\n name: `${subscriptionsStoreName}/billing/information`,\n initialState: initialBillingInformationState,\n reducers,\n});\n\nconst actions = {\n loadBillingInformation: createAction(`${name}/loadBillingInformation`),\n cancelSubscription: createAction(`${name}/cancelSubscription`),\n renewSubscription: createAction(`${name}/renewSubscription`),\n ...overviewActions,\n};\n\nexport { reducer as informationReducer, actions as informationActions };\n","import { createModuleCaseReducers } from '../../utils';\nimport { subscriptionsStoreName } from '../../../constants';\nimport { PaymentMethodState, PaymentMethod } from './interfaces';\nimport { createAction, createSlice, PayloadAction } from '@reduxjs/toolkit';\nimport { ISubscriptionUpdatePaymentMethodBillingDetails } from '@frontegg/rest-api';\nimport { WithCallback } from '../../../interfaces';\n\nexport const initialPaymentMethodState: PaymentMethodState = {\n loading: false,\n error: null,\n};\n\nconst reducers = {\n ...createModuleCaseReducers<PaymentMethodState>(),\n setState: {\n prepare: (payload: Partial<PaymentMethodState>) => ({ payload }),\n reducer: (state: PaymentMethodState, action: PayloadAction<Partial<PaymentMethodState>>): PaymentMethodState => ({\n ...state,\n ...action.payload,\n }),\n },\n};\n\nconst { reducer, actions: paymentActions, name } = createSlice({\n name: `${subscriptionsStoreName}/billing/payment`,\n initialState: initialPaymentMethodState,\n reducers,\n});\n\nconst actions = {\n loadPaymentMethod: createAction(`${name}/loadPaymentMethod`),\n submitPaymentMethod: createAction(`${name}/submitPaymentMethod`),\n submitPaymentMethodError: createAction<string>(`${name}/submitPaymentMethodError`),\n submitPaymentMethodSuccess: createAction(`${name}/submitPaymentMethodSuccess`),\n updatePaymentMethodBillingDetails: createAction(\n `${name}/updateBillingDetails`,\n (payload: WithCallback<ISubscriptionUpdatePaymentMethodBillingDetails & { id: string }>) => ({ payload })\n ),\n ...paymentActions,\n};\n//TODO: refactor to general code-style like export type ConnectivityActions = DispatchedActions;\nexport { reducer as subscriptionsPaymentMethodReducer, actions as subscriptionsPaymentMethodActions };\n","import { createModuleCaseReducers } from '../../utils';\nimport { createAction, createSlice, PayloadAction } from '@reduxjs/toolkit';\nimport { subscriptionsStoreName } from '../../../constants';\nimport { DownloadInvoiceActionPayload, InvoicesState } from './interfaces';\nimport { Invoice } from '../../general.interfaces';\n\nexport const initialInvoicesState: InvoicesState = {\n loading: false,\n error: null,\n invoices: [],\n invoiceDownload: {\n loading: false,\n error: null\n }\n};\n\nconst reducers = {\n ...createModuleCaseReducers<InvoicesState>(),\n setInvoices: {\n prepare: (payload: Invoice[]) => ({ payload }),\n reducer: (state: InvoicesState, action: PayloadAction<Invoice[]>): InvoicesState => ({\n ...state,\n invoices: action.payload,\n }),\n },\n setInvoiceDownloadState: {\n prepare: (payload: InvoicesState['invoiceDownload']) => ({ payload }),\n reducer: (state: InvoicesState, action: PayloadAction<InvoicesState['invoiceDownload']>): InvoicesState => ({\n ...state,\n invoiceDownload: {\n ...state.invoiceDownload,\n ...action.payload\n }\n }),\n },\n};\n\nconst {\n reducer,\n actions: sliceActions,\n name,\n} = createSlice<InvoicesState, typeof reducers>({\n name: `${subscriptionsStoreName}/billing/invoices`,\n initialState: initialInvoicesState,\n reducers,\n});\n\nconst actions = {\n loadInvoices: createAction(`${name}/loadInvoices`),\n downloadInvoice: createAction(`${name}/downloadInvoice`, (payload: DownloadInvoiceActionPayload) => ({ payload })),\n ...sliceActions,\n};\n\nexport { reducer as invoicesReducer, actions as invoicesActions };\n","import { AnyAction, combineReducers, createReducer } from '@reduxjs/toolkit';\nimport { informationActions, informationReducer, initialBillingInformationState } from './Information';\nimport { BillingState } from './interfaces';\nimport { initialPaymentMethodState, subscriptionsPaymentMethodActions, subscriptionsPaymentMethodReducer } from './PaymentMethod';\nimport { initialInvoicesState, invoicesActions, invoicesReducer } from './Invoices';\n\nexport const billingInitialState: BillingState = {\n information: initialBillingInformationState,\n invoices: initialInvoicesState,\n paymentMethod: initialPaymentMethodState,\n};\n\nexport const billingActions = {\n invoices: invoicesActions,\n information: informationActions,\n paymentMethod: subscriptionsPaymentMethodActions,\n};\n\nexport const billingReducer = combineReducers<BillingState, AnyAction>({\n invoices: invoicesReducer,\n information: informationReducer,\n paymentMethod: subscriptionsPaymentMethodReducer,\n});\n","export enum CheckoutStatus {\n SELECTION = 'SELECTION',\n CHECKOUT = 'CHECKOUT',\n CONFIRM = 'CONFIRM',\n ERROR = 'ERROR',\n CANCEL = 'CANCEL',\n}\n\nexport interface CheckoutState {\n loading: boolean;\n error: string | null;\n status: CheckoutStatus;\n checkoutPlanId: string | null;\n}\n\nexport enum CheckoutEvent {\n SUBMITTED = 'SUBMITTED',\n ABORT = 'ABORT',\n CANCEL = 'CANCEL',\n ERROR = 'ERROR',\n CONFIRMED = 'CONFIRMED',\n}\n\nexport interface CheckoutActions {\n checkoutPlan: (planId: string) => void;\n resetCheckout: () => void;\n confirmCheckout: (paymentMethodId: string) => void;\n cancelCheckout: () => void;\n submitCheckout: () => void;\n errorCheckout: (error: string) => void;\n}\n","import { CheckoutEvent, CheckoutState, CheckoutStatus } from './interfaces';\nimport { createAction, createSlice, PayloadAction } from '@reduxjs/toolkit';\nimport { createModuleCaseReducers } from '../utils';\nimport { subscriptionsStoreName } from '../../constants';\n\nexport const checkoutInitialState: CheckoutState = {\n loading: false,\n error: null,\n status: CheckoutStatus.SELECTION,\n checkoutPlanId: null,\n};\n\nconst reducers = {\n ...createModuleCaseReducers<CheckoutState>(),\n setStatus: {\n prepare: (payload: CheckoutStatus) => ({ payload }),\n reducer: (state: CheckoutState, action: PayloadAction<CheckoutStatus>) => ({\n ...state,\n status: action.payload,\n }),\n },\n selectPlan: {\n prepare: (payload: string | null) => ({ payload }),\n reducer: (state: CheckoutState, action: PayloadAction<string | null>) => ({\n ...state,\n checkoutPlanId: action.payload,\n }),\n },\n};\n\nconst { actions: checkoutActions, reducer, name } = createSlice<CheckoutState, typeof reducers>({\n name: `${subscriptionsStoreName}/checkout`,\n initialState: checkoutInitialState,\n reducers,\n});\n\nconst actions = {\n checkoutPlan: createAction(`${name}/checkoutPlan`, (payload: string) => ({ payload })),\n resetCheckout: createAction(`${name}/resetCheckout`),\n confirmCheckout: createAction(`${name}/confirmCheckout`, (payload: string) => ({ payload, })),\n cancelCheckout: createAction(`${name}/cancelCheckout`),\n submitCheckout: createAction(`${name}/submitCheckout`),\n errorCheckout: createAction(`${name}/errorCheckout`, (payload: string) => ({ payload, })),\n checkoutEvent: createAction(`${name}/checkoutEvent`, (payload: CheckoutEvent) => ({ payload, })),\n ...checkoutActions,\n};\n\nexport { reducer as checkoutReducer, actions as checkoutActions };\n","import { createAction, createSlice, PayloadAction } from '@reduxjs/toolkit';\n\nimport { PaymentMethodId, StripeState } from './interfaces';\nimport { createModuleCaseReducers } from '../utils';\nimport { subscriptionsStoreName } from '../../constants';\n\nexport const initialSubscriptionStripeState: StripeState = {\n loading: false,\n error: null,\n cardSetupIntentSecret: null,\n};\n\nconst reducers = {\n ...createModuleCaseReducers<StripeState>(),\n setStripeState: {\n prepare: (payload: Partial<StripeState>) => ({ payload }),\n reducer: (state: StripeState, action: PayloadAction<Partial<StripeState>>): StripeState => ({\n ...state,\n ...action.payload,\n }),\n },\n};\n\nconst {\n reducer,\n actions: reducerActions,\n name,\n} = createSlice<StripeState, typeof reducers>({\n name: `${subscriptionsStoreName}/stripe`,\n initialState: initialSubscriptionStripeState,\n reducers,\n});\n\nconst actions = {\n loadCustomer: createAction(`${name}/loadCustomer`),\n createCardSetupIntentSecret: createAction<PaymentMethodId>(`${name}/createCardSetupIntentSecret`),\n ...reducerActions,\n};\n\nexport { reducer as stripeReducer, actions as stripeActions };\n","import { SubscriptionsState } from './interfaces';\nimport { combineReducers } from '@reduxjs/toolkit';\nimport { subscriptionsStoreName } from '../constants';\nimport { plansActions, plansInitialState, plansReducer } from './Plans';\nimport { configActions, configInitialState, configReducer } from './Config';\nimport { billingActions, billingInitialState, billingReducer } from './Billing';\nimport { checkoutActions, checkoutInitialState, checkoutReducer } from './Checkout';\nimport { initialSubscriptionStripeState, stripeActions, stripeReducer } from './Stripe';\n\nexport const initialState: SubscriptionsState = {\n config: configInitialState,\n plans: plansInitialState,\n checkout: checkoutInitialState,\n billing: billingInitialState,\n stripe: initialSubscriptionStripeState,\n};\n\nconst actions = {\n config: configActions,\n billing: billingActions,\n plans: plansActions,\n checkout: checkoutActions,\n stripe: stripeActions,\n};\n\nconst reducer = combineReducers({\n config: configReducer,\n billing: billingReducer,\n plans: plansReducer,\n checkout: checkoutReducer,\n stripe: stripeReducer,\n});\n\nexport { subscriptionsStoreName as name, reducer, actions };\n","import { call, put, select, takeEvery } from 'redux-saga/effects';\nimport { stripeActions } from './index';\nimport { api, FronteggApiError, IStripeCustomerResponse, IUserProfile } from '@frontegg/rest-api';\nimport { PaymentMethodId } from './interfaces';\nimport { PayloadAction } from '@reduxjs/toolkit';\n\nexport function* subscriptionStripeSagas() {\n yield takeEvery(stripeActions.loadCustomer, loadStripeCustomer);\n yield takeEvery(stripeActions.createCardSetupIntentSecret, createCardSetupIntentSecret);\n}\n\nexport function* loadStripeCustomer() {\n const profile: IUserProfile = yield select(({ auth }) => auth.profileState && auth.profileState.profile);\n if (!profile || !profile.id) {\n yield put(stripeActions.setError('Not authorized'));\n return;\n }\n yield put(stripeActions.setLoading(true));\n try {\n const response: IStripeCustomerResponse = yield call(api.subscriptions.getStripeCustomer, profile.tenantId);\n if (!response || !response.stripeCustomerId) {\n yield createCustomer(profile);\n }\n\n yield put(stripeActions.setLoading(false));\n } catch (e) {\n if (e instanceof FronteggApiError && e.statusCode === 404) {\n yield createCustomer(profile);\n } else {\n yield put(stripeActions.setError(e.message));\n }\n }\n}\n\nfunction* createCustomer(profile: IUserProfile) {\n try {\n yield call(api.subscriptions.createStripeCustomer, {\n name: profile.name,\n email: profile.email,\n });\n } catch (e) {\n yield put(stripeActions.setError(e.message));\n }\n}\n\n\nfunction* createCardSetupIntentSecret({ payload }: PayloadAction<PaymentMethodId>) {\n yield put(stripeActions.setStripeState({\n loading: true,\n error: null,\n cardSetupIntentSecret: null\n }));\n try {\n const { setupIntentSecret } = yield call(api.subscriptions.createStripePaymentMethodSetupIntentSecret,{\n paymentMethodId: payload || undefined\n });\n\n yield put(stripeActions.setStripeState({\n cardSetupIntentSecret: setupIntentSecret,\n loading: false\n }));\n } catch (e) {\n yield put(stripeActions.setError(e.message));\n }\n}\n","import {\n ISubscriptionCancellationPolicy,\n ISubscriptionCancellationResponse,\n ISubscriptionStatus,\n ProviderType,\n} from '@frontegg/rest-api';\nimport {\n PaymentProvider,\n SubscriptionCancellation,\n SubscriptionCancellationPolicy,\n SubscriptionStatus,\n} from './general.interfaces';\n\nexport function toApiPaymentProviderType(paymentProvider: PaymentProvider): ProviderType {\n return ProviderType.Stripe;\n}\n\nexport function toPrice(amount: number): number {\n return +(amount / 100).toFixed(2);\n}\n\nexport function toSubscriptionCancellation({ policy }: ISubscriptionCancellationResponse): SubscriptionCancellation {\n return {\n policy: toSubscriptionCancellationPolicy(policy),\n };\n}\n\nexport function toSubscriptionCancellationPolicy(\n policy: ISubscriptionCancellationPolicy\n): SubscriptionCancellationPolicy {\n return SubscriptionCancellationPolicy.AT_PERIOD_END;\n}\n\nexport function toSubscriptionStatus(status: ISubscriptionStatus): SubscriptionStatus {\n switch (status) {\n case ISubscriptionStatus.ACTIVE:\n return SubscriptionStatus.ACTIVE;\n case ISubscriptionStatus.INCOMPLETE:\n return SubscriptionStatus.INCOMPLETE;\n case ISubscriptionStatus.CANCELED:\n return SubscriptionStatus.CANCELED;\n case ISubscriptionStatus.EXPIRED:\n return SubscriptionStatus.EXPIRED;\n default:\n return SubscriptionStatus.EXPIRED;\n }\n}\n","import { call, put, select, takeEvery } from 'redux-saga/effects';\nimport {\n api,\n FronteggApiError,\n IPlanResponse,\n ISubscriptionResponse,\n ISubscriptionSummariesResponse,\n ITenantConfigurationResponse,\n} from '@frontegg/rest-api';\nimport { informationActions } from './index';\nimport { BillingInformationState } from './interfaces';\nimport { PaymentProvider, SubscriptionCancellationPolicy, SubscriptionStatus } from '../../general.interfaces';\nimport { checkoutActions } from '../../Checkout';\nimport { PayloadAction } from '@reduxjs/toolkit';\nimport { CheckoutEvent } from '../../Checkout/interfaces';\nimport { loadStripeCustomer } from '../../Stripe/saga';\nimport { toApiPaymentProviderType, toPrice, toSubscriptionCancellation, toSubscriptionStatus } from '../../mapper';\n\nexport function* subscriptionBillingInformationSagas() {\n yield takeEvery(informationActions.loadBillingInformation, loadBillingInformation);\n yield takeEvery(informationActions.cancelSubscription, cancelSubscription);\n yield takeEvery(informationActions.renewSubscription, renewSubscription);\n yield takeEvery(checkoutActions.checkoutEvent, checkoutEvent);\n}\n\nfunction* loadBillingInformation() {\n const paymentProvider: PaymentProvider = yield select((state) => state.subscriptions.config.config.paymentProvider);\n const tenantId: string = yield select((state) => state.auth?.profileState?.profile?.tenantId);\n yield put(informationActions.setLoading(true));\n\n if (!paymentProvider || !tenantId) {\n yield put(informationActions.setError(!paymentProvider ? 'Internal feature failure' : 'Not authorized'));\n return;\n }\n\n try {\n yield loadStripeCustomer();\n yield loadSummaries(tenantId);\n } catch (e) {\n yield put(informationActions.setError(e.message));\n }\n}\n\nfunction* loadTenantConfiguration(tenantId: string, paymentProvider: PaymentProvider) {\n try {\n const tenantConfigurationResponse: ITenantConfigurationResponse = yield call(\n api.subscriptions.getTenantConfiguration,\n tenantId\n );\n if (!tenantConfigurationResponse) {\n yield createTenantConfiguration(tenantId, paymentProvider);\n }\n yield put(informationActions.setLoading(false));\n } catch (e) {\n if (e instanceof FronteggApiError && e.statusCode === 404) {\n yield createTenantConfiguration(tenantId, paymentProvider);\n } else {\n throw e;\n }\n }\n}\n\nfunction* createTenantConfiguration(tenantId: string, providerType: PaymentProvider) {\n if (providerType === PaymentProvider.STRIPE) {\n yield call(api.subscriptions.createTenantConfiguration, {\n tenantId,\n providerType: toApiPaymentProviderType(providerType),\n });\n }\n}\n\nfunction* loadSummaries(tenantId: string) {\n yield put(informationActions.setLoading(true));\n\n try {\n const { currentPlanId, subscriptionId, externallyManaged }: ISubscriptionSummariesResponse = yield call(\n api.subscriptions.getSubscriptionSummaries,\n tenantId\n );\n const subscriptionResponse: ISubscriptionResponse = yield call(api.subscriptions.getSubscription, subscriptionId);\n const planResponse: IPlanResponse = yield call(api.subscriptions.getSubscriptionPlan, currentPlanId);\n\n yield put(\n informationActions.setBillingInformation({\n loading: false,\n externallyManaged,\n ...(subscriptionResponse\n ? {\n subscription: {\n id: subscriptionResponse.id,\n externalId: subscriptionResponse.externalId,\n startDate: new Date(subscriptionResponse.startDate),\n currentPeriodStart: new Date(subscriptionResponse.currentPeriodStart),\n currentPeriodEnd: new Date(subscriptionResponse.currentPeriodEnd),\n status: toSubscriptionStatus(subscriptionResponse.status),\n cancellation:\n subscriptionResponse.cancellation && toSubscriptionCancellation(subscriptionResponse.cancellation),\n items: subscriptionResponse.items.map((subscriptionItem) => ({\n id: subscriptionItem.id,\n planId: subscriptionItem.planId,\n })),\n },\n }\n : {}),\n ...(planResponse\n ? {\n plan: {\n id: planResponse.id,\n name: planResponse.name,\n description: planResponse.description,\n price: toPrice(planResponse.price?.amount || 0),\n currency: planResponse.price?.currency || 'usd',\n recurringInterval: 'month',\n },\n }\n : {}),\n })\n );\n } catch (e) {\n yield put(informationActions.setError(e.message));\n }\n}\n\nfunction* cancelSubscription() {\n const overview: BillingInformationState = yield select((state) => state.subscriptions.billing.information);\n if (!overview.subscription) {\n return;\n }\n if (overview.externallyManaged) {\n yield put(informationActions.setCancellationError('Billing is externally managed'));\n return;\n }\n const { id: subscriptionId, cancellation, status } = overview.subscription || {};\n const isCancellable = !cancellation && status === SubscriptionStatus.ACTIVE;\n if (isCancellable) {\n try {\n yield put(informationActions.setCancellationLoading(true));\n yield call(api.subscriptions.cancelSubscription, subscriptionId);\n yield put(\n informationActions.setBillingInformation({\n subscription: {\n ...overview.subscription,\n cancellation: {\n policy: SubscriptionCancellationPolicy.AT_PERIOD_END,\n },\n },\n })\n );\n\n yield put(informationActions.setCancellationLoading(false));\n } catch (e) {\n yield put(informationActions.setCancellationError(e.message));\n }\n }\n}\n\n\n\nfunction* renewSubscription() {\n const overview: BillingInformationState = yield select((state) => state.subscriptions.billing.information);\n if (!overview.subscription) {\n return;\n }\n if (overview.externallyManaged) {\n yield put(informationActions.setCancellationError('Billing is externally managed'));\n return;\n }\n const { id: subscriptionId, cancellation } = overview.subscription || {};\n const renewable = cancellation?.policy === SubscriptionCancellationPolicy.AT_PERIOD_END;\n if (renewable) {\n try {\n yield put(informationActions.setRenewalLoading(true));\n yield call(api.subscriptions.renewSubscription, subscriptionId);\n yield put(\n informationActions.setBillingInformation({\n subscription: {\n ...overview.subscription,\n cancellation: null,\n },\n })\n );\n\n yield put(informationActions.setRenewalLoading(false));\n } catch (e) {\n yield put(informationActions.setCancellationError(e.message));\n }\n }\n}\n\nfunction* checkoutEvent({ payload }: PayloadAction<CheckoutEvent>) {\n if (payload === CheckoutEvent.CONFIRMED) {\n yield loadBillingInformation();\n }\n}\n","import { call, put, takeEvery } from 'redux-saga/effects';\nimport { subscriptionsPaymentMethodActions } from './index';\nimport {\n api,\n ISubscriptionPaymentMethodCardResponse,\n ISubscriptionUpdatePaymentMethodBillingDetails,\n} from '@frontegg/rest-api';\nimport { checkoutActions } from '../../Checkout';\nimport { PayloadAction } from '@reduxjs/toolkit';\nimport { CheckoutEvent } from '../../Checkout/interfaces';\nimport { WithCallback } from '../../../interfaces';\n\nexport function* subscriptionsPaymentMethodSagas() {\n yield takeEvery(subscriptionsPaymentMethodActions.loadPaymentMethod, loadPaymentMethod);\n yield takeEvery(subscriptionsPaymentMethodActions.submitPaymentMethod, submitPaymentMethod);\n yield takeEvery(subscriptionsPaymentMethodActions.submitPaymentMethodError, submitPaymentMethodError);\n yield takeEvery(subscriptionsPaymentMethodActions.submitPaymentMethodSuccess, submitPaymentMethodSuccess);\n yield takeEvery(subscriptionsPaymentMethodActions.updatePaymentMethodBillingDetails, updateBillingDetails);\n yield takeEvery(checkoutActions.checkoutEvent, checkoutEvent);\n}\n\nfunction* loadPaymentMethod() {\n yield put(subscriptionsPaymentMethodActions.setLoading(true));\n try {\n const paymentMethods: ISubscriptionPaymentMethodCardResponse[] = yield call(api.subscriptions.getPaymentMethods);\n const paymentMethod = paymentMethods[0];\n if (paymentMethod) {\n yield put(\n subscriptionsPaymentMethodActions.setState({\n paymentMethod,\n loading: false,\n })\n );\n } else {\n yield put(subscriptionsPaymentMethodActions.setLoading(false));\n }\n } catch (e) {\n yield put(subscriptionsPaymentMethodActions.setError(e.message));\n }\n}\n\nfunction* checkoutEvent({ payload }: PayloadAction<CheckoutEvent>) {\n if (payload === CheckoutEvent.CONFIRMED) {\n yield loadPaymentMethod();\n }\n}\n\nfunction* updateBillingDetails({\n payload,\n}: PayloadAction<WithCallback<ISubscriptionUpdatePaymentMethodBillingDetails & { id: string }>>) {\n yield put(subscriptionsPaymentMethodActions.setLoading(true));\n const { id, email, address, callback } = payload;\n try {\n yield call(api.subscriptions.updatePaymentMethodBillingDetails, id, { email, ...address });\n yield call(loadPaymentMethod);\n callback?.(true);\n } catch (e) {\n yield put(subscriptionsPaymentMethodActions.setError(e.message));\n callback?.(false);\n }\n yield put(subscriptionsPaymentMethodActions.setLoading(false));\n}\n\nfunction* submitPaymentMethod() {\n yield put(subscriptionsPaymentMethodActions.setLoading(true));\n}\n\nfunction* submitPaymentMethodError({ payload: error }: PayloadAction<string>) {\n yield put(subscriptionsPaymentMethodActions.setError(error));\n}\n\nfunction* submitPaymentMethodSuccess() {\n yield put(subscriptionsPaymentMethodActions.loadPaymentMethod());\n}\n","import { all, call, put, takeEvery } from 'redux-saga/effects';\nimport { invoicesActions } from './index';\nimport { api, IPlanResponse, ISubscriptionInvoiceResponse, ISubscriptionResponse } from '@frontegg/rest-api';\nimport { PayloadAction } from '@reduxjs/toolkit';\nimport { DownloadInvoiceActionPayload } from './interfaces';\nimport { CheckoutEvent } from '../../Checkout/interfaces';\nimport { checkoutActions } from '../../Checkout';\n\nexport function* subscriptionInvoicesSagas() {\n yield takeEvery(invoicesActions.loadInvoices, loadInvoices);\n yield takeEvery(invoicesActions.downloadInvoice, downloadInvoice);\n yield takeEvery(checkoutActions.checkoutEvent, checkoutEvent);\n}\n\nfunction* loadInvoices() {\n yield put(invoicesActions.setLoading(true));\n try {\n const invoices: ISubscriptionInvoiceResponse[] = yield call(api.subscriptions.getSubscriptionInvoices);\n\n const fetchSubscriptions = invoices\n .filter((invoice) => invoice.subscriptionId)\n .map((invoice) => call(api.subscriptions.getSubscription, invoice.subscriptionId));\n\n const subscriptions: ISubscriptionResponse[] = yield all(fetchSubscriptions);\n\n const fetchPlans = [];\n const subscriptionPlanMap: { [subscriptionId: string]: string[] } = {};\n for (let subscription of subscriptions) {\n const listPlans = [];\n for (let item of subscription.items) {\n listPlans.push(item.planId);\n fetchPlans.push(call(api.subscriptions.getSubscriptionPlan, item.planId));\n }\n subscriptionPlanMap[subscription.id] = listPlans;\n }\n\n const plans: IPlanResponse[] = yield all(fetchPlans);\n const planMap = plans.reduce<{ [planId: string]: IPlanResponse }>(\n (previousValue, currentValue) => ({\n ...previousValue,\n [currentValue.id]: currentValue,\n }),\n {}\n );\n\n const selectPlanTitle = (subscriptionId: string): string => {\n const subscriptionPlanIds = subscriptionPlanMap[subscriptionId];\n if (subscriptionPlanIds && subscriptionPlanIds.length > 0) {\n const firstSubscriptionPlanId = subscriptionPlanIds[0];\n if (planMap[firstSubscriptionPlanId]) {\n return planMap[firstSubscriptionPlanId].name;\n }\n }\n\n return '';\n };\n\n yield put(\n invoicesActions.setInvoices(\n invoices.map((invoice) => ({\n id: invoice.id,\n externalId: invoice.externalId,\n subscriptionId: invoice.subscriptionId,\n selectedPlan: selectPlanTitle(invoice.subscriptionId),\n paymentDate: new Date(Date.parse(invoice.paymentDate)),\n totalAmount: +((invoice.totalAmount || 0) / 100).toFixed(2),\n currency: invoice.currency || 'usd',\n paid: invoice.paid || false,\n receiptNumber: invoice.receiptNumber,\n }))\n )\n );\n yield put(invoicesActions.setLoading(false));\n } catch (e) {\n yield put(invoicesActions.setError(e.message));\n }\n}\n\nfunction* downloadInvoice({ payload }: PayloadAction<DownloadInvoiceActionPayload>) {\n yield put(invoicesActions.setInvoiceDownloadState({ loading: true, error: null }));\n try {\n yield call(api.subscriptions.getSubscriptionInvoicePdf, payload.invoiceId, payload.filename);\n yield put(invoicesActions.setInvoiceDownloadState({ loading: false, error: null }));\n } catch (e) {\n yield put(invoicesActions.setInvoiceDownloadState({ loading: false, error: e.message || null }));\n }\n}\n\nfunction* checkoutEvent({ payload }: PayloadAction<CheckoutEvent>) {\n if (payload === CheckoutEvent.CONFIRMED) {\n yield loadInvoices();\n }\n}\n","import { all, call } from 'redux-saga/effects';\nimport { subscriptionBillingInformationSagas } from './Information/saga';\nimport { subscriptionsPaymentMethodSagas } from './PaymentMethod/saga';\nimport { subscriptionInvoicesSagas } from './Invoices/saga';\n\nexport function* billingSagas() {\n yield all([\n call(subscriptionBillingInformationSagas),\n call(subscriptionsPaymentMethodSagas),\n call(subscriptionInvoicesSagas),\n ]);\n}\n","import { call, put, select, takeEvery } from 'redux-saga/effects';\nimport { checkoutActions } from './index';\nimport { PayloadAction } from '@reduxjs/toolkit';\nimport { CheckoutEvent, CheckoutStatus } from './interfaces';\nimport { api } from '@frontegg/rest-api';\nimport { PaymentProvider } from '../general.interfaces';\nimport { FronteggState } from '../../index';\n\nexport function* checkoutSagas() {\n yield takeEvery(checkoutActions.checkoutPlan, checkoutPlan);\n yield takeEvery(checkoutActions.resetCheckout, resetCheckout);\n yield takeEvery(checkoutActions.confirmCheckout, confirmPlan);\n yield takeEvery(checkoutActions.cancelCheckout, cancelPlan);\n yield takeEvery(checkoutActions.submitCheckout, submitCheckout);\n yield takeEvery(checkoutActions.errorCheckout, errorCheckout);\n}\n\nfunction* checkoutPlan({ payload: planId }: PayloadAction<string>) {\n yield put(\n checkoutActions.setState({\n checkoutPlanId: planId,\n loading: false,\n error: null,\n status: CheckoutStatus.CHECKOUT,\n })\n );\n}\n\nfunction* resetCheckout() {\n yield put(\n checkoutActions.setState({\n checkoutPlanId: null,\n loading: false,\n status: CheckoutStatus.SELECTION,\n })\n );\n}\n\nfunction* confirmPlan({ payload: paymentMethodId }: PayloadAction<string>) {\n const { subscription, status, checkoutPlanId } = yield select(\n ({\n subscriptions: {\n billing: { information },\n checkout,\n },\n }: FronteggState) => ({\n subscription: information.subscription,\n status: checkout.status,\n checkoutPlanId: checkout.checkoutPlanId,\n })\n );\n const subscriptionId = subscription?.id;\n const subscriptionItemId = subscription?.items[0]?.id;\n if (!checkoutPlanId || !subscriptionId || !subscriptionItemId) {\n yield put(\n checkoutActions.setState({\n loading: false,\n status: CheckoutStatus.ERROR,\n })\n );\n return;\n }\n if (status === CheckoutStatus.CHECKOUT) {\n yield put(\n checkoutActions.setState({\n loading: true,\n error: null,\n })\n );\n try {\n yield call(api.subscriptions.updateSubscription, subscriptionId, {\n paymentMethodId,\n items: [\n {\n id: subscriptionItemId,\n planId: checkoutPlanId,\n },\n ],\n });\n\n yield put(\n checkoutActions.setState({\n checkoutPlanId: null,\n loading: false,\n status: CheckoutStatus.CONFIRM,\n })\n );\n yield put(checkoutActions.checkoutEvent(CheckoutEvent.CONFIRMED));\n } catch (e) {\n yield put(\n checkoutActions.setState({\n loading: false,\n error: e.message,\n status: CheckoutStatus.ERROR,\n })\n );\n yield put(checkoutActions.checkoutEvent(CheckoutEvent.ERROR));\n }\n }\n}\n\nfunction* cancelPlan() {\n const { status } = yield select((state: FronteggState) => state.subscriptions.checkout);\n if (status === CheckoutStatus.CHECKOUT) {\n yield put(\n checkoutActions.setState({\n checkoutPlanId: null,\n loading: false,\n error: null,\n status: CheckoutStatus.CANCEL,\n })\n );\n yield put(checkoutActions.checkoutEvent(CheckoutEvent.CANCEL));\n }\n}\n\n/**\n * Based on payment provider type\n */\nfunction* submitCheckout() {\n const { paymentProvider } = yield select((state: FronteggState) => state.subscriptions.config.config);\n if (paymentProvider === PaymentProvider.STRIPE) {\n yield put(\n checkoutActions.setState({\n loading: true,\n error: null,\n })\n );\n yield put(checkoutActions.checkoutEvent(CheckoutEvent.SUBMITTED));\n }\n}\n\nfunction* errorCheckout({ payload }: PayloadAction<string>) {\n yield put(\n checkoutActions.setState({\n loading: false,\n error: payload,\n status: CheckoutStatus.ERROR,\n })\n );\n yield put(checkoutActions.checkoutEvent(CheckoutEvent.ERROR));\n}\n","import { call, put, takeEvery } from 'redux-saga/effects';\nimport { plansActions } from './index';\nimport { api, IPlanResponse } from '@frontegg/rest-api';\n\nexport function* plansSagas() {\n yield takeEvery(plansActions.loadPlans, loadPlans);\n}\n\nfunction* loadPlans() {\n yield put(plansActions.setLoading(true));\n\n try {\n const products: IPlanResponse[] = yield call(api.subscriptions.getSubscriptionPlans);\n yield put(\n plansActions.setPlans(\n products.map((item) => ({\n id: item.id,\n name: item.name,\n description: item.description,\n price: +((item.price?.amount || 0) / 100).toFixed(2),\n currency: item.price?.currency || 'usd',\n recurringInterval: 'month',\n }))\n )\n );\n yield put(plansActions.setLoading(false));\n } catch (e) {\n yield put(plansActions.setError(e.message));\n }\n}\n","import { call, put, takeEvery } from 'redux-saga/effects';\nimport { configActions } from './index';\nimport {\n api,\n IPaymentProviderResponse,\n IStripePaymentProviderConfigurationResponse,\n ProviderType,\n} from '@frontegg/rest-api';\n\nexport function* configSagas() {\n yield takeEvery(configActions.loadPaymentConfiguration, loadPaymentConfiguration);\n}\n\nfunction* loadPaymentConfiguration() {\n yield put(configActions.setLoading(true));\n try {\n const response: IPaymentProviderResponse[] = yield call(api.subscriptions.getPaymentProviders) || [];\n const stripePaymentProvider = response.find(\n (paymentProvider) => paymentProvider.status === '1' && paymentProvider.providerType === ProviderType.Stripe\n );\n\n if (stripePaymentProvider) {\n yield loadStripePaymentConfiguration();\n } else {\n yield put(configActions.setError('Payment provider not configured'));\n }\n } catch (e) {\n yield put(configActions.setError(e.message));\n }\n}\n\nfunction* loadStripePaymentConfiguration() {\n yield put(configActions.setLoading(true));\n try {\n const response: IStripePaymentProviderConfigurationResponse = yield call(\n api.subscriptions.getStripePaymentProviderConfiguration\n );\n yield put(configActions.setStripePaymentProvider(response.publishableKey));\n yield put(configActions.setLoading(false));\n } catch (e) {\n yield put(configActions.setError(e.message));\n }\n}\n","import { all, call } from 'redux-saga/effects';\nimport { billingSagas } from './Billing/saga';\nimport { checkoutSagas } from './Checkout/saga';\nimport { plansSagas } from './Plans/saga';\nimport { configSagas } from './Config/saga';\nimport { subscriptionStripeSagas } from './Stripe/saga';\n\nexport function* sagas() {\n yield all([call(billingSagas), call(checkoutSagas), call(plansSagas), call(configSagas), call(subscriptionStripeSagas)]);\n}\n","import { WithCallback } from '../../../interfaces';\nimport { ISubscriptionUpdatePaymentMethodBillingDetails } from '@frontegg/rest-api';\n//TODO: consider use types from typescript-rest-api or duplicate them.\nexport type PaymentMethod = {\n id: string;\n type: 'card';\n externalId?: string;\n isDefault?: boolean;\n last4?: string;\n expMonth?: number;\n expYear?: number;\n brand?: string;\n billingDetails?: BillingDetailsResponse;\n};\n\nexport interface PaymentMethodState {\n loading: boolean;\n error: string | null;\n paymentMethod?: PaymentMethod;\n}\n\nexport interface PaymentMethodActions {\n loadPaymentMethod: () => void;\n updatePaymentMethodBillingDetails: (\n payload: WithCallback<ISubscriptionUpdatePaymentMethodBillingDetails & { id: string }>\n ) => void;\n setError: (error: string | null) => void;\n submitPaymentMethod: () => void;\n submitPaymentMethodError: (error: string) => void;\n submitPaymentMethodSuccess: () => void;\n}\n\nexport interface BillingDetailsResponse {\n name?: string;\n email?: string;\n address?: AddressResponse;\n}\n\nexport interface AddressResponse {\n addressLine1?: string;\n addressLine2?: string;\n city?: string;\n state?: string;\n postalCode?: string;\n country?: string;\n}\n\nexport enum PaymentMethodType {\n UNKNWON = 'unknown',\n CARD = 'card',\n}\n","// export store\n\nimport { subscriptionsStoreName as storeName } from '../constants';\nimport { actions, initialState, reducer } from './reducer';\nimport { sagas } from './saga';\n\nexport * from './interfaces';\n\nexport {\n sagas as subscriptionSagas,\n reducer as subscriptionReducers,\n actions as subscriptionActions,\n initialState as subscriptionInitialState,\n storeName as subscriptionsStoreName,\n};\n\n// export store\nexport default {\n sagas,\n reducer,\n actions,\n initialState,\n storeName,\n};\n"],"names":["_a","createSlice","subscriptionsStoreName","sliceActions","reducer","name","actions","createAction","PaymentProvider","SubscriptionStatus","SubscriptionCancellationPolicy","reducers","invoicesActions","informationActions","subscriptionsPaymentMethodActions","combineReducers","invoicesReducer","informationReducer","subscriptionsPaymentMethodReducer","CheckoutStatus","CheckoutEvent","configActions","plansActions","checkoutActions","stripeActions","configReducer","plansReducer","checkoutReducer","stripeReducer","takeEvery","select","put","call","api","FronteggApiError","ISubscriptionStatus","checkoutEvent","all","ProviderType","PaymentMethodType"],"mappings":";;;;;;;;;;SAYgB,wBAAwB;IACtC,OAAO;QACL,UAAU,EAAE;YACV,OAAO,EAAE,UAAC,OAAgB,IAAK,QAAC,EAAE,OAAO,SAAA,EAAE,IAAC;YAC5C,OAAO,EAAE,UAAC,KAAY,EAAE,MAA8B,IAAK,yDAAM,KAAK,KAAE,OAAO,EAAE,MAAM,CAAC,OAAO,MAAM,MAAM,CAAC,OAAO,GAAC,EAAC,KAAK,EAAE,IAAI,EAAC,GAAC,EAAE,MAAI;SACzI;QACD,QAAQ,EAAE;YACR,OAAO,EAAE,UAAC,OAAsB,IAAK,QAAC,EAAE,OAAO,SAAA,EAAE,IAAC;YAClD,OAAO,EAAE,UAAC,KAAY,EA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A,YAAI,CAAC,uBAAuB,CAAC,CAAC,CAAC,EAAA;;gBAAxH,SAAwH,CAAC;;;;;;ACuC/GO;AAAZ,WAAY,iBAAiB;IAC3B,wCAAmB,CAAA;IACnB,kCAAa,CAAA;AACf,CAAC,EAHWA,yBAAiB,KAAjBA,yBAAiB;;AC/C7B;AAgBA;AACA,yBAAe;IACb,KAAK,OAAA;IACL,OAAO,SAAA;IACP,OAAO,SAAA;IACP,YAAY,cAAA;IACZ,SAAS,kCAAA;CACV;;;;;;;;;"}
@@ -2,20 +2,24 @@ import { CheckoutActions, CheckoutState } from './Checkout/interfaces';
2
2
  import { BillingActions, BillingState } from './Billing/interfaces';
3
3
  import { PlansActions, PlansState } from './Plans/interfaces';
4
4
  import { PaymentProviderConfigActions, PaymentProviderConfigState } from './Config/interfaces';
5
+ import { StripeActions, StripeState } from './Stripe/interfaces';
5
6
  export interface SubscriptionsState {
6
7
  config: PaymentProviderConfigState;
7
8
  billing: BillingState;
8
9
  plans: PlansState;
9
10
  checkout: CheckoutState;
11
+ stripe: StripeState;
10
12
  }
11
13
  export declare type SubscriptionsActions = {
12
14
  config: PaymentProviderConfigActions;
13
15
  billing: BillingActions;
14
16
  plans: PlansActions;
15
17
  checkout: CheckoutActions;
18
+ stripe: StripeActions;
16
19
  };
17
20
  export * from './general.interfaces';
18
21
  export * from './Checkout/interfaces';
19
22
  export * from './Billing/interfaces';
20
23
  export * from './Plans/interfaces';
21
24
  export * from './Config/interfaces';
25
+ export * from './Stripe/interfaces';
@@ -6,13 +6,22 @@ declare const actions: {
6
6
  setStripePaymentProvider: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[string], string, string, never, never>;
7
7
  setLoading: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[boolean], boolean, string, never, never>;
8
8
  setError: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[string | null], string | null, string, never, never>;
9
+ setState: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[Partial<import("./interfaces").PaymentProviderConfigState>], Partial<import("./interfaces").PaymentProviderConfigState>, string, never, never>;
9
10
  loadPaymentConfiguration: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
10
11
  };
11
12
  billing: {
12
13
  invoices: {
13
14
  setInvoices: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("./general.interfaces").Invoice[]], import("./general.interfaces").Invoice[], string, never, never>;
15
+ setInvoiceDownloadState: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[{
16
+ loading: boolean;
17
+ error: string | null;
18
+ }], {
19
+ loading: boolean;
20
+ error: string | null;
21
+ }, string, never, never>;
14
22
  setLoading: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[boolean], boolean, string, never, never>;
15
23
  setError: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[string | null], string | null, string, never, never>;
24
+ setState: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[Partial<import("./interfaces").InvoicesState>], Partial<import("./interfaces").InvoicesState>, string, never, never>;
16
25
  loadInvoices: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
17
26
  downloadInvoice: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("./interfaces").DownloadInvoiceActionPayload], import("./interfaces").DownloadInvoiceActionPayload, string, never, never>;
18
27
  };
@@ -24,15 +33,19 @@ declare const actions: {
24
33
  setRenewalError: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[string | null], string | null, string, never, never>;
25
34
  setLoading: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[boolean], boolean, string, never, never>;
26
35
  setError: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[string | null], string | null, string, never, never>;
36
+ setState: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[Partial<import("./interfaces").BillingInformationState>], Partial<import("./interfaces").BillingInformationState>, string, never, never>;
27
37
  loadBillingInformation: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
28
38
  cancelSubscription: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
29
39
  renewSubscription: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
30
40
  };
31
41
  paymentMethod: {
32
- setPaymentMethod: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("./interfaces").PaymentMethod], import("./interfaces").PaymentMethod, string, never, never>;
42
+ setState: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[Partial<import("./interfaces").PaymentMethodState>], Partial<import("./interfaces").PaymentMethodState>, string, never, never>;
33
43
  setLoading: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[boolean], boolean, string, never, never>;
34
44
  setError: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[string | null], string | null, string, never, never>;
35
45
  loadPaymentMethod: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
46
+ submitPaymentMethod: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
47
+ submitPaymentMethodError: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, string>;
48
+ submitPaymentMethodSuccess: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
36
49
  updatePaymentMethodBillingDetails: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("../interfaces").WithCallback<import("@frontegg/rest-api").ISubscriptionUpdatePaymentMethodBillingDetails & {
37
50
  id: string;
38
51
  }, boolean>], import("../interfaces").WithCallback<import("@frontegg/rest-api").ISubscriptionUpdatePaymentMethodBillingDetails & {
@@ -44,28 +57,37 @@ declare const actions: {
44
57
  setPlans: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("./general.interfaces").Plan[]], import("./general.interfaces").Plan[], string, never, never>;
45
58
  setLoading: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[boolean], boolean, string, never, never>;
46
59
  setError: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[string | null], string | null, string, never, never>;
60
+ setState: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[Partial<import("./interfaces").PlansState>], Partial<import("./interfaces").PlansState>, string, never, never>;
47
61
  loadPlans: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
48
62
  };
49
63
  checkout: {
50
64
  setStatus: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("./interfaces").CheckoutStatus], import("./interfaces").CheckoutStatus, string, never, never>;
51
65
  selectPlan: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[string | null], string | null, string, never, never>;
52
- setStripeClientSecret: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[string | null], string | null, string, never, never>;
53
66
  setLoading: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[boolean], boolean, string, never, never>;
54
67
  setError: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[string | null], string | null, string, never, never>;
55
- loadCheckoutSecret: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
68
+ setState: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[Partial<import("./interfaces").CheckoutState>], Partial<import("./interfaces").CheckoutState>, string, never, never>;
56
69
  checkoutPlan: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[string], string, string, never, never>;
57
70
  resetCheckout: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
58
- confirmCheckout: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
71
+ confirmCheckout: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[string], string, string, never, never>;
59
72
  cancelCheckout: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
60
73
  submitCheckout: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
61
74
  errorCheckout: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[string], string, string, never, never>;
62
75
  checkoutEvent: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("./interfaces").CheckoutEvent], import("./interfaces").CheckoutEvent, string, never, never>;
63
76
  };
77
+ stripe: {
78
+ setStripeState: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[Partial<import("./interfaces").StripeState>], Partial<import("./interfaces").StripeState>, string, never, never>;
79
+ setLoading: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[boolean], boolean, string, never, never>;
80
+ setError: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[string | null], string | null, string, never, never>;
81
+ setState: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[Partial<import("./interfaces").StripeState>], Partial<import("./interfaces").StripeState>, string, never, never>;
82
+ loadCustomer: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
83
+ createCardSetupIntentSecret: import("@reduxjs/toolkit").ActionCreatorWithPayload<string | null, string>;
84
+ };
64
85
  };
65
86
  declare const reducer: import("redux").Reducer<import("redux").CombinedState<{
66
87
  config: import("./interfaces").PaymentProviderConfigState;
67
88
  billing: import("redux").CombinedState<import("./interfaces").BillingState>;
68
89
  plans: import("./interfaces").PlansState;
69
90
  checkout: import("./interfaces").CheckoutState;
91
+ stripe: import("./interfaces").StripeState;
70
92
  }>, import("redux").AnyAction>;
71
93
  export { subscriptionsStoreName as name, reducer, actions };
@@ -26,6 +26,12 @@ export declare function createModuleCaseReducers<State>(): {
26
26
  loading: boolean;
27
27
  };
28
28
  };
29
+ setState: {
30
+ prepare: (payload: Partial<State>) => {
31
+ payload: Partial<State>;
32
+ };
33
+ reducer: (state: State, action: PayloadAction<Partial<State>>) => State & Partial<State>;
34
+ };
29
35
  };
30
36
  export declare type RequiredReducer<State, Action extends AnyAction> = (state: State, action: Action) => State;
31
37
  export declare function createKeyCaseReducer<State, Key extends keyof State, Action extends AnyAction>(key: Key, setState: RequiredReducer<State[Key], Action>): {