@tap-payments/auth-jsconnect 2.1.58-test → 2.1.60-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/build/constants/app.js +24 -0
- 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.js +2 -0
- 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/bank/Bank.js +31 -24
- 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.js +12 -21
- package/build/features/business/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +6 -98
- package/build/features/connectExpress/screens/Mobile/Mobile.js +1 -1
- package/build/features/connectExpress/screens/Mobile/MobileNumber.js +6 -9
- package/build/features/entity/Entity.js +31 -24
- 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 +20 -0
- package/build/features/individual/Individual.js +31 -24
- 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/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +6 -99
- package/build/features/shared/Button/FlowsButtons.js +1 -1
- package/build/features/tax/Tax.js +31 -24
- 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/useVerifyToken.d.ts +15 -0
- package/build/hooks/useVerifyToken.js +25 -0
- package/package.json +1 -1
package/build/constants/app.js
CHANGED
|
@@ -245,6 +245,12 @@ export var INDIVIDUAL_SCREENS_NAVIGATION = [
|
|
|
245
245
|
prev: '',
|
|
246
246
|
order: 1
|
|
247
247
|
},
|
|
248
|
+
{
|
|
249
|
+
name: 'INDIVIDUAL_LOADING_DATA_STEP',
|
|
250
|
+
next: ['INDIVIDUAL_ADDITIONAL_INDIVIDUAL_INFO_STEP', 'INDIVIDUAL_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'],
|
|
251
|
+
prev: '',
|
|
252
|
+
order: 1
|
|
253
|
+
},
|
|
248
254
|
{
|
|
249
255
|
name: 'INDIVIDUAL_ADDITIONAL_INDIVIDUAL_INFO_STEP',
|
|
250
256
|
next: 'INDIVIDUAL_SUCCESS_STEP',
|
|
@@ -315,6 +321,12 @@ export var BANK_SCREENS_NAVIGATION = [
|
|
|
315
321
|
prev: '',
|
|
316
322
|
order: 1
|
|
317
323
|
},
|
|
324
|
+
{
|
|
325
|
+
name: 'BANK_LOADING_DATA_STEP',
|
|
326
|
+
next: ['BANK_BANK_DETAILS_STEP', 'BANK_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'],
|
|
327
|
+
prev: '',
|
|
328
|
+
order: 1
|
|
329
|
+
},
|
|
318
330
|
{
|
|
319
331
|
name: 'BANK_BANK_DETAILS_STEP',
|
|
320
332
|
next: 'BANK_DETAILS_SUCCESS_STEP',
|
|
@@ -347,6 +359,12 @@ export var TAX_SCREENS_NAVIGATION = [
|
|
|
347
359
|
prev: '',
|
|
348
360
|
order: 1
|
|
349
361
|
},
|
|
362
|
+
{
|
|
363
|
+
name: 'TAX_LOADING_DATA_STEP',
|
|
364
|
+
next: ['TAX_TAX_DETAILS_STEP', 'TAX_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'],
|
|
365
|
+
prev: '',
|
|
366
|
+
order: 1
|
|
367
|
+
},
|
|
350
368
|
{
|
|
351
369
|
name: 'TAX_TAX_DETAILS_STEP',
|
|
352
370
|
next: 'TAX_DETAILS_SUCCESS_STEP',
|
|
@@ -405,6 +423,12 @@ export var ENTITY_SCREENS_NAVIGATION = [
|
|
|
405
423
|
prev: '',
|
|
406
424
|
order: 1
|
|
407
425
|
},
|
|
426
|
+
{
|
|
427
|
+
name: 'ENTITY_LOADING_DATA_STEP',
|
|
428
|
+
next: ['ENTITY_NAME_STEP', 'ENTITY_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'],
|
|
429
|
+
prev: '',
|
|
430
|
+
order: 1
|
|
431
|
+
},
|
|
408
432
|
{
|
|
409
433
|
name: 'ENTITY_NAME_STEP',
|
|
410
434
|
next: 'ENTITY_CAPITAL_STEP',
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { RootState } from '../../../app/store';
|
|
2
2
|
import { BankFormValues, FlowsTypes, OTPFormValues, ResponseData, SharedState } from '../../../@types';
|
|
3
3
|
import { CancelToken } from 'axios';
|
|
4
|
+
interface VerifyLeadTokenProps {
|
|
5
|
+
token: string;
|
|
6
|
+
isInternally?: boolean;
|
|
7
|
+
}
|
|
4
8
|
export declare const verifyLeadToken: import("@reduxjs/toolkit").AsyncThunk<{
|
|
5
9
|
data: any;
|
|
6
10
|
boardResponse: {
|
|
@@ -15,7 +19,7 @@ export declare const verifyLeadToken: import("@reduxjs/toolkit").AsyncThunk<{
|
|
|
15
19
|
flows: any;
|
|
16
20
|
};
|
|
17
21
|
token: string;
|
|
18
|
-
},
|
|
22
|
+
}, VerifyLeadTokenProps, {}>;
|
|
19
23
|
export declare const resendOTP: import("@reduxjs/toolkit").AsyncThunk<{
|
|
20
24
|
data: any;
|
|
21
25
|
}, void, {}>;
|
|
@@ -51,64 +51,69 @@ import API from '../../../api';
|
|
|
51
51
|
import { FlowsTypes } from '../../../@types';
|
|
52
52
|
import { handleCurrentActiveScreen, handleNextScreenStep, handleSetCountryByIso2 } from '../../../app/settings';
|
|
53
53
|
import { BANK_STEP_NAMES } from '../../../constants';
|
|
54
|
-
export var verifyLeadToken = createAsyncThunk('bankVerifyLeadToken', 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
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
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
|
-
|
|
54
|
+
export var verifyLeadToken = createAsyncThunk('bankVerifyLeadToken', function (_a, thunkApi) {
|
|
55
|
+
var token = _a.token, isInternally = _a.isInternally;
|
|
56
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
57
|
+
var payload, data, boardInfoData, boardData, board_id, countryIso2, info, hasBankCompleted;
|
|
58
|
+
var _b, _c, _d, _e;
|
|
59
|
+
return __generator(this, function (_f) {
|
|
60
|
+
switch (_f.label) {
|
|
61
|
+
case 0:
|
|
62
|
+
payload = {
|
|
63
|
+
service_name: 'tap_email',
|
|
64
|
+
verify_token: token
|
|
65
|
+
};
|
|
66
|
+
return [4, API.leadService.verifyLeadToken(payload)];
|
|
67
|
+
case 1:
|
|
68
|
+
data = (_f.sent()).data;
|
|
69
|
+
boardData = undefined;
|
|
70
|
+
if (!(!(data === null || data === void 0 ? void 0 : data.errors) && !(data === null || data === void 0 ? void 0 : data.mw_error))) return [3, 5];
|
|
71
|
+
board_id = data === null || data === void 0 ? void 0 : data.id;
|
|
72
|
+
if (!board_id) return [3, 4];
|
|
73
|
+
return [4, API.boardService.retrieveBoardInfoStatus(board_id)];
|
|
74
|
+
case 2:
|
|
75
|
+
boardInfoData = _f.sent();
|
|
76
|
+
return [4, API.boardService.retrieveBoardDetails(board_id)];
|
|
77
|
+
case 3:
|
|
78
|
+
boardData = _f.sent();
|
|
79
|
+
_f.label = 4;
|
|
80
|
+
case 4:
|
|
81
|
+
countryIso2 = (_b = boardData === null || boardData === void 0 ? void 0 : boardData.entity) === null || _b === void 0 ? void 0 : _b.country;
|
|
82
|
+
if (countryIso2)
|
|
83
|
+
thunkApi.dispatch(handleSetCountryByIso2(countryIso2));
|
|
84
|
+
info = (boardInfoData || {}).info;
|
|
85
|
+
if (isInternally)
|
|
86
|
+
data.step_name = BANK_STEP_NAMES.BANK_INFO;
|
|
87
|
+
hasBankCompleted = ((_c = info === null || info === void 0 ? void 0 : info.find(function (flow) { return flow.name === 'bank'; })) === null || _c === void 0 ? void 0 : _c.status) === 'completed';
|
|
88
|
+
if (data.step_name === BANK_STEP_NAMES.PHONE_AUTH) {
|
|
89
|
+
thunkApi.dispatch(handleCurrentActiveScreen('BANK_VERIFY_STEP'));
|
|
90
|
+
}
|
|
91
|
+
else if (hasBankCompleted) {
|
|
92
|
+
thunkApi.dispatch(handleNextScreenStep('BANK_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
|
|
93
|
+
}
|
|
94
|
+
else if (data.step_name === BANK_STEP_NAMES.BANK_INFO) {
|
|
95
|
+
thunkApi.dispatch(handleNextScreenStep('BANK_BANK_DETAILS_STEP'));
|
|
96
|
+
}
|
|
97
|
+
_f.label = 5;
|
|
98
|
+
case 5: return [2, {
|
|
99
|
+
data: data,
|
|
100
|
+
boardResponse: {
|
|
101
|
+
user: boardData === null || boardData === void 0 ? void 0 : boardData.user,
|
|
102
|
+
brand: boardData === null || boardData === void 0 ? void 0 : boardData.brand,
|
|
103
|
+
bank_account: boardData === null || boardData === void 0 ? void 0 : boardData.bank_account,
|
|
104
|
+
entity: boardData === null || boardData === void 0 ? void 0 : boardData.entity,
|
|
105
|
+
merchant: boardData === null || boardData === void 0 ? void 0 : boardData.merchant,
|
|
106
|
+
name: (_d = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _d === void 0 ? void 0 : _d.names,
|
|
107
|
+
contact: (_e = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _e === void 0 ? void 0 : _e.contact,
|
|
108
|
+
business: boardData === null || boardData === void 0 ? void 0 : boardData.business,
|
|
109
|
+
flows: (boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.info) || []
|
|
110
|
+
},
|
|
111
|
+
token: token
|
|
112
|
+
}];
|
|
113
|
+
}
|
|
114
|
+
});
|
|
110
115
|
});
|
|
111
|
-
});
|
|
116
|
+
});
|
|
112
117
|
export var resendOTP = createAsyncThunk('resendOTPBank', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
113
118
|
var bank, payload, data;
|
|
114
119
|
return __generator(this, function (_a) {
|
|
@@ -78,6 +78,8 @@ export var verifyLeadToken = createAsyncThunk('brandVerifyLeadToken', function (
|
|
|
78
78
|
throw new Error('Internal server error');
|
|
79
79
|
}
|
|
80
80
|
boardData = undefined;
|
|
81
|
+
if (isInternally)
|
|
82
|
+
data.step_name = BRAND_STEP_NAMES.BRAND_INFO;
|
|
81
83
|
if (!(data.step_name !== BRAND_STEP_NAMES.PHONE_AUTH || isInternally)) return [3, 7];
|
|
82
84
|
return [4, API.boardService.retrieveBoardInfoStatus(board_id)];
|
|
83
85
|
case 2:
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { RootState } from '../../../app/store';
|
|
2
2
|
import { EntityCapitalFormValues, EntityNameFormValues, FlowsTypes, OTPFormValues, ResponseData, SharedState } 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: {
|
|
@@ -14,7 +18,7 @@ export declare const verifyLeadToken: import("@reduxjs/toolkit").AsyncThunk<{
|
|
|
14
18
|
entityTypes: any;
|
|
15
19
|
};
|
|
16
20
|
token: string;
|
|
17
|
-
},
|
|
21
|
+
}, VerifyLeadTokenProps, {}>;
|
|
18
22
|
export declare const resendOTP: import("@reduxjs/toolkit").AsyncThunk<{
|
|
19
23
|
data: any;
|
|
20
24
|
}, void, {}>;
|
|
@@ -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, {}>;
|