@frontegg/redux-store 5.45.2 → 5.47.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +1 -1
- package/node/auth/index.js +1 -1
- package/node/{index-28ae5ca1.js → index-7ba717da.js} +0 -0
- package/node/index.js +1 -13
- package/node/subscriptions/index.js +51 -116
- package/node/toolkit/index.js +1 -1
- package/package.json +2 -2
- package/subscriptions/Billing/Information/saga.d.ts +23 -0
- package/subscriptions/Billing/Invoices/saga.d.ts +11 -0
- package/subscriptions/Billing/PaymentMethod/saga.d.ts +11 -0
- package/subscriptions/Checkout/index.d.ts +3 -7
- package/subscriptions/Checkout/interfaces.d.ts +8 -19
- package/subscriptions/index.d.ts +2 -6
- package/subscriptions/index.js +52 -117
- package/subscriptions/reducer.d.ts +2 -6
package/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { AcceptInvitationStep, ActivateAccountStep, ApiStateKeys, AuthenticationTypes, ForgotPasswordStep, LoginStep, MFAStep, ResetPhoneNumberStep, SSOStateKeys, SamlVendors, SignUpStage, TeamStateKeys, UserVeirifedOriginTypes, acceptInvitationActions, acceptInvitationReducers, acceptInvitationState, accountSettingsActions, accountSettingsReducers, accountSettingsState, activateAccountActions, activateAccountReducers, activateState, apiTokensActions, apiTokensReducers, apiTokensState, default as auth, authActions, authInitialState, authMockSagas, authReducers, authSagas, forgotPasswordActions, forgotPasswordReducers, forgotPasswordState, loginActions, loginReducers, loginState, mfaActions, mfaReducers, mfaState, profileActions, profileReducers, profileState, resetPhoneNumberActions, resetPhoneNumberReducers, resetPhoneNumberState, rolesActions, rolesReducers, rolesState, securityPolicyActions, securityPolicyReducers, securityPolicyState, signUpActions, signUpReducers, signUpState, socialLoginState, socialLoginsActions, socialLoginsReducer, ssoActions, ssoReducers, ssoState, teamActions, teamReducers, teamState, tenantsActions, tenantsReducers, tenantsState } from './auth/index.js';
|
|
2
2
|
export { auditLogsActions, auditLogsReducers, auditLogsState, default as audits, auditsActions, auditsInitialState, auditsMetadataActions, auditsMetadataReducers, auditsMetadataState, auditsMockSagas, auditsReducers, auditsSagas } from './audits/index.js';
|
|
3
3
|
export { default as connectivity, connectivityActions, connectivityInitialState, connectivityReducers, connectivitySagas } from './connectivity/index.js';
|
|
4
|
-
export {
|
|
4
|
+
export { PaymentMethodType, PaymentProvider, SubscriptionCancellationPolicy, SubscriptionStatus, subscriptionActions, subscriptionInitialState, subscriptionReducers, subscriptionSagas, subscriptionSagasMock, default as subscriptions } from './subscriptions/index.js';
|
|
5
5
|
export { default as vendor } from './vendor/index.js';
|
|
6
6
|
export { createFronteggStore } from './toolkit/index.js';
|
|
7
7
|
export { AuthStrategyEnum } from '@frontegg/rest-api';
|
package/node/auth/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var auth_index = require('../index-
|
|
5
|
+
var auth_index = require('../index-7ba717da.js');
|
|
6
6
|
var constants = require('../constants-52e37c08.js');
|
|
7
7
|
var restApi = require('@frontegg/rest-api');
|
|
8
8
|
require('@reduxjs/toolkit');
|
|
File without changes
|
package/node/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var auth_index = require('./index-
|
|
5
|
+
var auth_index = require('./index-7ba717da.js');
|
|
6
6
|
var audits_index = require('./audits/index.js');
|
|
7
7
|
var connectivity_index = require('./connectivity/index.js');
|
|
8
8
|
var subscriptions_index = require('./subscriptions/index.js');
|
|
@@ -172,18 +172,6 @@ exports.connectivityActions = connectivity_index.connectivityActions;
|
|
|
172
172
|
exports.connectivityInitialState = connectivity_index.connectivityInitialState;
|
|
173
173
|
exports.connectivityReducers = connectivity_index.connectivityReducers;
|
|
174
174
|
exports.connectivitySagas = connectivity_index.connectivitySagas;
|
|
175
|
-
Object.defineProperty(exports, 'CheckoutEvent', {
|
|
176
|
-
enumerable: true,
|
|
177
|
-
get: function () {
|
|
178
|
-
return subscriptions_index.CheckoutEvent;
|
|
179
|
-
}
|
|
180
|
-
});
|
|
181
|
-
Object.defineProperty(exports, 'CheckoutStatus', {
|
|
182
|
-
enumerable: true,
|
|
183
|
-
get: function () {
|
|
184
|
-
return subscriptions_index.CheckoutStatus;
|
|
185
|
-
}
|
|
186
|
-
});
|
|
187
175
|
Object.defineProperty(exports, 'PaymentMethodType', {
|
|
188
176
|
enumerable: true,
|
|
189
177
|
get: function () {
|
|
@@ -153,42 +153,19 @@ const billingReducer = toolkit.combineReducers({
|
|
|
153
153
|
subscription: reducer$6,
|
|
154
154
|
});
|
|
155
155
|
|
|
156
|
-
exports.CheckoutStatus = void 0;
|
|
157
|
-
(function (CheckoutStatus) {
|
|
158
|
-
CheckoutStatus["SELECTION"] = "SELECTION";
|
|
159
|
-
CheckoutStatus["CHECKOUT"] = "CHECKOUT";
|
|
160
|
-
CheckoutStatus["CONFIRM"] = "CONFIRM";
|
|
161
|
-
CheckoutStatus["ERROR"] = "ERROR";
|
|
162
|
-
CheckoutStatus["CANCEL"] = "CANCEL";
|
|
163
|
-
})(exports.CheckoutStatus || (exports.CheckoutStatus = {}));
|
|
164
|
-
exports.CheckoutEvent = void 0;
|
|
165
|
-
(function (CheckoutEvent) {
|
|
166
|
-
CheckoutEvent["SUBMITTED"] = "SUBMITTED";
|
|
167
|
-
CheckoutEvent["ABORT"] = "ABORT";
|
|
168
|
-
CheckoutEvent["CANCEL"] = "CANCEL";
|
|
169
|
-
CheckoutEvent["ERROR"] = "ERROR";
|
|
170
|
-
CheckoutEvent["CONFIRMED"] = "CONFIRMED";
|
|
171
|
-
})(exports.CheckoutEvent || (exports.CheckoutEvent = {}));
|
|
172
|
-
|
|
173
156
|
const checkoutInitialState = {
|
|
157
|
+
fetching: true,
|
|
174
158
|
loading: false,
|
|
175
159
|
error: null,
|
|
176
|
-
|
|
177
|
-
checkoutPlanId: null,
|
|
160
|
+
confirmed: false,
|
|
178
161
|
};
|
|
179
|
-
const reducers$1 = Object.assign(
|
|
180
|
-
prepare: (payload) => ({ payload }),
|
|
181
|
-
reducer: (state, action) => (Object.assign(Object.assign({}, state), { status: action.payload })),
|
|
182
|
-
}, selectPlan: {
|
|
183
|
-
prepare: (payload) => ({ payload }),
|
|
184
|
-
reducer: (state, action) => (Object.assign(Object.assign({}, state), { checkoutPlanId: action.payload })),
|
|
185
|
-
} });
|
|
162
|
+
const reducers$1 = Object.assign({}, createModuleCaseReducers());
|
|
186
163
|
const { actions: checkoutActions, reducer: reducer$2, name: name$1 } = toolkit.createSlice({
|
|
187
164
|
name: `${constants.subscriptionsStoreName}/checkout`,
|
|
188
165
|
initialState: checkoutInitialState,
|
|
189
166
|
reducers: reducers$1,
|
|
190
167
|
});
|
|
191
|
-
const actions$2 = Object.assign({
|
|
168
|
+
const actions$2 = Object.assign({ loadCheckout: toolkit.createAction(`${name$1}/loadCheckout`), resetCheckout: toolkit.createAction(`${name$1}/resetCheckout`), submitCheckout: toolkit.createAction(`${name$1}/submitCheckout`), confirmCheckout: toolkit.createAction(`${name$1}/confirmCheckout`, (payload) => ({ payload })), errorCheckout: toolkit.createAction(`${name$1}/errorCheckout`, (payload) => ({ payload })) }, checkoutActions);
|
|
192
169
|
|
|
193
170
|
const initialSubscriptionStripeState = {
|
|
194
171
|
loading: false,
|
|
@@ -450,7 +427,6 @@ function* subscriptionSagasMock() {
|
|
|
450
427
|
|
|
451
428
|
function* subscriptionBillingInformationSagas() {
|
|
452
429
|
yield effects.takeEvery(actions$5.loadBillingInformation, loadBillingInformation);
|
|
453
|
-
yield effects.takeEvery(actions$2.checkoutEvent, checkoutEvent$2);
|
|
454
430
|
}
|
|
455
431
|
function* loadBillingInformation() {
|
|
456
432
|
yield loadBillingInformationAction(false);
|
|
@@ -512,11 +488,6 @@ function* loadSummaries(tenantId, forceActive) {
|
|
|
512
488
|
yield effects.put(actions$5.setError(e.message));
|
|
513
489
|
}
|
|
514
490
|
}
|
|
515
|
-
function* checkoutEvent$2({ payload }) {
|
|
516
|
-
if (payload === exports.CheckoutEvent.CONFIRMED) {
|
|
517
|
-
yield loadBillingInformationAction(true);
|
|
518
|
-
}
|
|
519
|
-
}
|
|
520
491
|
/*********************************
|
|
521
492
|
* Preview Sagas
|
|
522
493
|
*********************************/
|
|
@@ -552,7 +523,6 @@ function* subscriptionsPaymentMethodSagas() {
|
|
|
552
523
|
yield effects.takeEvery(actions$4.submitPaymentMethodError, submitPaymentMethodError);
|
|
553
524
|
yield effects.takeEvery(actions$4.submitPaymentMethodSuccess, submitPaymentMethodSuccess);
|
|
554
525
|
yield effects.takeEvery(actions$4.updatePaymentMethodBillingDetails, updateBillingDetails);
|
|
555
|
-
yield effects.takeEvery(actions$2.checkoutEvent, checkoutEvent$1);
|
|
556
526
|
}
|
|
557
527
|
function* loadPaymentMethod() {
|
|
558
528
|
yield effects.put(actions$4.setLoading(true));
|
|
@@ -569,11 +539,6 @@ function* loadPaymentMethod() {
|
|
|
569
539
|
yield effects.put(actions$4.setError(e.message));
|
|
570
540
|
}
|
|
571
541
|
}
|
|
572
|
-
function* checkoutEvent$1({ payload }) {
|
|
573
|
-
if (payload === exports.CheckoutEvent.CONFIRMED) {
|
|
574
|
-
yield loadPaymentMethod();
|
|
575
|
-
}
|
|
576
|
-
}
|
|
577
542
|
function* updateBillingDetails({ payload, }) {
|
|
578
543
|
yield effects.put(actions$4.setLoading(true));
|
|
579
544
|
const { id, email, address, callback } = payload;
|
|
@@ -617,7 +582,6 @@ function* subscriptionsPaymentMethodSagasMock() {
|
|
|
617
582
|
function* subscriptionInvoicesSagas() {
|
|
618
583
|
yield effects.takeEvery(actions$3.loadInvoices, loadInvoices);
|
|
619
584
|
yield effects.takeEvery(actions$3.downloadInvoice, downloadInvoice);
|
|
620
|
-
yield effects.takeEvery(actions$2.checkoutEvent, checkoutEvent);
|
|
621
585
|
}
|
|
622
586
|
function* loadInvoices() {
|
|
623
587
|
yield effects.put(actions$3.setLoading(true));
|
|
@@ -653,11 +617,6 @@ function* downloadInvoice({ payload }) {
|
|
|
653
617
|
yield effects.put(actions$3.setInvoiceDownloadState({ loading: false, error: e.message || null }));
|
|
654
618
|
}
|
|
655
619
|
}
|
|
656
|
-
function* checkoutEvent({ payload }) {
|
|
657
|
-
if (payload === exports.CheckoutEvent.CONFIRMED) {
|
|
658
|
-
yield loadInvoices();
|
|
659
|
-
}
|
|
660
|
-
}
|
|
661
620
|
/*********************************
|
|
662
621
|
* Preview Sagas
|
|
663
622
|
*********************************/
|
|
@@ -694,120 +653,96 @@ function* billingSagasMock() {
|
|
|
694
653
|
}
|
|
695
654
|
|
|
696
655
|
function* checkoutSagas() {
|
|
697
|
-
yield effects.takeEvery(actions$2.
|
|
656
|
+
yield effects.takeEvery(actions$2.loadCheckout, loadCheckout);
|
|
698
657
|
yield effects.takeEvery(actions$2.resetCheckout, resetCheckout);
|
|
699
|
-
yield effects.takeEvery(actions$2.confirmCheckout, confirmPlan);
|
|
700
|
-
yield effects.takeEvery(actions$2.cancelCheckout, cancelPlan);
|
|
701
658
|
yield effects.takeEvery(actions$2.submitCheckout, submitCheckout);
|
|
659
|
+
yield effects.takeEvery(actions$2.confirmCheckout, confirmPlan);
|
|
702
660
|
yield effects.takeEvery(actions$2.errorCheckout, errorCheckout);
|
|
703
661
|
}
|
|
704
|
-
function*
|
|
662
|
+
function* loadCheckout() {
|
|
705
663
|
yield effects.put(actions$2.setState({
|
|
706
|
-
|
|
664
|
+
fetching: false,
|
|
707
665
|
loading: false,
|
|
708
666
|
error: null,
|
|
709
|
-
|
|
667
|
+
confirmed: false,
|
|
710
668
|
}));
|
|
711
669
|
}
|
|
712
670
|
function* resetCheckout() {
|
|
713
671
|
yield effects.put(actions$2.setState({
|
|
714
|
-
checkoutPlanId: null,
|
|
715
672
|
loading: false,
|
|
716
|
-
|
|
673
|
+
error: null,
|
|
674
|
+
confirmed: false,
|
|
717
675
|
}));
|
|
718
676
|
}
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
677
|
+
/**
|
|
678
|
+
* Based on payment provider type
|
|
679
|
+
*/
|
|
680
|
+
function* submitCheckout() {
|
|
681
|
+
yield effects.put(actions$2.setState({
|
|
682
|
+
loading: true,
|
|
683
|
+
error: null,
|
|
724
684
|
}));
|
|
725
|
-
|
|
685
|
+
}
|
|
686
|
+
function* confirmPlan({ payload: { paymentMethodId, planId } }) {
|
|
687
|
+
const subscription = yield effects.select((state) => state.subscriptions.billing.subscription.subscription);
|
|
688
|
+
const summary = yield effects.select((state) => state.subscriptions.billing.information.summary);
|
|
689
|
+
const isTrialing = (subscription === null || subscription === void 0 ? void 0 : subscription.status) === exports.SubscriptionStatus.TRIALING;
|
|
726
690
|
const hasPaymentMethod = !!(summary === null || summary === void 0 ? void 0 : summary.paymentMethodId);
|
|
727
|
-
if (!
|
|
691
|
+
if (!subscription) {
|
|
728
692
|
yield effects.put(actions$2.setState({
|
|
729
693
|
loading: false,
|
|
730
|
-
|
|
694
|
+
error: 'Subscription not found',
|
|
731
695
|
}));
|
|
732
696
|
return;
|
|
733
697
|
}
|
|
698
|
+
yield effects.put(actions$2.setState({
|
|
699
|
+
loading: true,
|
|
700
|
+
error: null,
|
|
701
|
+
}));
|
|
734
702
|
if (isTrialing && hasPaymentMethod) {
|
|
735
|
-
yield
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
status: exports.CheckoutStatus.CONFIRM,
|
|
703
|
+
yield confirmCheckout();
|
|
704
|
+
yield effects.put(actions$6.setState({
|
|
705
|
+
subscription: Object.assign(Object.assign({}, subscription), { status: restApi.ISubscriptionStatus.ACTIVE }),
|
|
739
706
|
}));
|
|
740
|
-
yield loadSubscription();
|
|
741
|
-
yield effects.put(actions$2.checkoutEvent(exports.CheckoutEvent.CONFIRMED));
|
|
742
707
|
return;
|
|
743
708
|
}
|
|
744
|
-
|
|
745
|
-
yield effects.
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
})
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
checkoutPlanId: null,
|
|
756
|
-
loading: false,
|
|
757
|
-
status: exports.CheckoutStatus.CONFIRM,
|
|
758
|
-
}));
|
|
759
|
-
yield effects.put(actions$2.checkoutEvent(exports.CheckoutEvent.CONFIRMED));
|
|
760
|
-
}
|
|
761
|
-
catch (e) {
|
|
762
|
-
yield effects.put(actions$2.setState({
|
|
763
|
-
loading: false,
|
|
764
|
-
error: e.message,
|
|
765
|
-
status: exports.CheckoutStatus.ERROR,
|
|
766
|
-
}));
|
|
767
|
-
yield effects.put(actions$2.checkoutEvent(exports.CheckoutEvent.ERROR));
|
|
768
|
-
}
|
|
709
|
+
try {
|
|
710
|
+
yield effects.call(restApi.api.subscriptions.updateManagedSubscription, subscription.id, {
|
|
711
|
+
paymentMethodId,
|
|
712
|
+
planId,
|
|
713
|
+
});
|
|
714
|
+
yield effects.all([
|
|
715
|
+
loadBillingInformation(),
|
|
716
|
+
loadPaymentMethod(),
|
|
717
|
+
loadInvoices(),
|
|
718
|
+
]);
|
|
719
|
+
yield confirmCheckout();
|
|
769
720
|
}
|
|
770
|
-
|
|
771
|
-
function* cancelPlan() {
|
|
772
|
-
const { status } = yield effects.select((state) => state.subscriptions.checkout);
|
|
773
|
-
if (status === exports.CheckoutStatus.CHECKOUT) {
|
|
721
|
+
catch (e) {
|
|
774
722
|
yield effects.put(actions$2.setState({
|
|
775
|
-
checkoutPlanId: null,
|
|
776
723
|
loading: false,
|
|
777
|
-
error:
|
|
778
|
-
status: exports.CheckoutStatus.CANCEL,
|
|
724
|
+
error: e.message,
|
|
779
725
|
}));
|
|
780
|
-
yield effects.put(actions$2.checkoutEvent(exports.CheckoutEvent.CANCEL));
|
|
781
726
|
}
|
|
782
727
|
}
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
yield effects.put(actions$2.setState({
|
|
790
|
-
loading: true,
|
|
791
|
-
error: null,
|
|
792
|
-
}));
|
|
793
|
-
yield effects.put(actions$2.checkoutEvent(exports.CheckoutEvent.SUBMITTED));
|
|
794
|
-
}
|
|
728
|
+
function* confirmCheckout() {
|
|
729
|
+
yield effects.put(actions$2.setState({
|
|
730
|
+
loading: false,
|
|
731
|
+
error: null,
|
|
732
|
+
confirmed: true,
|
|
733
|
+
}));
|
|
795
734
|
}
|
|
796
735
|
function* errorCheckout({ payload }) {
|
|
797
736
|
yield effects.put(actions$2.setState({
|
|
798
737
|
loading: false,
|
|
799
738
|
error: payload,
|
|
800
|
-
status: exports.CheckoutStatus.ERROR,
|
|
801
739
|
}));
|
|
802
|
-
yield effects.put(actions$2.checkoutEvent(exports.CheckoutEvent.ERROR));
|
|
803
740
|
}
|
|
804
741
|
/*********************************
|
|
805
742
|
* Preview Sagas
|
|
806
743
|
*********************************/
|
|
807
744
|
function* checkoutSagasMock() {
|
|
808
|
-
yield effects.takeEvery(actions$2.checkoutPlan, checkoutPlan);
|
|
809
745
|
yield effects.takeEvery(actions$2.resetCheckout, resetCheckout);
|
|
810
|
-
yield effects.takeEvery(actions$2.cancelCheckout, cancelPlan);
|
|
811
746
|
}
|
|
812
747
|
|
|
813
748
|
function* plansSagas() {
|
package/node/toolkit/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var auth_index = require('../index-
|
|
5
|
+
var auth_index = require('../index-7ba717da.js');
|
|
6
6
|
var toolkit = require('@reduxjs/toolkit');
|
|
7
7
|
var createSagaMiddleware = require('redux-saga');
|
|
8
8
|
var effects = require('redux-saga/effects');
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frontegg/redux-store",
|
|
3
3
|
"libName": "FronteggReduxStore",
|
|
4
|
-
"version": "5.
|
|
4
|
+
"version": "5.47.0",
|
|
5
5
|
"author": "Frontegg LTD",
|
|
6
6
|
"main": "./node/index.js",
|
|
7
7
|
"module": "./index.js",
|
|
8
8
|
"types": "./index.d.ts",
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@frontegg/rest-api": "2.10.
|
|
10
|
+
"@frontegg/rest-api": "2.10.65",
|
|
11
11
|
"@reduxjs/toolkit": "^1.5.0",
|
|
12
12
|
"redux-saga": "^1.1.0",
|
|
13
13
|
"tslib": "^2.3.1",
|
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
import { IPlanResponse, ISubscriptionResponse, ISubscriptionSummariesResponse } from '@frontegg/rest-api';
|
|
2
|
+
import { PaymentProvider } from '../../general.interfaces';
|
|
2
3
|
export declare function subscriptionBillingInformationSagas(): Generator<import("redux-saga/effects").ForkEffect<never>, void, unknown>;
|
|
4
|
+
export declare function loadBillingInformation(): Generator<Generator<import("redux-saga/effects").SelectEffect | import("redux-saga/effects").PutEffect<{
|
|
5
|
+
payload: string | null;
|
|
6
|
+
type: string;
|
|
7
|
+
}> | Generator<import("redux-saga/effects").SelectEffect | import("redux-saga/effects").PutEffect<{
|
|
8
|
+
payload: string | null;
|
|
9
|
+
type: string;
|
|
10
|
+
}> | import("redux-saga/effects").PutEffect<{
|
|
11
|
+
payload: boolean;
|
|
12
|
+
type: string;
|
|
13
|
+
}> | import("redux-saga/effects").CallEffect<ISubscriptionSummariesResponse> | Generator<import("redux-saga/effects").PutEffect<{
|
|
14
|
+
payload: string | null;
|
|
15
|
+
type: string;
|
|
16
|
+
}> | import("redux-saga/effects").PutEffect<{
|
|
17
|
+
payload: boolean;
|
|
18
|
+
type: string;
|
|
19
|
+
}> | import("redux-saga/effects").CallEffect<ISubscriptionResponse[]> | import("redux-saga/effects").PutEffect<{
|
|
20
|
+
payload: Partial<import("../Subscription/interfaces").SubscriptionState>;
|
|
21
|
+
type: string;
|
|
22
|
+
}>, void, [any]> | import("redux-saga/effects").CallEffect<IPlanResponse[]> | import("redux-saga/effects").AllEffect<any> | import("redux-saga/effects").PutEffect<{
|
|
23
|
+
payload: Partial<import("./interfaces").BillingInformationState>;
|
|
24
|
+
type: string;
|
|
25
|
+
}>, void, any>, void, PaymentProvider>, void, unknown>;
|
|
3
26
|
export declare function loadSummaries(tenantId: string, forceActive?: boolean): Generator<import("redux-saga/effects").SelectEffect | import("redux-saga/effects").PutEffect<{
|
|
4
27
|
payload: string | null;
|
|
5
28
|
type: string;
|
|
@@ -1,2 +1,13 @@
|
|
|
1
|
+
import { ISubscriptionInvoiceResponse } from '@frontegg/rest-api';
|
|
1
2
|
export declare function subscriptionInvoicesSagas(): Generator<import("redux-saga/effects").ForkEffect<never>, void, unknown>;
|
|
3
|
+
export declare function loadInvoices(): Generator<import("redux-saga/effects").PutEffect<{
|
|
4
|
+
payload: boolean;
|
|
5
|
+
type: string;
|
|
6
|
+
}> | import("redux-saga/effects").CallEffect<ISubscriptionInvoiceResponse[]> | import("redux-saga/effects").PutEffect<{
|
|
7
|
+
payload: Partial<import("./interfaces").InvoicesState>;
|
|
8
|
+
type: string;
|
|
9
|
+
}> | import("redux-saga/effects").PutEffect<{
|
|
10
|
+
payload: string | null;
|
|
11
|
+
type: string;
|
|
12
|
+
}>, void, ISubscriptionInvoiceResponse[]>;
|
|
2
13
|
export declare function subscriptionInvoicesSagasMock(): Generator<import("redux-saga/effects").ForkEffect<never>, void, unknown>;
|
|
@@ -1,2 +1,13 @@
|
|
|
1
|
+
import { ISubscriptionPaymentMethodCardResponse } from '@frontegg/rest-api';
|
|
1
2
|
export declare function subscriptionsPaymentMethodSagas(): Generator<import("redux-saga/effects").ForkEffect<never>, void, unknown>;
|
|
3
|
+
export declare function loadPaymentMethod(): Generator<import("redux-saga/effects").PutEffect<{
|
|
4
|
+
payload: boolean;
|
|
5
|
+
type: string;
|
|
6
|
+
}> | import("redux-saga/effects").CallEffect<import("@frontegg/rest-api").ISubscriptionPaymentMethodResponse[]> | import("redux-saga/effects").PutEffect<{
|
|
7
|
+
payload: Partial<import("./interfaces").PaymentMethodState>;
|
|
8
|
+
type: string;
|
|
9
|
+
}> | import("redux-saga/effects").PutEffect<{
|
|
10
|
+
payload: string | null;
|
|
11
|
+
type: string;
|
|
12
|
+
}>, void, ISubscriptionPaymentMethodCardResponse[]>;
|
|
2
13
|
export declare function subscriptionsPaymentMethodSagasMock(): Generator<import("redux-saga/effects").ForkEffect<never>, void, unknown>;
|
|
@@ -1,18 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CheckoutState, ConfirmCheckoutActionPayload } from './interfaces';
|
|
2
2
|
export declare const checkoutInitialState: CheckoutState;
|
|
3
3
|
declare const reducer: import("redux").Reducer<CheckoutState, import("redux").AnyAction>;
|
|
4
4
|
declare const actions: {
|
|
5
|
-
setStatus: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[CheckoutStatus], CheckoutStatus, string, never, never>;
|
|
6
|
-
selectPlan: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[string | null], string | null, string, never, never>;
|
|
7
5
|
setLoading: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[boolean], boolean, string, never, never>;
|
|
8
6
|
setError: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[string | null], string | null, string, never, never>;
|
|
9
7
|
setState: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[Partial<CheckoutState>], Partial<CheckoutState>, string, never, never>;
|
|
10
|
-
|
|
8
|
+
loadCheckout: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
11
9
|
resetCheckout: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
12
|
-
confirmCheckout: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[string], string, string, never, never>;
|
|
13
|
-
cancelCheckout: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
14
10
|
submitCheckout: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
11
|
+
confirmCheckout: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[ConfirmCheckoutActionPayload], ConfirmCheckoutActionPayload, string, never, never>;
|
|
15
12
|
errorCheckout: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[string], string, string, never, never>;
|
|
16
|
-
checkoutEvent: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[CheckoutEvent], CheckoutEvent, string, never, never>;
|
|
17
13
|
};
|
|
18
14
|
export { reducer as checkoutReducer, actions as checkoutActions };
|
|
@@ -1,28 +1,17 @@
|
|
|
1
|
-
export declare enum CheckoutStatus {
|
|
2
|
-
SELECTION = "SELECTION",
|
|
3
|
-
CHECKOUT = "CHECKOUT",
|
|
4
|
-
CONFIRM = "CONFIRM",
|
|
5
|
-
ERROR = "ERROR",
|
|
6
|
-
CANCEL = "CANCEL"
|
|
7
|
-
}
|
|
8
1
|
export interface CheckoutState {
|
|
2
|
+
fetching: boolean;
|
|
9
3
|
loading: boolean;
|
|
10
4
|
error: string | null;
|
|
11
|
-
|
|
12
|
-
checkoutPlanId: string | null;
|
|
13
|
-
}
|
|
14
|
-
export declare enum CheckoutEvent {
|
|
15
|
-
SUBMITTED = "SUBMITTED",
|
|
16
|
-
ABORT = "ABORT",
|
|
17
|
-
CANCEL = "CANCEL",
|
|
18
|
-
ERROR = "ERROR",
|
|
19
|
-
CONFIRMED = "CONFIRMED"
|
|
5
|
+
confirmed: boolean;
|
|
20
6
|
}
|
|
21
7
|
export interface CheckoutActions {
|
|
22
|
-
|
|
8
|
+
loadCheckout: () => void;
|
|
23
9
|
resetCheckout: () => void;
|
|
24
|
-
confirmCheckout: (paymentMethodId: string) => void;
|
|
25
|
-
cancelCheckout: () => void;
|
|
26
10
|
submitCheckout: () => void;
|
|
11
|
+
confirmCheckout: (payload: ConfirmCheckoutActionPayload) => void;
|
|
27
12
|
errorCheckout: (error: string) => void;
|
|
28
13
|
}
|
|
14
|
+
export interface ConfirmCheckoutActionPayload {
|
|
15
|
+
paymentMethodId: string;
|
|
16
|
+
planId: string;
|
|
17
|
+
}
|
package/subscriptions/index.d.ts
CHANGED
|
@@ -77,18 +77,14 @@ declare const _default: {
|
|
|
77
77
|
loadPlans: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
78
78
|
};
|
|
79
79
|
checkout: {
|
|
80
|
-
setStatus: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("./interfaces").CheckoutStatus], import("./interfaces").CheckoutStatus, string, never, never>;
|
|
81
|
-
selectPlan: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[string | null], string | null, string, never, never>;
|
|
82
80
|
setLoading: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[boolean], boolean, string, never, never>;
|
|
83
81
|
setError: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[string | null], string | null, string, never, never>;
|
|
84
82
|
setState: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[Partial<import("./interfaces").CheckoutState>], Partial<import("./interfaces").CheckoutState>, string, never, never>;
|
|
85
|
-
|
|
83
|
+
loadCheckout: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
86
84
|
resetCheckout: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
87
|
-
confirmCheckout: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[string], string, string, never, never>;
|
|
88
|
-
cancelCheckout: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
89
85
|
submitCheckout: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
86
|
+
confirmCheckout: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("./interfaces").ConfirmCheckoutActionPayload], import("./interfaces").ConfirmCheckoutActionPayload, string, never, never>;
|
|
90
87
|
errorCheckout: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[string], string, string, never, never>;
|
|
91
|
-
checkoutEvent: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("./interfaces").CheckoutEvent], import("./interfaces").CheckoutEvent, string, never, never>;
|
|
92
88
|
};
|
|
93
89
|
stripe: {
|
|
94
90
|
setLoading: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[boolean], boolean, string, never, never>;
|
package/subscriptions/index.js
CHANGED
|
@@ -150,42 +150,19 @@ const billingReducer = combineReducers({
|
|
|
150
150
|
subscription: reducer$6,
|
|
151
151
|
});
|
|
152
152
|
|
|
153
|
-
var CheckoutStatus;
|
|
154
|
-
(function (CheckoutStatus) {
|
|
155
|
-
CheckoutStatus["SELECTION"] = "SELECTION";
|
|
156
|
-
CheckoutStatus["CHECKOUT"] = "CHECKOUT";
|
|
157
|
-
CheckoutStatus["CONFIRM"] = "CONFIRM";
|
|
158
|
-
CheckoutStatus["ERROR"] = "ERROR";
|
|
159
|
-
CheckoutStatus["CANCEL"] = "CANCEL";
|
|
160
|
-
})(CheckoutStatus || (CheckoutStatus = {}));
|
|
161
|
-
var CheckoutEvent;
|
|
162
|
-
(function (CheckoutEvent) {
|
|
163
|
-
CheckoutEvent["SUBMITTED"] = "SUBMITTED";
|
|
164
|
-
CheckoutEvent["ABORT"] = "ABORT";
|
|
165
|
-
CheckoutEvent["CANCEL"] = "CANCEL";
|
|
166
|
-
CheckoutEvent["ERROR"] = "ERROR";
|
|
167
|
-
CheckoutEvent["CONFIRMED"] = "CONFIRMED";
|
|
168
|
-
})(CheckoutEvent || (CheckoutEvent = {}));
|
|
169
|
-
|
|
170
153
|
const checkoutInitialState = {
|
|
154
|
+
fetching: true,
|
|
171
155
|
loading: false,
|
|
172
156
|
error: null,
|
|
173
|
-
|
|
174
|
-
checkoutPlanId: null,
|
|
157
|
+
confirmed: false,
|
|
175
158
|
};
|
|
176
|
-
const reducers$1 = Object.assign(
|
|
177
|
-
prepare: (payload) => ({ payload }),
|
|
178
|
-
reducer: (state, action) => (Object.assign(Object.assign({}, state), { status: action.payload })),
|
|
179
|
-
}, selectPlan: {
|
|
180
|
-
prepare: (payload) => ({ payload }),
|
|
181
|
-
reducer: (state, action) => (Object.assign(Object.assign({}, state), { checkoutPlanId: action.payload })),
|
|
182
|
-
} });
|
|
159
|
+
const reducers$1 = Object.assign({}, createModuleCaseReducers());
|
|
183
160
|
const { actions: checkoutActions, reducer: reducer$2, name: name$1 } = createSlice({
|
|
184
161
|
name: `${subscriptionsStoreName}/checkout`,
|
|
185
162
|
initialState: checkoutInitialState,
|
|
186
163
|
reducers: reducers$1,
|
|
187
164
|
});
|
|
188
|
-
const actions$2 = Object.assign({
|
|
165
|
+
const actions$2 = Object.assign({ loadCheckout: createAction(`${name$1}/loadCheckout`), resetCheckout: createAction(`${name$1}/resetCheckout`), submitCheckout: createAction(`${name$1}/submitCheckout`), confirmCheckout: createAction(`${name$1}/confirmCheckout`, (payload) => ({ payload })), errorCheckout: createAction(`${name$1}/errorCheckout`, (payload) => ({ payload })) }, checkoutActions);
|
|
189
166
|
|
|
190
167
|
const initialSubscriptionStripeState = {
|
|
191
168
|
loading: false,
|
|
@@ -447,7 +424,6 @@ function* subscriptionSagasMock() {
|
|
|
447
424
|
|
|
448
425
|
function* subscriptionBillingInformationSagas() {
|
|
449
426
|
yield takeEvery(actions$5.loadBillingInformation, loadBillingInformation);
|
|
450
|
-
yield takeEvery(actions$2.checkoutEvent, checkoutEvent$2);
|
|
451
427
|
}
|
|
452
428
|
function* loadBillingInformation() {
|
|
453
429
|
yield loadBillingInformationAction(false);
|
|
@@ -509,11 +485,6 @@ function* loadSummaries(tenantId, forceActive) {
|
|
|
509
485
|
yield put(actions$5.setError(e.message));
|
|
510
486
|
}
|
|
511
487
|
}
|
|
512
|
-
function* checkoutEvent$2({ payload }) {
|
|
513
|
-
if (payload === CheckoutEvent.CONFIRMED) {
|
|
514
|
-
yield loadBillingInformationAction(true);
|
|
515
|
-
}
|
|
516
|
-
}
|
|
517
488
|
/*********************************
|
|
518
489
|
* Preview Sagas
|
|
519
490
|
*********************************/
|
|
@@ -549,7 +520,6 @@ function* subscriptionsPaymentMethodSagas() {
|
|
|
549
520
|
yield takeEvery(actions$4.submitPaymentMethodError, submitPaymentMethodError);
|
|
550
521
|
yield takeEvery(actions$4.submitPaymentMethodSuccess, submitPaymentMethodSuccess);
|
|
551
522
|
yield takeEvery(actions$4.updatePaymentMethodBillingDetails, updateBillingDetails);
|
|
552
|
-
yield takeEvery(actions$2.checkoutEvent, checkoutEvent$1);
|
|
553
523
|
}
|
|
554
524
|
function* loadPaymentMethod() {
|
|
555
525
|
yield put(actions$4.setLoading(true));
|
|
@@ -566,11 +536,6 @@ function* loadPaymentMethod() {
|
|
|
566
536
|
yield put(actions$4.setError(e.message));
|
|
567
537
|
}
|
|
568
538
|
}
|
|
569
|
-
function* checkoutEvent$1({ payload }) {
|
|
570
|
-
if (payload === CheckoutEvent.CONFIRMED) {
|
|
571
|
-
yield loadPaymentMethod();
|
|
572
|
-
}
|
|
573
|
-
}
|
|
574
539
|
function* updateBillingDetails({ payload, }) {
|
|
575
540
|
yield put(actions$4.setLoading(true));
|
|
576
541
|
const { id, email, address, callback } = payload;
|
|
@@ -614,7 +579,6 @@ function* subscriptionsPaymentMethodSagasMock() {
|
|
|
614
579
|
function* subscriptionInvoicesSagas() {
|
|
615
580
|
yield takeEvery(actions$3.loadInvoices, loadInvoices);
|
|
616
581
|
yield takeEvery(actions$3.downloadInvoice, downloadInvoice);
|
|
617
|
-
yield takeEvery(actions$2.checkoutEvent, checkoutEvent);
|
|
618
582
|
}
|
|
619
583
|
function* loadInvoices() {
|
|
620
584
|
yield put(actions$3.setLoading(true));
|
|
@@ -650,11 +614,6 @@ function* downloadInvoice({ payload }) {
|
|
|
650
614
|
yield put(actions$3.setInvoiceDownloadState({ loading: false, error: e.message || null }));
|
|
651
615
|
}
|
|
652
616
|
}
|
|
653
|
-
function* checkoutEvent({ payload }) {
|
|
654
|
-
if (payload === CheckoutEvent.CONFIRMED) {
|
|
655
|
-
yield loadInvoices();
|
|
656
|
-
}
|
|
657
|
-
}
|
|
658
617
|
/*********************************
|
|
659
618
|
* Preview Sagas
|
|
660
619
|
*********************************/
|
|
@@ -691,120 +650,96 @@ function* billingSagasMock() {
|
|
|
691
650
|
}
|
|
692
651
|
|
|
693
652
|
function* checkoutSagas() {
|
|
694
|
-
yield takeEvery(actions$2.
|
|
653
|
+
yield takeEvery(actions$2.loadCheckout, loadCheckout);
|
|
695
654
|
yield takeEvery(actions$2.resetCheckout, resetCheckout);
|
|
696
|
-
yield takeEvery(actions$2.confirmCheckout, confirmPlan);
|
|
697
|
-
yield takeEvery(actions$2.cancelCheckout, cancelPlan);
|
|
698
655
|
yield takeEvery(actions$2.submitCheckout, submitCheckout);
|
|
656
|
+
yield takeEvery(actions$2.confirmCheckout, confirmPlan);
|
|
699
657
|
yield takeEvery(actions$2.errorCheckout, errorCheckout);
|
|
700
658
|
}
|
|
701
|
-
function*
|
|
659
|
+
function* loadCheckout() {
|
|
702
660
|
yield put(actions$2.setState({
|
|
703
|
-
|
|
661
|
+
fetching: false,
|
|
704
662
|
loading: false,
|
|
705
663
|
error: null,
|
|
706
|
-
|
|
664
|
+
confirmed: false,
|
|
707
665
|
}));
|
|
708
666
|
}
|
|
709
667
|
function* resetCheckout() {
|
|
710
668
|
yield put(actions$2.setState({
|
|
711
|
-
checkoutPlanId: null,
|
|
712
669
|
loading: false,
|
|
713
|
-
|
|
670
|
+
error: null,
|
|
671
|
+
confirmed: false,
|
|
714
672
|
}));
|
|
715
673
|
}
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
674
|
+
/**
|
|
675
|
+
* Based on payment provider type
|
|
676
|
+
*/
|
|
677
|
+
function* submitCheckout() {
|
|
678
|
+
yield put(actions$2.setState({
|
|
679
|
+
loading: true,
|
|
680
|
+
error: null,
|
|
721
681
|
}));
|
|
722
|
-
|
|
682
|
+
}
|
|
683
|
+
function* confirmPlan({ payload: { paymentMethodId, planId } }) {
|
|
684
|
+
const subscription = yield select((state) => state.subscriptions.billing.subscription.subscription);
|
|
685
|
+
const summary = yield select((state) => state.subscriptions.billing.information.summary);
|
|
686
|
+
const isTrialing = (subscription === null || subscription === void 0 ? void 0 : subscription.status) === SubscriptionStatus.TRIALING;
|
|
723
687
|
const hasPaymentMethod = !!(summary === null || summary === void 0 ? void 0 : summary.paymentMethodId);
|
|
724
|
-
if (!
|
|
688
|
+
if (!subscription) {
|
|
725
689
|
yield put(actions$2.setState({
|
|
726
690
|
loading: false,
|
|
727
|
-
|
|
691
|
+
error: 'Subscription not found',
|
|
728
692
|
}));
|
|
729
693
|
return;
|
|
730
694
|
}
|
|
695
|
+
yield put(actions$2.setState({
|
|
696
|
+
loading: true,
|
|
697
|
+
error: null,
|
|
698
|
+
}));
|
|
731
699
|
if (isTrialing && hasPaymentMethod) {
|
|
732
|
-
yield
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
status: CheckoutStatus.CONFIRM,
|
|
700
|
+
yield confirmCheckout();
|
|
701
|
+
yield put(actions$6.setState({
|
|
702
|
+
subscription: Object.assign(Object.assign({}, subscription), { status: ISubscriptionStatus.ACTIVE }),
|
|
736
703
|
}));
|
|
737
|
-
yield loadSubscription();
|
|
738
|
-
yield put(actions$2.checkoutEvent(CheckoutEvent.CONFIRMED));
|
|
739
704
|
return;
|
|
740
705
|
}
|
|
741
|
-
|
|
742
|
-
yield
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
})
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
checkoutPlanId: null,
|
|
753
|
-
loading: false,
|
|
754
|
-
status: CheckoutStatus.CONFIRM,
|
|
755
|
-
}));
|
|
756
|
-
yield put(actions$2.checkoutEvent(CheckoutEvent.CONFIRMED));
|
|
757
|
-
}
|
|
758
|
-
catch (e) {
|
|
759
|
-
yield put(actions$2.setState({
|
|
760
|
-
loading: false,
|
|
761
|
-
error: e.message,
|
|
762
|
-
status: CheckoutStatus.ERROR,
|
|
763
|
-
}));
|
|
764
|
-
yield put(actions$2.checkoutEvent(CheckoutEvent.ERROR));
|
|
765
|
-
}
|
|
706
|
+
try {
|
|
707
|
+
yield call(api.subscriptions.updateManagedSubscription, subscription.id, {
|
|
708
|
+
paymentMethodId,
|
|
709
|
+
planId,
|
|
710
|
+
});
|
|
711
|
+
yield all([
|
|
712
|
+
loadBillingInformation(),
|
|
713
|
+
loadPaymentMethod(),
|
|
714
|
+
loadInvoices(),
|
|
715
|
+
]);
|
|
716
|
+
yield confirmCheckout();
|
|
766
717
|
}
|
|
767
|
-
|
|
768
|
-
function* cancelPlan() {
|
|
769
|
-
const { status } = yield select((state) => state.subscriptions.checkout);
|
|
770
|
-
if (status === CheckoutStatus.CHECKOUT) {
|
|
718
|
+
catch (e) {
|
|
771
719
|
yield put(actions$2.setState({
|
|
772
|
-
checkoutPlanId: null,
|
|
773
720
|
loading: false,
|
|
774
|
-
error:
|
|
775
|
-
status: CheckoutStatus.CANCEL,
|
|
721
|
+
error: e.message,
|
|
776
722
|
}));
|
|
777
|
-
yield put(actions$2.checkoutEvent(CheckoutEvent.CANCEL));
|
|
778
723
|
}
|
|
779
724
|
}
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
yield put(actions$2.setState({
|
|
787
|
-
loading: true,
|
|
788
|
-
error: null,
|
|
789
|
-
}));
|
|
790
|
-
yield put(actions$2.checkoutEvent(CheckoutEvent.SUBMITTED));
|
|
791
|
-
}
|
|
725
|
+
function* confirmCheckout() {
|
|
726
|
+
yield put(actions$2.setState({
|
|
727
|
+
loading: false,
|
|
728
|
+
error: null,
|
|
729
|
+
confirmed: true,
|
|
730
|
+
}));
|
|
792
731
|
}
|
|
793
732
|
function* errorCheckout({ payload }) {
|
|
794
733
|
yield put(actions$2.setState({
|
|
795
734
|
loading: false,
|
|
796
735
|
error: payload,
|
|
797
|
-
status: CheckoutStatus.ERROR,
|
|
798
736
|
}));
|
|
799
|
-
yield put(actions$2.checkoutEvent(CheckoutEvent.ERROR));
|
|
800
737
|
}
|
|
801
738
|
/*********************************
|
|
802
739
|
* Preview Sagas
|
|
803
740
|
*********************************/
|
|
804
741
|
function* checkoutSagasMock() {
|
|
805
|
-
yield takeEvery(actions$2.checkoutPlan, checkoutPlan);
|
|
806
742
|
yield takeEvery(actions$2.resetCheckout, resetCheckout);
|
|
807
|
-
yield takeEvery(actions$2.cancelCheckout, cancelPlan);
|
|
808
743
|
}
|
|
809
744
|
|
|
810
745
|
function* plansSagas() {
|
|
@@ -964,4 +899,4 @@ var subscriptionsStore = {
|
|
|
964
899
|
storeName: subscriptionsStoreName,
|
|
965
900
|
};
|
|
966
901
|
|
|
967
|
-
export {
|
|
902
|
+
export { PaymentMethodType, PaymentProvider, SubscriptionCancellationPolicy, SubscriptionStatus, subscriptionsStore as default, actions as subscriptionActions, initialState as subscriptionInitialState, reducer as subscriptionReducers, sagas as subscriptionSagas, mockSagas as subscriptionSagasMock };
|
|
@@ -65,18 +65,14 @@ declare const actions: {
|
|
|
65
65
|
loadPlans: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
66
66
|
};
|
|
67
67
|
checkout: {
|
|
68
|
-
setStatus: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("./interfaces").CheckoutStatus], import("./interfaces").CheckoutStatus, string, never, never>;
|
|
69
|
-
selectPlan: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[string | null], string | null, string, never, never>;
|
|
70
68
|
setLoading: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[boolean], boolean, string, never, never>;
|
|
71
69
|
setError: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[string | null], string | null, string, never, never>;
|
|
72
70
|
setState: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[Partial<import("./interfaces").CheckoutState>], Partial<import("./interfaces").CheckoutState>, string, never, never>;
|
|
73
|
-
|
|
71
|
+
loadCheckout: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
74
72
|
resetCheckout: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
75
|
-
confirmCheckout: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[string], string, string, never, never>;
|
|
76
|
-
cancelCheckout: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
77
73
|
submitCheckout: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
74
|
+
confirmCheckout: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("./interfaces").ConfirmCheckoutActionPayload], import("./interfaces").ConfirmCheckoutActionPayload, string, never, never>;
|
|
78
75
|
errorCheckout: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[string], string, string, never, never>;
|
|
79
|
-
checkoutEvent: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("./interfaces").CheckoutEvent], import("./interfaces").CheckoutEvent, string, never, never>;
|
|
80
76
|
};
|
|
81
77
|
stripe: {
|
|
82
78
|
setLoading: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[boolean], boolean, string, never, never>;
|