@tap-payments/auth-jsconnect 2.1.56-test → 2.1.59-test
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/README.md +34 -34
- package/build/@types/app.d.ts +1 -0
- package/build/app/settings.d.ts +0 -1
- package/build/app/settings.js +6 -16
- package/build/assets/locales/ar.json +3 -1
- package/build/assets/locales/en.json +3 -1
- package/build/constants/app.js +32 -2
- package/build/features/app/bank/bankStore.d.ts +5 -1
- package/build/features/app/bank/bankStore.js +62 -57
- package/build/features/app/brand/brandStore.d.ts +5 -1
- package/build/features/app/brand/brandStore.js +70 -65
- package/build/features/app/connectExpress/connectExpressStore.js +9 -3
- package/build/features/app/entity/entityStore.d.ts +5 -1
- package/build/features/app/entity/entityStore.js +75 -70
- package/build/features/app/individual/individualStore.d.ts +5 -1
- package/build/features/app/individual/individualStore.js +88 -83
- package/build/features/app/tax/taxStore.d.ts +5 -1
- package/build/features/app/tax/taxStore.js +51 -46
- package/build/features/auth/Auth.d.ts +3 -2
- package/build/features/auth/Auth.js +5 -13
- package/build/features/bank/Bank.d.ts +4 -2
- package/build/features/bank/Bank.js +35 -35
- package/build/features/bank/screens/PrepareDataLoading/PrepareDataLoading.d.ts +4 -0
- package/build/features/bank/screens/PrepareDataLoading/PrepareDataLoading.js +7 -0
- package/build/features/bank/screens/PrepareDataLoading/index.d.ts +2 -0
- package/build/features/bank/screens/PrepareDataLoading/index.js +2 -0
- package/build/features/bank/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +6 -99
- package/build/features/brand/Brand.d.ts +4 -2
- package/build/features/brand/Brand.js +35 -34
- package/build/features/brand/screens/PrepareDataLoading/PrepareDataLoading.d.ts +4 -0
- package/build/features/brand/screens/PrepareDataLoading/PrepareDataLoading.js +7 -0
- package/build/features/brand/screens/PrepareDataLoading/index.d.ts +2 -0
- package/build/features/brand/screens/PrepareDataLoading/index.js +2 -0
- package/build/features/brand/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +6 -99
- package/build/features/business/Business.d.ts +3 -2
- package/build/features/business/Business.js +5 -13
- package/build/features/business/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +6 -98
- package/build/features/connect/Connect.d.ts +3 -2
- package/build/features/connect/Connect.js +5 -13
- package/build/features/connectExpress/ConnectExpress.d.ts +0 -1
- package/build/features/connectExpress/ConnectExpress.js +3 -6
- package/build/features/connectExpress/screens/CreateAccountLoader/CreateAccountLoader.js +1 -1
- package/build/features/connectExpress/screens/Mobile/Mobile.js +6 -3
- package/build/features/connectExpress/screens/Mobile/MobileNumber.js +6 -9
- package/build/features/connectExpress/screens/NID/IDNumber.js +7 -2
- package/build/features/connectExpress/screens/NID/NID.js +6 -5
- package/build/features/connectExpress/screens/NIDMissed/IDNumber.js +3 -7
- package/build/features/connectExpress/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +8 -100
- package/build/features/entity/Entity.d.ts +4 -2
- package/build/features/entity/Entity.js +35 -36
- package/build/features/entity/screens/PrepareDataLoading/PrepareDataLoading.d.ts +4 -0
- package/build/features/entity/screens/PrepareDataLoading/PrepareDataLoading.js +7 -0
- package/build/features/entity/screens/PrepareDataLoading/index.d.ts +2 -0
- package/build/features/entity/screens/PrepareDataLoading/index.js +2 -0
- package/build/features/entity/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +6 -99
- package/build/features/featuresScreens.js +25 -0
- package/build/features/individual/Individual.d.ts +4 -2
- package/build/features/individual/Individual.js +35 -36
- package/build/features/individual/screens/PrepareDataLoading/PrepareDataLoading.d.ts +4 -0
- package/build/features/individual/screens/PrepareDataLoading/PrepareDataLoading.js +7 -0
- package/build/features/individual/screens/PrepareDataLoading/index.d.ts +2 -0
- package/build/features/individual/screens/PrepareDataLoading/index.js +2 -0
- package/build/features/individual/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +6 -99
- package/build/features/password/Password.d.ts +4 -2
- package/build/features/password/Password.js +5 -13
- package/build/features/password/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +6 -99
- package/build/features/shared/Button/FlowsButtons.d.ts +1 -0
- package/build/features/shared/Button/FlowsButtons.js +6 -4
- package/build/features/shared/DataLoading/DataLoading.d.ts +5 -0
- package/build/features/shared/DataLoading/DataLoading.js +55 -0
- package/build/features/shared/DataLoading/index.d.ts +2 -0
- package/build/features/shared/DataLoading/index.js +2 -0
- package/build/features/shared/SuccessFlowButtons/SuccessFlowButtons.js +2 -1
- package/build/features/signIn/SignIn.d.ts +3 -2
- package/build/features/signIn/SignIn.js +4 -13
- package/build/features/tax/Tax.d.ts +4 -2
- package/build/features/tax/Tax.js +35 -37
- package/build/features/tax/screens/PrepareDataLoading/PrepareDataLoading.d.ts +4 -0
- package/build/features/tax/screens/PrepareDataLoading/PrepareDataLoading.js +7 -0
- package/build/features/tax/screens/PrepareDataLoading/index.d.ts +2 -0
- package/build/features/tax/screens/PrepareDataLoading/index.js +2 -0
- package/build/features/tax/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +6 -99
- package/build/hooks/index.d.ts +1 -0
- package/build/hooks/index.js +1 -0
- package/build/hooks/useAppConfig.d.ts +2 -2
- package/build/hooks/useAppConfig.js +5 -3
- package/build/hooks/useVerifyToken.d.ts +15 -0
- package/build/hooks/useVerifyToken.js +25 -0
- package/build/index.d.ts +11 -11
- package/build/index.js +12 -22
- package/package.json +1 -1
- package/build/features/connectExpress/screens/Brand/Brand.d.ts +0 -0
- package/build/features/connectExpress/screens/Brand/Brand.js +0 -1
- package/build/features/connectExpress/screens/Brand/BrandList.d.ts +0 -10
- package/build/features/connectExpress/screens/Brand/BrandList.js +0 -106
- package/build/features/connectExpress/screens/Brand/BrandName.d.ts +0 -8
- package/build/features/connectExpress/screens/Brand/BrandName.js +0 -142
- package/build/features/connectExpress/screens/Brand/SalesChannels.d.ts +0 -5
- package/build/features/connectExpress/screens/Brand/SalesChannels.js +0 -38
- package/build/features/connectExpress/screens/Brand/Segments.d.ts +0 -8
- package/build/features/connectExpress/screens/Brand/Segments.js +0 -74
- package/build/features/connectExpress/screens/Brand/TAC.d.ts +0 -6
- package/build/features/connectExpress/screens/Brand/TAC.js +0 -84
- package/build/features/connectExpress/screens/Brand/TeamSize.d.ts +0 -8
- package/build/features/connectExpress/screens/Brand/TeamSize.js +0 -74
- package/build/features/connectExpress/screens/Brand/index.d.ts +0 -0
- package/build/features/connectExpress/screens/Brand/index.js +0 -1
- package/build/features/connectExpress/screens/Brand/validation.d.ts +0 -38
- package/build/features/connectExpress/screens/Brand/validation.js +0 -134
|
@@ -64,77 +64,82 @@ import { handleNextScreenStep, handleSetCountryByIso2 } from '../../../app/setti
|
|
|
64
64
|
import { ENTITY_STEP_NAMES } from '../../../constants';
|
|
65
65
|
import moment from 'moment';
|
|
66
66
|
import { convertNumbers2English } from '../../../utils';
|
|
67
|
-
export var verifyLeadToken = createAsyncThunk('entityVerifyLeadToken', function (
|
|
68
|
-
var
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
if (
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
67
|
+
export var verifyLeadToken = createAsyncThunk('entityVerifyLeadToken', function (_a, thunkApi) {
|
|
68
|
+
var token = _a.token, isInternally = _a.isInternally;
|
|
69
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
70
|
+
var payload, data, boardData, entityData, boardInfoData, entityTypes, countryIso2, board_id, entityId, info, hasEntityCompleted;
|
|
71
|
+
var _b, _c, _d, _e;
|
|
72
|
+
return __generator(this, function (_f) {
|
|
73
|
+
switch (_f.label) {
|
|
74
|
+
case 0:
|
|
75
|
+
payload = {
|
|
76
|
+
service_name: 'tap_email',
|
|
77
|
+
verify_token: token
|
|
78
|
+
};
|
|
79
|
+
return [4, API.leadService.verifyLeadToken(payload)];
|
|
80
|
+
case 1:
|
|
81
|
+
data = (_f.sent()).data;
|
|
82
|
+
countryIso2 = undefined;
|
|
83
|
+
if (!(!(data === null || data === void 0 ? void 0 : data.errors) && !(data === null || data === void 0 ? void 0 : data.mw_error))) return [3, 9];
|
|
84
|
+
if (isInternally)
|
|
85
|
+
data.step_name = ENTITY_STEP_NAMES.ENTITY_INFO;
|
|
86
|
+
if (data === null || data === void 0 ? void 0 : data.country_code) {
|
|
87
|
+
countryIso2 = data === null || data === void 0 ? void 0 : data.country_code;
|
|
88
|
+
if (countryIso2)
|
|
89
|
+
thunkApi.dispatch(handleSetCountryByIso2(countryIso2));
|
|
90
|
+
}
|
|
91
|
+
if (!(data.step_name !== ENTITY_STEP_NAMES.PHONE_AUTH)) return [3, 9];
|
|
92
|
+
board_id = data === null || data === void 0 ? void 0 : data.id;
|
|
93
|
+
if (!board_id) return [3, 4];
|
|
94
|
+
return [4, API.boardService.retrieveBoardInfoStatus(board_id)];
|
|
95
|
+
case 2:
|
|
96
|
+
boardInfoData = _f.sent();
|
|
97
|
+
return [4, API.boardService.retrieveBoardDetails(board_id)];
|
|
98
|
+
case 3:
|
|
99
|
+
boardData = _f.sent();
|
|
100
|
+
_f.label = 4;
|
|
101
|
+
case 4:
|
|
102
|
+
entityId = (_b = boardData === null || boardData === void 0 ? void 0 : boardData.entity) === null || _b === void 0 ? void 0 : _b.id;
|
|
103
|
+
if (!entityId) return [3, 6];
|
|
104
|
+
return [4, API.entityService.retrieveEntity(entityId)];
|
|
105
|
+
case 5:
|
|
106
|
+
entityData = _f.sent();
|
|
107
|
+
_f.label = 6;
|
|
108
|
+
case 6:
|
|
109
|
+
if (!countryIso2) {
|
|
110
|
+
countryIso2 = entityData.country;
|
|
111
|
+
if (countryIso2)
|
|
112
|
+
thunkApi.dispatch(handleSetCountryByIso2(countryIso2));
|
|
113
|
+
}
|
|
114
|
+
info = (boardInfoData || {}).info;
|
|
115
|
+
hasEntityCompleted = ((_c = info === null || info === void 0 ? void 0 : info.find(function (flow) { return flow.name === 'entity'; })) === null || _c === void 0 ? void 0 : _c.status) === 'completed';
|
|
116
|
+
if (!hasEntityCompleted) return [3, 7];
|
|
117
|
+
thunkApi.dispatch(handleNextScreenStep('ENTITY_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
|
|
118
|
+
return [3, 9];
|
|
119
|
+
case 7: return [4, API.entityService.retrieveEntityType()];
|
|
120
|
+
case 8:
|
|
121
|
+
entityTypes = _f.sent();
|
|
122
|
+
thunkApi.dispatch(handleNextScreenStep('ENTITY_NAME_STEP'));
|
|
123
|
+
_f.label = 9;
|
|
124
|
+
case 9: return [2, {
|
|
125
|
+
data: data,
|
|
126
|
+
boardResponse: {
|
|
127
|
+
user: boardData === null || boardData === void 0 ? void 0 : boardData.user,
|
|
128
|
+
brand: boardData === null || boardData === void 0 ? void 0 : boardData.brand,
|
|
129
|
+
bank_account: boardData === null || boardData === void 0 ? void 0 : boardData.bank_account,
|
|
130
|
+
entity: entityData === null || entityData === void 0 ? void 0 : entityData.entity,
|
|
131
|
+
merchant: boardData === null || boardData === void 0 ? void 0 : boardData.merchant,
|
|
132
|
+
name: (_d = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _d === void 0 ? void 0 : _d.names,
|
|
133
|
+
contact: (_e = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _e === void 0 ? void 0 : _e.contact,
|
|
134
|
+
flows: (boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.info) || [],
|
|
135
|
+
entityTypes: entityTypes
|
|
136
|
+
},
|
|
137
|
+
token: token
|
|
138
|
+
}];
|
|
139
|
+
}
|
|
140
|
+
});
|
|
136
141
|
});
|
|
137
|
-
});
|
|
142
|
+
});
|
|
138
143
|
export var resendOTP = createAsyncThunk('entityResendOTP', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
139
144
|
var entity, payload, data;
|
|
140
145
|
return __generator(this, function (_a) {
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { RootState } from '../../../app/store';
|
|
2
2
|
import { CountryCode, FlowsTypes, IndividualExtraFormValues, OTPFormValues, ResponseData, SharedState, ActionState } from '../../../@types';
|
|
3
|
+
interface VerifyLeadTokenProps {
|
|
4
|
+
token: string;
|
|
5
|
+
isInternally?: boolean;
|
|
6
|
+
}
|
|
3
7
|
export declare const verifyLeadToken: import("@reduxjs/toolkit").AsyncThunk<{
|
|
4
8
|
data: any;
|
|
5
9
|
boardResponse: {
|
|
@@ -17,7 +21,7 @@ export declare const verifyLeadToken: import("@reduxjs/toolkit").AsyncThunk<{
|
|
|
17
21
|
flows: any;
|
|
18
22
|
};
|
|
19
23
|
token: string;
|
|
20
|
-
},
|
|
24
|
+
}, VerifyLeadTokenProps, {}>;
|
|
21
25
|
export declare const resendOTP: import("@reduxjs/toolkit").AsyncThunk<{
|
|
22
26
|
data: any;
|
|
23
27
|
}, void, {}>;
|
|
@@ -51,91 +51,96 @@ import API from '../../../api';
|
|
|
51
51
|
import { FlowsTypes } from '../../../@types';
|
|
52
52
|
import { handleNextScreenStep, handleSetCountryByIso2 } from '../../../app/settings';
|
|
53
53
|
import { INDIVIDUAl_STEP_NAMES } from '../../../constants';
|
|
54
|
-
export var verifyLeadToken = createAsyncThunk('individualVerifyLeadToken', function (
|
|
55
|
-
var
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
board_info_id = data === null || data === void 0 ? void 0 : data.board_info_id;
|
|
78
|
-
if (!(board_id && board_info_id)) return [3, 4];
|
|
79
|
-
return [4, API.boardService.retrieveBoardInfo({ id: board_id, infoId: board_info_id })];
|
|
80
|
-
case 2:
|
|
81
|
-
boardInfoData = _f.sent();
|
|
82
|
-
notification = (boardInfoData || {}).notification;
|
|
83
|
-
_a = (notification === null || notification === void 0 ? void 0 : notification.recipient) || {}, id = _a.id, type = _a.type;
|
|
84
|
-
if (!(id && type)) return [3, 4];
|
|
85
|
-
return [4, API.individualService.retrieveIndividual(id, type)];
|
|
86
|
-
case 3:
|
|
87
|
-
individualData = _f.sent();
|
|
88
|
-
_f.label = 4;
|
|
89
|
-
case 4:
|
|
90
|
-
if (!board_id) return [3, 7];
|
|
91
|
-
return [4, API.boardService.retrieveBoardDetails(board_id)];
|
|
92
|
-
case 5:
|
|
93
|
-
boardData = _f.sent();
|
|
94
|
-
return [4, API.boardService.retrieveBoardInfoStatus(board_id)];
|
|
95
|
-
case 6:
|
|
96
|
-
boardInfoStatus = _f.sent();
|
|
97
|
-
_f.label = 7;
|
|
98
|
-
case 7:
|
|
99
|
-
if (!countryCode) {
|
|
100
|
-
countryCode = (_b = boardData === null || boardData === void 0 ? void 0 : boardData.entity) === null || _b === void 0 ? void 0 : _b.country;
|
|
101
|
-
if (countryCode)
|
|
54
|
+
export var verifyLeadToken = createAsyncThunk('individualVerifyLeadToken', function (_a, thunkApi) {
|
|
55
|
+
var token = _a.token, isInternally = _a.isInternally;
|
|
56
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
57
|
+
var payload, settings, data, boardData, individualData, countryCode, boardInfoData, boardInfoStatus, countries, board_id, board_info_id, notification, _b, id, type, info, hasIndividualCompleted;
|
|
58
|
+
var _c, _d, _e, _f;
|
|
59
|
+
return __generator(this, function (_g) {
|
|
60
|
+
switch (_g.label) {
|
|
61
|
+
case 0:
|
|
62
|
+
payload = {
|
|
63
|
+
service_name: 'tap_email',
|
|
64
|
+
verify_token: token
|
|
65
|
+
};
|
|
66
|
+
settings = thunkApi.getState().settings;
|
|
67
|
+
return [4, API.leadService.verifyLeadToken(payload)];
|
|
68
|
+
case 1:
|
|
69
|
+
data = (_g.sent()).data;
|
|
70
|
+
boardInfoStatus = undefined;
|
|
71
|
+
countries = settings.data.countries;
|
|
72
|
+
if (!(!(data === null || data === void 0 ? void 0 : data.errors) && !(data === null || data === void 0 ? void 0 : data.mw_error))) return [3, 11];
|
|
73
|
+
if (isInternally)
|
|
74
|
+
data.step_name = INDIVIDUAl_STEP_NAMES.INDIVIDUAl_INFO;
|
|
75
|
+
if (data === null || data === void 0 ? void 0 : data.country_code) {
|
|
76
|
+
countryCode = data === null || data === void 0 ? void 0 : data.country_code;
|
|
102
77
|
thunkApi.dispatch(handleSetCountryByIso2(countryCode));
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
78
|
+
}
|
|
79
|
+
if (!(data.step_name !== INDIVIDUAl_STEP_NAMES.PHONE_AUTH)) return [3, 11];
|
|
80
|
+
board_id = data === null || data === void 0 ? void 0 : data.id;
|
|
81
|
+
board_info_id = data === null || data === void 0 ? void 0 : data.board_info_id;
|
|
82
|
+
if (!(board_id && board_info_id)) return [3, 4];
|
|
83
|
+
return [4, API.boardService.retrieveBoardInfo({ id: board_id, infoId: board_info_id })];
|
|
84
|
+
case 2:
|
|
85
|
+
boardInfoData = _g.sent();
|
|
86
|
+
notification = (boardInfoData || {}).notification;
|
|
87
|
+
_b = (notification === null || notification === void 0 ? void 0 : notification.recipient) || {}, id = _b.id, type = _b.type;
|
|
88
|
+
if (!(id && type)) return [3, 4];
|
|
89
|
+
return [4, API.individualService.retrieveIndividual(id, type)];
|
|
90
|
+
case 3:
|
|
91
|
+
individualData = _g.sent();
|
|
92
|
+
_g.label = 4;
|
|
93
|
+
case 4:
|
|
94
|
+
if (!board_id) return [3, 7];
|
|
95
|
+
return [4, API.boardService.retrieveBoardDetails(board_id)];
|
|
96
|
+
case 5:
|
|
97
|
+
boardData = _g.sent();
|
|
98
|
+
return [4, API.boardService.retrieveBoardInfoStatus(board_id)];
|
|
99
|
+
case 6:
|
|
100
|
+
boardInfoStatus = _g.sent();
|
|
101
|
+
_g.label = 7;
|
|
102
|
+
case 7:
|
|
103
|
+
if (!countryCode) {
|
|
104
|
+
countryCode = (_c = boardData === null || boardData === void 0 ? void 0 : boardData.entity) === null || _c === void 0 ? void 0 : _c.country;
|
|
105
|
+
if (countryCode)
|
|
106
|
+
thunkApi.dispatch(handleSetCountryByIso2(countryCode));
|
|
107
|
+
}
|
|
108
|
+
info = (boardInfoStatus || {}).info;
|
|
109
|
+
hasIndividualCompleted = ((_d = info === null || info === void 0 ? void 0 : info.find(function (flow) { return flow.name === 'individual'; })) === null || _d === void 0 ? void 0 : _d.status) === 'completed';
|
|
110
|
+
if (!hasIndividualCompleted) return [3, 8];
|
|
111
|
+
thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
|
|
112
|
+
return [3, 11];
|
|
113
|
+
case 8:
|
|
114
|
+
if (!countryCode) return [3, 10];
|
|
115
|
+
return [4, thunkApi.dispatch(retrieveDataList(countryCode))];
|
|
116
|
+
case 9:
|
|
117
|
+
_g.sent();
|
|
118
|
+
_g.label = 10;
|
|
119
|
+
case 10:
|
|
120
|
+
thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_ADDITIONAL_INDIVIDUAL_INFO_STEP'));
|
|
121
|
+
_g.label = 11;
|
|
122
|
+
case 11: return [2, {
|
|
123
|
+
data: data,
|
|
124
|
+
boardResponse: {
|
|
125
|
+
user: individualData === null || individualData === void 0 ? void 0 : individualData.user,
|
|
126
|
+
brand: boardData === null || boardData === void 0 ? void 0 : boardData.brand,
|
|
127
|
+
bank_account: boardData === null || boardData === void 0 ? void 0 : boardData.bank_account,
|
|
128
|
+
entity: boardData === null || boardData === void 0 ? void 0 : boardData.entity,
|
|
129
|
+
merchant: boardData === null || boardData === void 0 ? void 0 : boardData.merchant,
|
|
130
|
+
merchant_id: boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.merchant_id,
|
|
131
|
+
name: (_e = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _e === void 0 ? void 0 : _e.names,
|
|
132
|
+
contact: (_f = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _f === void 0 ? void 0 : _f.contact,
|
|
133
|
+
countries: countries,
|
|
134
|
+
countryCode: countryCode,
|
|
135
|
+
notification: boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.notification,
|
|
136
|
+
flows: (boardInfoStatus === null || boardInfoStatus === void 0 ? void 0 : boardInfoStatus.info) || []
|
|
137
|
+
},
|
|
138
|
+
token: token
|
|
139
|
+
}];
|
|
140
|
+
}
|
|
141
|
+
});
|
|
137
142
|
});
|
|
138
|
-
});
|
|
143
|
+
});
|
|
139
144
|
export var resendOTP = createAsyncThunk('resendOTPIndividual', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
140
145
|
var individual, payload, data;
|
|
141
146
|
return __generator(this, function (_a) {
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import { RootState } from '../../../app/store';
|
|
2
2
|
import { FlowsTypes, OTPFormValues, ResponseData, SharedState, TaxFormValues } from '../../../@types';
|
|
3
|
+
interface VerifyLeadTokenProps {
|
|
4
|
+
token: string;
|
|
5
|
+
isInternally?: boolean;
|
|
6
|
+
}
|
|
3
7
|
export declare const verifyLeadToken: import("@reduxjs/toolkit").AsyncThunk<{
|
|
4
8
|
data: any;
|
|
5
9
|
boardResponse: any;
|
|
6
10
|
token: string;
|
|
7
|
-
},
|
|
11
|
+
}, VerifyLeadTokenProps, {}>;
|
|
8
12
|
export declare const resendOTP: import("@reduxjs/toolkit").AsyncThunk<{
|
|
9
13
|
data: any;
|
|
10
14
|
}, void, {}>;
|
|
@@ -52,53 +52,58 @@ import { FlowsTypes } from '../../../@types';
|
|
|
52
52
|
import { hasKey } from '../../../utils';
|
|
53
53
|
import { handleNextScreenStep, handleCurrentActiveScreen, handleSetCountryByIso2 } from '../../../app/settings';
|
|
54
54
|
import { TAX_STEP_NAMES } from '../../../constants';
|
|
55
|
-
export var verifyLeadToken = createAsyncThunk('taxVerifyLeadToken', function (
|
|
56
|
-
var
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
55
|
+
export var verifyLeadToken = createAsyncThunk('taxVerifyLeadToken', function (_a, thunkApi) {
|
|
56
|
+
var token = _a.token, isInternally = _a.isInternally;
|
|
57
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
58
|
+
var payload, data, boardData, boardInfoData, info, countryIso2, hasTaxCompleted;
|
|
59
|
+
var _b, _c, _d;
|
|
60
|
+
return __generator(this, function (_e) {
|
|
61
|
+
switch (_e.label) {
|
|
62
|
+
case 0:
|
|
63
|
+
payload = {
|
|
64
|
+
service_name: 'tap_email',
|
|
65
|
+
verify_token: token
|
|
66
|
+
};
|
|
67
|
+
return [4, API.leadService.verifyLeadToken(payload)];
|
|
68
|
+
case 1:
|
|
69
|
+
data = (_e.sent()).data;
|
|
70
|
+
boardInfoData = undefined;
|
|
71
|
+
if (!(!(data === null || data === void 0 ? void 0 : data.errors) && !(data === null || data === void 0 ? void 0 : data.mw_error))) return [3, 5];
|
|
72
|
+
if (isInternally)
|
|
73
|
+
data.step_name = TAX_STEP_NAMES.TAX_INFO;
|
|
74
|
+
if (!data.id) return [3, 4];
|
|
75
|
+
return [4, API.boardService.retrieveBoardInfoStatus(data.id)];
|
|
76
|
+
case 2:
|
|
77
|
+
boardInfoData = _e.sent();
|
|
78
|
+
return [4, API.boardService.retrieveBoardDetails(data === null || data === void 0 ? void 0 : data.id)];
|
|
79
|
+
case 3:
|
|
80
|
+
boardData = _e.sent();
|
|
81
|
+
_e.label = 4;
|
|
82
|
+
case 4:
|
|
83
|
+
info = (boardInfoData || {}).info;
|
|
84
|
+
countryIso2 = (_b = boardData === null || boardData === void 0 ? void 0 : boardData.entity) === null || _b === void 0 ? void 0 : _b.country;
|
|
85
|
+
if (countryIso2)
|
|
86
|
+
thunkApi.dispatch(handleSetCountryByIso2(countryIso2));
|
|
87
|
+
hasTaxCompleted = ((_c = info === null || info === void 0 ? void 0 : info.find(function (flow) { return flow.name === 'tax'; })) === null || _c === void 0 ? void 0 : _c.status) === 'completed';
|
|
88
|
+
if (hasTaxCompleted) {
|
|
89
|
+
thunkApi.dispatch(handleNextScreenStep('TAX_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
|
|
90
|
+
}
|
|
91
|
+
else if (data.step_name === TAX_STEP_NAMES.PHONE_AUTH) {
|
|
92
|
+
thunkApi.dispatch(handleCurrentActiveScreen('TAX_VERIFY_STEP'));
|
|
93
|
+
}
|
|
94
|
+
else if (data.step_name === TAX_STEP_NAMES.TAX_INFO) {
|
|
95
|
+
thunkApi.dispatch(handleNextScreenStep('TAX_TAX_DETAILS_STEP'));
|
|
96
|
+
}
|
|
97
|
+
_e.label = 5;
|
|
98
|
+
case 5: return [2, {
|
|
99
|
+
data: data,
|
|
100
|
+
boardResponse: __assign(__assign({}, boardData === null || boardData === void 0 ? void 0 : boardData.business), { flows: (boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.info) || [], entity: boardData === null || boardData === void 0 ? void 0 : boardData.entity, brand: boardData === null || boardData === void 0 ? void 0 : boardData.brand, user: boardData === null || boardData === void 0 ? void 0 : boardData.user, bank: boardData === null || boardData === void 0 ? void 0 : boardData.bank_account, vatID: (_d = boardData === null || boardData === void 0 ? void 0 : boardData.entity) === null || _d === void 0 ? void 0 : _d.vat_id, merchant: boardData === null || boardData === void 0 ? void 0 : boardData.merchant, business: boardData === null || boardData === void 0 ? void 0 : boardData.business }),
|
|
101
|
+
token: token
|
|
102
|
+
}];
|
|
103
|
+
}
|
|
104
|
+
});
|
|
100
105
|
});
|
|
101
|
-
});
|
|
106
|
+
});
|
|
102
107
|
export var resendOTP = createAsyncThunk('resendOTPTax', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
103
108
|
var tax, payload, data;
|
|
104
109
|
return __generator(this, function (_a) {
|
|
@@ -6,5 +6,6 @@ export interface AuthLibProps extends LibConfig {
|
|
|
6
6
|
onClose?: () => void;
|
|
7
7
|
}
|
|
8
8
|
export declare function AuthLib(props: AuthLibProps): JSX.Element;
|
|
9
|
-
export declare function renderAuthLib(config: AuthLibProps, elementId: string):
|
|
10
|
-
|
|
9
|
+
export declare function renderAuthLib(config: AuthLibProps, elementId: string): {
|
|
10
|
+
unmount: () => void;
|
|
11
|
+
};
|
|
@@ -30,8 +30,8 @@ import { store } from '../../app/store';
|
|
|
30
30
|
import { authSelector, retrieveLead, storeLeadId, storePostUrl } from '../app/auth/authStore';
|
|
31
31
|
import { ReduxProvider, ThemeProvider } from '../../components/Providers';
|
|
32
32
|
import Collapse from '../../components/Collapse';
|
|
33
|
-
import { reactElement
|
|
34
|
-
import { AUTH_SCREENS_NAVIGATION
|
|
33
|
+
import { reactElement } from '../../utils';
|
|
34
|
+
import { AUTH_SCREENS_NAVIGATION } from '../../constants';
|
|
35
35
|
import { authFeatureScreens } from '../featuresScreens';
|
|
36
36
|
import Background from '../shared/Background';
|
|
37
37
|
var Auth = memo(function (_a) {
|
|
@@ -73,15 +73,7 @@ export function AuthLib(props) {
|
|
|
73
73
|
return (_jsx(ReduxProvider, __assign({ store: store }, { children: _jsx(Auth, __assign({}, props)) })));
|
|
74
74
|
}
|
|
75
75
|
export function renderAuthLib(config, elementId) {
|
|
76
|
-
reactElement(elementId).render
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
if (unmountTimeout === void 0) { unmountTimeout = 1000; }
|
|
80
|
-
var element = document.getElementById(elementId);
|
|
81
|
-
setTimeout(function () {
|
|
82
|
-
var _a;
|
|
83
|
-
((_a = element === null || element === void 0 ? void 0 : element.children) === null || _a === void 0 ? void 0 : _a.length) && element.removeChild(element.children[0]);
|
|
84
|
-
removeElement(DIALOG_ID);
|
|
85
|
-
elementId && reactElement(elementId).unmount();
|
|
86
|
-
}, unmountTimeout);
|
|
76
|
+
var _a = reactElement(elementId), render = _a.render, unmount = _a.unmount;
|
|
77
|
+
render(_jsx(AuthLib, __assign({}, config)));
|
|
78
|
+
return { unmount: unmount };
|
|
87
79
|
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { LibConfig } from '../../@types';
|
|
3
3
|
export interface BankLibProps extends LibConfig {
|
|
4
|
+
verifyToken?: string;
|
|
4
5
|
}
|
|
5
6
|
export declare function BankLib(props: BankLibProps): JSX.Element;
|
|
6
|
-
export declare function renderBankLib(config: BankLibProps, elementId: string):
|
|
7
|
-
|
|
7
|
+
export declare function renderBankLib(config: BankLibProps, elementId: string): {
|
|
8
|
+
unmount: () => void;
|
|
9
|
+
};
|