@tap-payments/auth-jsconnect 2.0.116-test → 2.0.117-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/components/Lottie/Lottie.js +1 -1
- package/build/features/app/bank/bankStore.js +16 -13
- package/build/features/app/business/businessStore.js +7 -7
- package/build/features/app/connect/connectStore.js +1 -1
- package/build/features/app/entity/entityStore.js +5 -2
- package/build/features/app/individual/individualStore.js +7 -5
- package/build/features/app/tax/taxStore.js +15 -12
- package/build/features/business/screens/VerifyPACI/VerifyPACI.js +4 -2
- package/build/features/business/screens/VerifyPACI/VerifyPACILoading.d.ts +1 -0
- package/build/features/business/screens/VerifyPACI/VerifyPACILoading.js +3 -2
- package/build/features/connect/screens/CivilID/CivilID.js +13 -1
- package/build/features/connect/screens/Merchant/SocialMedia.js +2 -2
- package/build/features/connect/screens/Mobile/Mobile.js +16 -7
- package/build/features/connect/screens/VerifyPACI/VerifyPACI.js +1 -1
- package/build/features/connect/screens/VerifyPACI/VerifyPACILoading.d.ts +1 -0
- package/build/features/connect/screens/VerifyPACI/VerifyPACILoading.js +3 -2
- package/package.json +1 -1
|
@@ -46,7 +46,7 @@ var LottieFile = function (_a) {
|
|
|
46
46
|
return function () {
|
|
47
47
|
anim.destroy();
|
|
48
48
|
};
|
|
49
|
-
}, []);
|
|
49
|
+
}, [loop, lottieContainer.current]);
|
|
50
50
|
return (_jsx(_Fragment, { children: _jsx("div", __assign({ ref: lottieContainer, style: {
|
|
51
51
|
width: width || '100%',
|
|
52
52
|
height: height || '100%'
|
|
@@ -49,13 +49,13 @@ var _a;
|
|
|
49
49
|
import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
|
|
50
50
|
import API from '../../../api';
|
|
51
51
|
import { FlowsTypes } from '../../../@types';
|
|
52
|
-
import { handleCurrentActiveScreen, handleNextScreenStep } from '../../../app/settings';
|
|
52
|
+
import { handleCurrentActiveScreen, handleNextScreenStep, handleSetCountryByIso2 } from '../../../app/settings';
|
|
53
53
|
import { BANK_STEP_NAMES, BUSINESS_FLOW_SUCCESS } from '../../../constants';
|
|
54
54
|
export var verifyLeadToken = createAsyncThunk('bankVerifyLeadToken', function (token, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
55
|
-
var payload, data, boardInfoData, boardData, board_id, board_info_id, info, hasBankCompleted;
|
|
56
|
-
var _a, _b, _c;
|
|
57
|
-
return __generator(this, function (
|
|
58
|
-
switch (
|
|
55
|
+
var payload, data, boardInfoData, boardData, board_id, board_info_id, countryIso2, info, hasBankCompleted;
|
|
56
|
+
var _a, _b, _c, _d;
|
|
57
|
+
return __generator(this, function (_e) {
|
|
58
|
+
switch (_e.label) {
|
|
59
59
|
case 0:
|
|
60
60
|
payload = {
|
|
61
61
|
service_name: 'tap_email',
|
|
@@ -63,7 +63,7 @@ export var verifyLeadToken = createAsyncThunk('bankVerifyLeadToken', function (t
|
|
|
63
63
|
};
|
|
64
64
|
return [4, API.leadService.verifyLeadToken(payload)];
|
|
65
65
|
case 1:
|
|
66
|
-
data = (
|
|
66
|
+
data = (_e.sent()).data;
|
|
67
67
|
boardData = undefined;
|
|
68
68
|
if (!(!(data === null || data === void 0 ? void 0 : data.errors) && !(data === null || data === void 0 ? void 0 : data.mw_error))) return [3, 5];
|
|
69
69
|
board_id = data === null || data === void 0 ? void 0 : data.id;
|
|
@@ -71,13 +71,16 @@ export var verifyLeadToken = createAsyncThunk('bankVerifyLeadToken', function (t
|
|
|
71
71
|
if (!(!!board_id && !!board_info_id)) return [3, 3];
|
|
72
72
|
return [4, API.boardService.retrieveBoardInfo({ id: board_id, infoId: board_info_id })];
|
|
73
73
|
case 2:
|
|
74
|
-
boardInfoData =
|
|
75
|
-
|
|
74
|
+
boardInfoData = _e.sent();
|
|
75
|
+
_e.label = 3;
|
|
76
76
|
case 3: return [4, API.boardService.retrieveBoardDetails(board_id)];
|
|
77
77
|
case 4:
|
|
78
|
-
boardData =
|
|
78
|
+
boardData = _e.sent();
|
|
79
|
+
countryIso2 = (_a = boardData === null || boardData === void 0 ? void 0 : boardData.entity) === null || _a === void 0 ? void 0 : _a.country;
|
|
80
|
+
if (countryIso2)
|
|
81
|
+
thunkApi.dispatch(handleSetCountryByIso2(countryIso2));
|
|
79
82
|
info = boardInfoData.info;
|
|
80
|
-
hasBankCompleted = ((
|
|
83
|
+
hasBankCompleted = ((_b = info === null || info === void 0 ? void 0 : info.find(function (flow) { return flow.name === 'bank'; })) === null || _b === void 0 ? void 0 : _b.status) === 'completed';
|
|
81
84
|
if (data.step_name === BANK_STEP_NAMES.PHONE_AUTH) {
|
|
82
85
|
thunkApi.dispatch(handleCurrentActiveScreen('BANK_VERIFY_STEP'));
|
|
83
86
|
}
|
|
@@ -87,7 +90,7 @@ export var verifyLeadToken = createAsyncThunk('bankVerifyLeadToken', function (t
|
|
|
87
90
|
else if (data.step_name === BANK_STEP_NAMES.BANK_INFO) {
|
|
88
91
|
thunkApi.dispatch(handleNextScreenStep('BANK_BANK_DETAILS_STEP'));
|
|
89
92
|
}
|
|
90
|
-
|
|
93
|
+
_e.label = 5;
|
|
91
94
|
case 5: return [2, {
|
|
92
95
|
data: data,
|
|
93
96
|
boardResponse: {
|
|
@@ -96,8 +99,8 @@ export var verifyLeadToken = createAsyncThunk('bankVerifyLeadToken', function (t
|
|
|
96
99
|
bank_account: boardData === null || boardData === void 0 ? void 0 : boardData.bank_account,
|
|
97
100
|
entity: boardData === null || boardData === void 0 ? void 0 : boardData.entity,
|
|
98
101
|
merchant: boardData === null || boardData === void 0 ? void 0 : boardData.merchant,
|
|
99
|
-
name: (
|
|
100
|
-
contact: (
|
|
102
|
+
name: (_c = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _c === void 0 ? void 0 : _c.names,
|
|
103
|
+
contact: (_d = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _d === void 0 ? void 0 : _d.contact,
|
|
101
104
|
business: boardData === null || boardData === void 0 ? void 0 : boardData.business,
|
|
102
105
|
flows: BUSINESS_FLOW_SUCCESS.concat(boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.info)
|
|
103
106
|
},
|
|
@@ -84,7 +84,8 @@ export var verifyLeadToken = createAsyncThunk('businessVerifyLeadToken', functio
|
|
|
84
84
|
case 2:
|
|
85
85
|
leadResponse = _h.sent();
|
|
86
86
|
countryIso2 = (_a = leadResponse === null || leadResponse === void 0 ? void 0 : leadResponse.data) === null || _a === void 0 ? void 0 : _a.country_code;
|
|
87
|
-
|
|
87
|
+
if (countryIso2)
|
|
88
|
+
thunkApi.dispatch(handleSetCountryByIso2(countryIso2));
|
|
88
89
|
if (data.step_name === BUSINESS_STEP_NAMES.IDENTITY_AUTH && isKW(countryIso2)) {
|
|
89
90
|
thunkApi.dispatch(handleNextScreenStep('BUSINESS_CIVIL_ID_STEP'));
|
|
90
91
|
}
|
|
@@ -211,7 +212,8 @@ export var verifyLeadOTP = createAsyncThunk('verifyLeadOTP', function (params, t
|
|
|
211
212
|
_b = (leadResponse === null || leadResponse === void 0 ? void 0 : leadResponse.data) || {}, brand = _b.brand, country_code = _b.country_code, steps = _b.steps, board_id = _b.board_id, board_info_id = _b.board_info_id;
|
|
212
213
|
brandID = brand === null || brand === void 0 ? void 0 : brand.id;
|
|
213
214
|
countryIso2 = country_code;
|
|
214
|
-
|
|
215
|
+
if (countryIso2)
|
|
216
|
+
thunkApi.dispatch(handleSetCountryByIso2(countryIso2));
|
|
215
217
|
(_h = (_g = settings.data.appConfig).onStepCompleted) === null || _h === void 0 ? void 0 : _h.call(_g, settings.data.activeScreen.name, { otp: params.otp });
|
|
216
218
|
hasBusinessCompleted = hasKey(steps, BUSINESS_STEP_NAMES.BUSINESS_SUCCESS);
|
|
217
219
|
hasBusinessCRInfoCompleted = hasKey(steps, BUSINESS_STEP_NAMES.BUSINESS_CR_INFO) && hasKey(steps, BUSINESS_STEP_NAMES.BUSINESS_INFO_CONFIRM);
|
|
@@ -285,7 +287,7 @@ export var verifyLeadOTP = createAsyncThunk('verifyLeadOTP', function (params, t
|
|
|
285
287
|
});
|
|
286
288
|
}); });
|
|
287
289
|
export var verifyPACI = createAsyncThunk('businessVerifyPACI', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
288
|
-
var _a, settings, business, responseBody, expiry, interval, maxCalls,
|
|
290
|
+
var _a, settings, business, responseBody, expiry, interval, maxCalls, count, data, isSuccess;
|
|
289
291
|
var _b, _c, _d, _e;
|
|
290
292
|
return __generator(this, function (_f) {
|
|
291
293
|
switch (_f.label) {
|
|
@@ -295,7 +297,6 @@ export var verifyPACI = createAsyncThunk('businessVerifyPACI', function (params,
|
|
|
295
297
|
expiry = (responseBody === null || responseBody === void 0 ? void 0 : responseBody.expiry) || 120;
|
|
296
298
|
interval = 5;
|
|
297
299
|
maxCalls = Math.floor(expiry / interval);
|
|
298
|
-
response = null;
|
|
299
300
|
if (thunkApi.signal.aborted) {
|
|
300
301
|
return [2, { response: null }];
|
|
301
302
|
}
|
|
@@ -306,7 +307,6 @@ export var verifyPACI = createAsyncThunk('businessVerifyPACI', function (params,
|
|
|
306
307
|
return [4, API.authService.getTokenVerify(responseBody === null || responseBody === void 0 ? void 0 : responseBody.verify_token)];
|
|
307
308
|
case 2:
|
|
308
309
|
data = _f.sent();
|
|
309
|
-
response = data;
|
|
310
310
|
isSuccess = ((_b = data.status) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === 'success';
|
|
311
311
|
if (!isSuccess) return [3, 4];
|
|
312
312
|
(_d = (_c = settings.data.appConfig).onStepCompleted) === null || _d === void 0 ? void 0 : _d.call(_c, settings.data.activeScreen.name, {});
|
|
@@ -314,7 +314,7 @@ export var verifyPACI = createAsyncThunk('businessVerifyPACI', function (params,
|
|
|
314
314
|
case 3:
|
|
315
315
|
_f.sent();
|
|
316
316
|
thunkApi.dispatch(handleNextScreenStep());
|
|
317
|
-
return [
|
|
317
|
+
return [2, { response: data }];
|
|
318
318
|
case 4: return [4, sleep(interval * 1000)];
|
|
319
319
|
case 5:
|
|
320
320
|
_f.sent();
|
|
@@ -322,7 +322,7 @@ export var verifyPACI = createAsyncThunk('businessVerifyPACI', function (params,
|
|
|
322
322
|
case 6:
|
|
323
323
|
count++;
|
|
324
324
|
return [3, 1];
|
|
325
|
-
case 7:
|
|
325
|
+
case 7: throw new Error('paci_verification_failed');
|
|
326
326
|
}
|
|
327
327
|
});
|
|
328
328
|
}); });
|
|
@@ -380,7 +380,7 @@ export var verifyPACI = createAsyncThunk('connect/verifyPACI', function (params,
|
|
|
380
380
|
case 16:
|
|
381
381
|
count++;
|
|
382
382
|
return [3, 1];
|
|
383
|
-
case 17: throw new Error('
|
|
383
|
+
case 17: throw new Error('paci_verification_failed');
|
|
384
384
|
}
|
|
385
385
|
});
|
|
386
386
|
}); });
|
|
@@ -49,12 +49,12 @@ var _a;
|
|
|
49
49
|
import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
|
|
50
50
|
import API from '../../../api';
|
|
51
51
|
import { FlowsTypes } from '../../../@types';
|
|
52
|
-
import { handleNextScreenStep } from '../../../app/settings';
|
|
52
|
+
import { handleNextScreenStep, handleSetCountryByIso2 } from '../../../app/settings';
|
|
53
53
|
import { ENTITY_STEP_NAMES } from '../../../constants';
|
|
54
54
|
import moment from 'moment';
|
|
55
55
|
import { convertNumbers2English } from '../../../utils';
|
|
56
56
|
export var verifyLeadToken = createAsyncThunk('entityVerifyLeadToken', function (token, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
57
|
-
var payload, data, boardData, entityData, boardInfoData, board_id, board_info_id, entityId, info, hasEntityCompleted;
|
|
57
|
+
var payload, data, boardData, entityData, boardInfoData, board_id, board_info_id, entityId, countryIso2, info, hasEntityCompleted;
|
|
58
58
|
var _a, _b, _c, _d;
|
|
59
59
|
return __generator(this, function (_e) {
|
|
60
60
|
switch (_e.label) {
|
|
@@ -90,6 +90,9 @@ export var verifyLeadToken = createAsyncThunk('entityVerifyLeadToken', function
|
|
|
90
90
|
entityData = _e.sent();
|
|
91
91
|
_e.label = 7;
|
|
92
92
|
case 7:
|
|
93
|
+
countryIso2 = entityData.country;
|
|
94
|
+
if (countryIso2)
|
|
95
|
+
thunkApi.dispatch(handleSetCountryByIso2(countryIso2));
|
|
93
96
|
info = boardInfoData.info;
|
|
94
97
|
hasEntityCompleted = ((_b = info === null || info === void 0 ? void 0 : info.find(function (flow) { return flow.name === 'entity'; })) === null || _b === void 0 ? void 0 : _b.status) === 'completed';
|
|
95
98
|
if (hasEntityCompleted) {
|
|
@@ -49,7 +49,7 @@ var _a;
|
|
|
49
49
|
import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
|
|
50
50
|
import API from '../../../api';
|
|
51
51
|
import { FlowsTypes } from '../../../@types';
|
|
52
|
-
import { handleNextScreenStep } from '../../../app/settings';
|
|
52
|
+
import { handleNextScreenStep, handleSetCountryByIso2 } from '../../../app/settings';
|
|
53
53
|
import { BUSINESS_FLOW_SUCCESS, INDIVIDUAl_STEP_NAMES } from '../../../constants';
|
|
54
54
|
export var verifyLeadToken = createAsyncThunk('individualVerifyLeadToken', function (token, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
55
55
|
var payload, settings, data, boardData, individualData, countryCode, boardInfoData, countries, board_id, board_info_id, notification, _a, id, type, info, hasIndividualCompleted;
|
|
@@ -89,7 +89,9 @@ export var verifyLeadToken = createAsyncThunk('individualVerifyLeadToken', funct
|
|
|
89
89
|
boardData = _f.sent();
|
|
90
90
|
_f.label = 6;
|
|
91
91
|
case 6:
|
|
92
|
-
countryCode = (_b =
|
|
92
|
+
countryCode = (_b = boardData === null || boardData === void 0 ? void 0 : boardData.entity) === null || _b === void 0 ? void 0 : _b.country;
|
|
93
|
+
if (countryCode)
|
|
94
|
+
thunkApi.dispatch(handleSetCountryByIso2(countryCode));
|
|
93
95
|
info = boardInfoData.info;
|
|
94
96
|
hasIndividualCompleted = ((_c = info === null || info === void 0 ? void 0 : info.find(function (flow) { return flow.name === 'individual'; })) === null || _c === void 0 ? void 0 : _c.status) === 'completed';
|
|
95
97
|
if (!hasIndividualCompleted) return [3, 7];
|
|
@@ -222,7 +224,7 @@ export var verifyLeadOTP = createAsyncThunk('verifyIndividualLeadOTP', function
|
|
|
222
224
|
boardData = _l.sent();
|
|
223
225
|
_l.label = 6;
|
|
224
226
|
case 6:
|
|
225
|
-
countryCode = (_e =
|
|
227
|
+
countryCode = (_e = boardData === null || boardData === void 0 ? void 0 : boardData.entity) === null || _e === void 0 ? void 0 : _e.country;
|
|
226
228
|
info = boardInfoData.info;
|
|
227
229
|
hasIndividualCompleted = ((_f = info === null || info === void 0 ? void 0 : info.find(function (flow) { return flow.name === 'individual'; })) === null || _f === void 0 ? void 0 : _f.status) === 'completed';
|
|
228
230
|
(_h = (_g = settings.data.appConfig).onStepCompleted) === null || _h === void 0 ? void 0 : _h.call(_g, settings.data.activeScreen.name, { otp: params.otp });
|
|
@@ -371,7 +373,7 @@ export var individualSlice = createSlice({
|
|
|
371
373
|
}
|
|
372
374
|
state.data.verify.responseBody = __assign(__assign(__assign(__assign({}, data), state.data.verify.responseBody), boardResponse), { board_id: data.id });
|
|
373
375
|
state.data.verify.token = token;
|
|
374
|
-
var _c = boardResponse || {}, countries = _c.countries, user = _c.user;
|
|
376
|
+
var _c = boardResponse || {}, countries = _c.countries, user = _c.user, countryCode = _c.countryCode;
|
|
375
377
|
var _d = user || {}, source_income = _d.source_income, monthly_income = _d.monthly_income, occupation = _d.occupation, is_relative_PEP = _d.is_relative_PEP, is_influencer = _d.is_influencer;
|
|
376
378
|
var _e = state.data.individualData.responseBody || {}, sourceIncomeList = _e.sourceIncomeList, monthlyIncomeList = _e.monthlyIncomeList, occupationList = _e.occupationList;
|
|
377
379
|
var selectedSourceIncome = (sourceIncomeList === null || sourceIncomeList === void 0 ? void 0 : sourceIncomeList.find(function (source) { var _a; return (source === null || source === void 0 ? void 0 : source.id) === ((_a = source_income === null || source_income === void 0 ? void 0 : source_income[0]) === null || _a === void 0 ? void 0 : _a.id); })) ||
|
|
@@ -382,7 +384,7 @@ export var individualSlice = createSlice({
|
|
|
382
384
|
(monthlyIncomeList === null || monthlyIncomeList === void 0 ? void 0 : monthlyIncomeList[2]);
|
|
383
385
|
if (!!selectedMonthlyIncome)
|
|
384
386
|
state.data.individualData.monthlyIncome = selectedMonthlyIncome;
|
|
385
|
-
var code = user === null || user === void 0 ? void 0 : user.employer_country;
|
|
387
|
+
var code = (user === null || user === void 0 ? void 0 : user.employer_country) || countryCode;
|
|
386
388
|
if (!!code) {
|
|
387
389
|
var employerLocation = (countries || []).find(function (country) { return country.iso2 === code; });
|
|
388
390
|
state.data.individualData.employerLocation = employerLocation;
|
|
@@ -50,13 +50,13 @@ import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
|
|
|
50
50
|
import API from '../../../api';
|
|
51
51
|
import { FlowsTypes } from '../../../@types';
|
|
52
52
|
import { hasKey } from '../../../utils';
|
|
53
|
-
import { handleNextScreenStep, handleCurrentActiveScreen } from '../../../app/settings';
|
|
53
|
+
import { handleNextScreenStep, handleCurrentActiveScreen, handleSetCountryByIso2 } from '../../../app/settings';
|
|
54
54
|
import { BUSINESS_FLOW_SUCCESS, TAX_STEP_NAMES } from '../../../constants';
|
|
55
55
|
export var verifyLeadToken = createAsyncThunk('taxVerifyLeadToken', function (token, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
56
|
-
var payload, data, boardData, boardInfoData, info, hasTaxCompleted;
|
|
57
|
-
var _a, _b;
|
|
58
|
-
return __generator(this, function (
|
|
59
|
-
switch (
|
|
56
|
+
var payload, data, boardData, boardInfoData, info, countryIso2, hasTaxCompleted;
|
|
57
|
+
var _a, _b, _c;
|
|
58
|
+
return __generator(this, function (_d) {
|
|
59
|
+
switch (_d.label) {
|
|
60
60
|
case 0:
|
|
61
61
|
payload = {
|
|
62
62
|
service_name: 'tap_email',
|
|
@@ -64,20 +64,23 @@ export var verifyLeadToken = createAsyncThunk('taxVerifyLeadToken', function (to
|
|
|
64
64
|
};
|
|
65
65
|
return [4, API.leadService.verifyLeadToken(payload)];
|
|
66
66
|
case 1:
|
|
67
|
-
data = (
|
|
67
|
+
data = (_d.sent()).data;
|
|
68
68
|
boardInfoData = undefined;
|
|
69
69
|
if (!(!(data === null || data === void 0 ? void 0 : data.errors) && !(data === null || data === void 0 ? void 0 : data.mw_error))) return [3, 5];
|
|
70
70
|
if (!(!!data.id && !!data.board_info_id)) return [3, 3];
|
|
71
71
|
return [4, API.boardService.retrieveBoardInfo({ id: data.id, infoId: data.board_info_id })];
|
|
72
72
|
case 2:
|
|
73
|
-
boardInfoData =
|
|
74
|
-
|
|
73
|
+
boardInfoData = _d.sent();
|
|
74
|
+
_d.label = 3;
|
|
75
75
|
case 3:
|
|
76
76
|
info = boardInfoData.info;
|
|
77
77
|
return [4, API.boardService.retrieveBoardDetails(data === null || data === void 0 ? void 0 : data.id)];
|
|
78
78
|
case 4:
|
|
79
|
-
boardData =
|
|
80
|
-
|
|
79
|
+
boardData = _d.sent();
|
|
80
|
+
countryIso2 = (_a = boardData === null || boardData === void 0 ? void 0 : boardData.entity) === null || _a === void 0 ? void 0 : _a.country;
|
|
81
|
+
if (countryIso2)
|
|
82
|
+
thunkApi.dispatch(handleSetCountryByIso2(countryIso2));
|
|
83
|
+
hasTaxCompleted = ((_b = info === null || info === void 0 ? void 0 : info.find(function (flow) { return flow.name === 'tax'; })) === null || _b === void 0 ? void 0 : _b.status) === 'completed';
|
|
81
84
|
if (hasTaxCompleted) {
|
|
82
85
|
thunkApi.dispatch(handleNextScreenStep('TAX_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
|
|
83
86
|
}
|
|
@@ -87,10 +90,10 @@ export var verifyLeadToken = createAsyncThunk('taxVerifyLeadToken', function (to
|
|
|
87
90
|
else if (data.step_name === TAX_STEP_NAMES.TAX_INFO) {
|
|
88
91
|
thunkApi.dispatch(handleNextScreenStep('TAX_TAX_DETAILS_STEP'));
|
|
89
92
|
}
|
|
90
|
-
|
|
93
|
+
_d.label = 5;
|
|
91
94
|
case 5: return [2, {
|
|
92
95
|
data: data,
|
|
93
|
-
boardResponse: __assign(__assign({}, boardData === null || boardData === void 0 ? void 0 : boardData.business), { flows: BUSINESS_FLOW_SUCCESS.concat(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: (
|
|
96
|
+
boardResponse: __assign(__assign({}, boardData === null || boardData === void 0 ? void 0 : boardData.business), { flows: BUSINESS_FLOW_SUCCESS.concat(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: (_c = boardData === null || boardData === void 0 ? void 0 : boardData.entity) === null || _c === void 0 ? void 0 : _c.vat_id, merchant: boardData === null || boardData === void 0 ? void 0 : boardData.merchant }),
|
|
94
97
|
token: token
|
|
95
98
|
}];
|
|
96
99
|
}
|
|
@@ -56,6 +56,8 @@ import { handlePrevScreenStep } from '../../../../app/settings';
|
|
|
56
56
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
57
57
|
import { MobileButton } from '../../../shared/Button';
|
|
58
58
|
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
59
|
+
import Collapse from '../../../../components/Collapse';
|
|
60
|
+
import Warning from '../../../../components/Warning';
|
|
59
61
|
import { mobileOS, sleep } from '../../../../utils';
|
|
60
62
|
import VerifyPACILoading from './VerifyPACILoading';
|
|
61
63
|
import VerifyPACISuccess from './VerifyPACISuccess';
|
|
@@ -110,7 +112,7 @@ var VerifyPACI = function () {
|
|
|
110
112
|
var _a = React.useState(false), success = _a[0], setSuccess = _a[1];
|
|
111
113
|
var _b = React.useState(false), isReady = _b[0], setIsReady = _b[1];
|
|
112
114
|
var dispatch = useAppDispatch();
|
|
113
|
-
var
|
|
115
|
+
var _c = useAppSelector(businessSelector), data = _c.data, error = _c.error;
|
|
114
116
|
var responseBody = data.civilIdData.responseBody;
|
|
115
117
|
var t = useTranslation().t;
|
|
116
118
|
var onSuccess = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -152,6 +154,6 @@ var VerifyPACI = function () {
|
|
|
152
154
|
var os = React.useMemo(function () { return mobileOS(); }, []);
|
|
153
155
|
var isAndroid = React.useMemo(function () { return os === 'Android' && (responseBody === null || responseBody === void 0 ? void 0 : responseBody.app_url_ios); }, [os, responseBody]);
|
|
154
156
|
var isIOS = React.useMemo(function () { return os === 'iOS' && (responseBody === null || responseBody === void 0 ? void 0 : responseBody.app_url_ios); }, [os, responseBody]);
|
|
155
|
-
return (_jsxs(ScreenContainer, __assign({ sx: { mb: 2.5 } }, { children: [_jsxs(VerifyPACITitleContainerStyled, { children: [_jsx(Container, { children: success ? _jsx(VerifyPACISuccess, {}) : _jsx(VerifyPACILoading, {}) }), _jsx(VerifyPACITitleStyled, { children: t('authenticate_kuwait_mobile_title') }), _jsx(VerifyPACISubTitleStyled, { children: t('authenticate_kuwait_mobile_description') })] }), (isAndroid || isIOS) && (_jsx(MobileButton, __assign({ onClick: onRedirect, hideIcon: true }, { children: t('Open Kuwait Mobile ID') }))), _jsx(BackButton, __assign({ onClick: onBack }, { children: t('back') }))] })));
|
|
157
|
+
return (_jsxs(ScreenContainer, __assign({ sx: { mb: 2.5 } }, { children: [_jsxs(VerifyPACITitleContainerStyled, { children: [_jsx(Container, { children: success ? _jsx(VerifyPACISuccess, {}) : _jsx(VerifyPACILoading, { loop: !error }) }), _jsx(VerifyPACITitleStyled, { children: t('authenticate_kuwait_mobile_title') }), _jsx(VerifyPACISubTitleStyled, { children: t('authenticate_kuwait_mobile_description') })] }), _jsx(Collapse, __assign({ in: !!error, sx: { width: '100%' } }, { children: _jsx(Warning, { children: t(error) }) })), (isAndroid || isIOS) && (_jsx(MobileButton, __assign({ onClick: onRedirect, hideIcon: true }, { children: t('Open Kuwait Mobile ID') }))), _jsx(BackButton, __assign({ onClick: onBack }, { children: t('back') }))] })));
|
|
156
158
|
};
|
|
157
159
|
export default React.memo(VerifyPACI);
|
|
@@ -15,8 +15,9 @@ var IconStyled = styled(Icon)(function (_a) {
|
|
|
15
15
|
height: 64
|
|
16
16
|
});
|
|
17
17
|
});
|
|
18
|
-
var VerifyPACILoading = function () {
|
|
19
|
-
|
|
18
|
+
var VerifyPACILoading = function (_a) {
|
|
19
|
+
var _b = _a.loop, loop = _b === void 0 ? true : _b;
|
|
20
|
+
return (_jsxs(_Fragment, { children: [_jsx(LottieFile, { file: LottieAnimationFiles.pulsating_circle_waves, loop: loop, width: '90%' }), _jsx(IconStyled, { src: ICONS_NAMES.PACI_VERIFY_ICON })] }));
|
|
20
21
|
};
|
|
21
22
|
VerifyPACILoading.defaultProps = {};
|
|
22
23
|
export default memo(VerifyPACILoading);
|
|
@@ -9,6 +9,17 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
9
|
};
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
12
23
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
24
|
import * as React from 'react';
|
|
14
25
|
import { useTranslation } from 'react-i18next';
|
|
@@ -61,9 +72,10 @@ var CivilID = function (_a) {
|
|
|
61
72
|
var t = useTranslation().t;
|
|
62
73
|
var _b = useAppSelector(connectSelector), data = _b.data, loading = _b.loading, error = _b.error;
|
|
63
74
|
var settingsStore = useAppSelector(settingsSelector);
|
|
75
|
+
var _c = data.civilIdData, responseBody = _c.responseBody, defaultValues = __rest(_c, ["responseBody"]);
|
|
64
76
|
var methods = useForm({
|
|
65
77
|
resolver: yupResolver(civilIDValidationSchema),
|
|
66
|
-
defaultValues:
|
|
78
|
+
defaultValues: defaultValues,
|
|
67
79
|
mode: 'onChange'
|
|
68
80
|
});
|
|
69
81
|
React.useEffect(function () {
|
|
@@ -62,8 +62,8 @@ var ToggleIconStyled = styled(Icon, {
|
|
|
62
62
|
})(function (_a) {
|
|
63
63
|
var theme = _a.theme, isActive = _a.isActive;
|
|
64
64
|
return ({
|
|
65
|
-
width: theme.spacing(
|
|
66
|
-
height: theme.spacing(
|
|
65
|
+
width: theme.spacing(3),
|
|
66
|
+
height: theme.spacing(3),
|
|
67
67
|
filter: isActive ? 'invert(1) sepia(1) saturate(5) hue-rotate(175deg)' : ''
|
|
68
68
|
});
|
|
69
69
|
});
|
|
@@ -9,6 +9,17 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
9
|
};
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
12
23
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
24
|
import * as React from 'react';
|
|
14
25
|
import Box from '@mui/material/Box';
|
|
@@ -80,12 +91,10 @@ var Mobile = function (_a) {
|
|
|
80
91
|
var _d = React.useState(), listType = _d[0], setListType = _d[1];
|
|
81
92
|
var _e = data.mobileData, countryCode = _e.countryCode, mobile = _e.mobile;
|
|
82
93
|
var dispatch = useAppDispatch();
|
|
94
|
+
var _f = data.mobileData, responseBody = _f.responseBody, defaultValues = __rest(_f, ["responseBody"]);
|
|
83
95
|
var methods = useForm({
|
|
84
96
|
resolver: yupResolver(PhoneValidationSchema),
|
|
85
|
-
defaultValues:
|
|
86
|
-
mobile: mobile || '',
|
|
87
|
-
countryCode: countryCode
|
|
88
|
-
},
|
|
97
|
+
defaultValues: defaultValues,
|
|
89
98
|
mode: 'onChange'
|
|
90
99
|
});
|
|
91
100
|
var t = useTranslation().t;
|
|
@@ -94,10 +103,10 @@ var Mobile = function (_a) {
|
|
|
94
103
|
setListType(flag);
|
|
95
104
|
};
|
|
96
105
|
React.useEffect(function () {
|
|
97
|
-
if (countryCode && !methods.getValues('countryCode')) {
|
|
98
|
-
methods.setValue('countryCode', countryCode);
|
|
106
|
+
if (defaultValues.countryCode && !methods.getValues('countryCode')) {
|
|
107
|
+
methods.setValue('countryCode', defaultValues.countryCode);
|
|
99
108
|
}
|
|
100
|
-
}, [
|
|
109
|
+
}, [defaultValues]);
|
|
101
110
|
React.useEffect(function () {
|
|
102
111
|
dispatch(resetOTPScreen());
|
|
103
112
|
}, []);
|
|
@@ -154,6 +154,6 @@ var VerifyPACI = function () {
|
|
|
154
154
|
var os = React.useMemo(function () { return mobileOS(); }, []);
|
|
155
155
|
var isAndroid = React.useMemo(function () { return os === 'Android' && (responseBody === null || responseBody === void 0 ? void 0 : responseBody.app_url_ios); }, [os, responseBody]);
|
|
156
156
|
var isIOS = React.useMemo(function () { return os === 'iOS' && (responseBody === null || responseBody === void 0 ? void 0 : responseBody.app_url_ios); }, [os, responseBody]);
|
|
157
|
-
return (_jsxs(ScreenContainer, __assign({ sx: { mb: 2.5 } }, { children: [_jsxs(VerifyPACITitleContainerStyled, { children: [_jsx(Container, { children: success ? _jsx(VerifyPACISuccess, {}) : _jsx(VerifyPACILoading, {}) }), _jsx(VerifyPACITitleStyled, { children: t('authenticate_kuwait_mobile_title') }), _jsx(VerifyPACISubTitleStyled, { children: t('authenticate_kuwait_mobile_description') })] }), _jsx(Collapse, __assign({ in: !!error, sx: { width: '100%' } }, { children: _jsx(Warning, { children: t(error) }) })), (isAndroid || isIOS) && (_jsx(MobileButton, __assign({ onClick: onRedirect, hideIcon: true }, { children: t('Open Kuwait Mobile ID') }))), _jsx(BackButton, __assign({ onClick: onBack }, { children: t('back') }))] })));
|
|
157
|
+
return (_jsxs(ScreenContainer, __assign({ sx: { mb: 2.5 } }, { children: [_jsxs(VerifyPACITitleContainerStyled, { children: [_jsx(Container, { children: success ? _jsx(VerifyPACISuccess, {}) : _jsx(VerifyPACILoading, { loop: !error }) }), _jsx(VerifyPACITitleStyled, { children: t('authenticate_kuwait_mobile_title') }), _jsx(VerifyPACISubTitleStyled, { children: t('authenticate_kuwait_mobile_description') })] }), _jsx(Collapse, __assign({ in: !!error, sx: { width: '100%' } }, { children: _jsx(Warning, { children: t(error) }) })), (isAndroid || isIOS) && (_jsx(MobileButton, __assign({ onClick: onRedirect, hideIcon: true }, { children: t('Open Kuwait Mobile ID') }))), _jsx(BackButton, __assign({ onClick: onBack }, { children: t('back') }))] })));
|
|
158
158
|
};
|
|
159
159
|
export default React.memo(VerifyPACI);
|
|
@@ -15,8 +15,9 @@ var IconStyled = styled(Icon)(function (_a) {
|
|
|
15
15
|
height: 64
|
|
16
16
|
});
|
|
17
17
|
});
|
|
18
|
-
var VerifyPACILoading = function () {
|
|
19
|
-
|
|
18
|
+
var VerifyPACILoading = function (_a) {
|
|
19
|
+
var _b = _a.loop, loop = _b === void 0 ? true : _b;
|
|
20
|
+
return (_jsxs(_Fragment, { children: [_jsx(LottieFile, { file: LottieAnimationFiles.pulsating_circle_waves, loop: loop, width: '90%' }), _jsx(IconStyled, { src: ICONS_NAMES.PACI_VERIFY_ICON })] }));
|
|
20
21
|
};
|
|
21
22
|
VerifyPACILoading.defaultProps = {};
|
|
22
23
|
export default memo(VerifyPACILoading);
|