@tap-payments/auth-jsconnect 2.10.2-beta → 2.10.6-beta
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/ArabicDatePicker/style.css +93 -93
- package/build/components/DatePicker/customStyle.css +86 -86
- package/build/constants/validation.d.ts +1 -0
- package/build/constants/validation.js +1 -0
- package/build/features/app/auth/authStore.js +38 -14
- package/build/features/app/business/businessStore.js +53 -29
- package/build/features/app/connect/connectStore.js +47 -35
- package/build/features/app/connectExpress/connectExpressStore.js +110 -62
- package/build/features/app/kyc/kycStore.js +49 -25
- package/build/features/business/screens/MobileOwnership/CollectMobileOwnership.js +3 -4
- package/build/features/connect/screens/MobileOwnership/CollectMobileOwnership.js +3 -4
- package/build/features/connectExpress/screens/MobileOwnership/CollectMobileOwnership.js +3 -4
- package/build/features/kyc/screens/Terms/Terms.js +8 -2
- package/build/features/kyc/screens/Users/Users.js +1 -1
- package/build/utils/error.d.ts +1 -0
- package/build/utils/error.js +3 -0
- package/package.json +1 -1
|
@@ -1,93 +1,93 @@
|
|
|
1
|
-
.rmdp-wrapper {
|
|
2
|
-
box-shadow: none !important;
|
|
3
|
-
width: 100% !important;
|
|
4
|
-
z-index: 0 !important;
|
|
5
|
-
}
|
|
6
|
-
.rmdp-day-picker {
|
|
7
|
-
padding-inline: 0px !important;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
.rmdp-day-picker > div {
|
|
11
|
-
width: 100%;
|
|
12
|
-
}
|
|
13
|
-
.rmdp-day {
|
|
14
|
-
color: #3a4154 !important;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.rmdp-calendar {
|
|
18
|
-
width: 100%;
|
|
19
|
-
padding: 0 !important;
|
|
20
|
-
padding-bottom: 15px !important;
|
|
21
|
-
padding-top: 12px !important;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.rmdp-day.rmdp-selected span:not(.highlight) {
|
|
25
|
-
/* background: radial-gradient(circle closest-side, #3a4154 0%, #3a4154 98%, rgba(0, 0, 0, 0) 100%) !important; */
|
|
26
|
-
color: #ffffff !important;
|
|
27
|
-
background-color: black !important;
|
|
28
|
-
}
|
|
29
|
-
.rmdp-week,
|
|
30
|
-
.rmdp-ym {
|
|
31
|
-
justify-content: start !important;
|
|
32
|
-
}
|
|
33
|
-
.rmdp-day span,
|
|
34
|
-
.rmdp-week-day {
|
|
35
|
-
flex: 0 0 14.2857%;
|
|
36
|
-
}
|
|
37
|
-
.rmdp-week-day {
|
|
38
|
-
color: #abaeb6 !important;
|
|
39
|
-
font-weight: 400 !important;
|
|
40
|
-
font-size: 0.75em !important;
|
|
41
|
-
text-transform: uppercase;
|
|
42
|
-
}
|
|
43
|
-
.rmdp-day:not(.rmdp-disabled):not(.rmdp-day-hidden) span:hover {
|
|
44
|
-
background-color: #fafafa !important;
|
|
45
|
-
/* border-radius: 50%; */
|
|
46
|
-
color: #3a4154 !important;
|
|
47
|
-
/* background: radial-gradient(circle closest-side, #fafafa 0, #fafafa 98%, transparent 100%) !important; */
|
|
48
|
-
}
|
|
49
|
-
.rmdp-day.rmdp-disabled {
|
|
50
|
-
background-color: #f0f0f0 !important;
|
|
51
|
-
}
|
|
52
|
-
.rmdp-day.rmdp-selected span:not(.highlight):hover {
|
|
53
|
-
color: #ffffff !important;
|
|
54
|
-
background-color: black !important;
|
|
55
|
-
}
|
|
56
|
-
.rmdp-arrow-container:hover {
|
|
57
|
-
background-color: unset !important;
|
|
58
|
-
box-shadow: unset !important;
|
|
59
|
-
}
|
|
60
|
-
.rmdp-arrow {
|
|
61
|
-
border: solid #000 !important;
|
|
62
|
-
border-width: 0 1px 1px 0 !important;
|
|
63
|
-
}
|
|
64
|
-
.rmdp-day.rmdp-today span {
|
|
65
|
-
background-color: unset !important;
|
|
66
|
-
color: #000 !important;
|
|
67
|
-
}
|
|
68
|
-
.rmdp-header {
|
|
69
|
-
margin-bottom: 12px;
|
|
70
|
-
}
|
|
71
|
-
.rmdp-day-picker .rmdp-day {
|
|
72
|
-
height: 40px !important;
|
|
73
|
-
width: 40px !important;
|
|
74
|
-
flex: 0 0 14.2857%;
|
|
75
|
-
}
|
|
76
|
-
.rmdp-day-picker .rmdp-day span {
|
|
77
|
-
height: 36px !important;
|
|
78
|
-
width: 36px !important;
|
|
79
|
-
}
|
|
80
|
-
.rmdp-month-picker .rmdp-ym .rmdp-day {
|
|
81
|
-
margin: unset;
|
|
82
|
-
}
|
|
83
|
-
.rmdp-month-picker .rmdp-ym .rmdp-day,
|
|
84
|
-
.rmdp-week-day {
|
|
85
|
-
height: 100%;
|
|
86
|
-
}
|
|
87
|
-
.rmdp-year-picker .rmdp-ym .rmdp-day {
|
|
88
|
-
margin: unset;
|
|
89
|
-
}
|
|
90
|
-
.rmdp-year-picker .rmdp-ym .rmdp-day,
|
|
91
|
-
.rmdp-week-day {
|
|
92
|
-
height: 100%;
|
|
93
|
-
}
|
|
1
|
+
.rmdp-wrapper {
|
|
2
|
+
box-shadow: none !important;
|
|
3
|
+
width: 100% !important;
|
|
4
|
+
z-index: 0 !important;
|
|
5
|
+
}
|
|
6
|
+
.rmdp-day-picker {
|
|
7
|
+
padding-inline: 0px !important;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.rmdp-day-picker > div {
|
|
11
|
+
width: 100%;
|
|
12
|
+
}
|
|
13
|
+
.rmdp-day {
|
|
14
|
+
color: #3a4154 !important;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.rmdp-calendar {
|
|
18
|
+
width: 100%;
|
|
19
|
+
padding: 0 !important;
|
|
20
|
+
padding-bottom: 15px !important;
|
|
21
|
+
padding-top: 12px !important;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.rmdp-day.rmdp-selected span:not(.highlight) {
|
|
25
|
+
/* background: radial-gradient(circle closest-side, #3a4154 0%, #3a4154 98%, rgba(0, 0, 0, 0) 100%) !important; */
|
|
26
|
+
color: #ffffff !important;
|
|
27
|
+
background-color: black !important;
|
|
28
|
+
}
|
|
29
|
+
.rmdp-week,
|
|
30
|
+
.rmdp-ym {
|
|
31
|
+
justify-content: start !important;
|
|
32
|
+
}
|
|
33
|
+
.rmdp-day span,
|
|
34
|
+
.rmdp-week-day {
|
|
35
|
+
flex: 0 0 14.2857%;
|
|
36
|
+
}
|
|
37
|
+
.rmdp-week-day {
|
|
38
|
+
color: #abaeb6 !important;
|
|
39
|
+
font-weight: 400 !important;
|
|
40
|
+
font-size: 0.75em !important;
|
|
41
|
+
text-transform: uppercase;
|
|
42
|
+
}
|
|
43
|
+
.rmdp-day:not(.rmdp-disabled):not(.rmdp-day-hidden) span:hover {
|
|
44
|
+
background-color: #fafafa !important;
|
|
45
|
+
/* border-radius: 50%; */
|
|
46
|
+
color: #3a4154 !important;
|
|
47
|
+
/* background: radial-gradient(circle closest-side, #fafafa 0, #fafafa 98%, transparent 100%) !important; */
|
|
48
|
+
}
|
|
49
|
+
.rmdp-day.rmdp-disabled {
|
|
50
|
+
background-color: #f0f0f0 !important;
|
|
51
|
+
}
|
|
52
|
+
.rmdp-day.rmdp-selected span:not(.highlight):hover {
|
|
53
|
+
color: #ffffff !important;
|
|
54
|
+
background-color: black !important;
|
|
55
|
+
}
|
|
56
|
+
.rmdp-arrow-container:hover {
|
|
57
|
+
background-color: unset !important;
|
|
58
|
+
box-shadow: unset !important;
|
|
59
|
+
}
|
|
60
|
+
.rmdp-arrow {
|
|
61
|
+
border: solid #000 !important;
|
|
62
|
+
border-width: 0 1px 1px 0 !important;
|
|
63
|
+
}
|
|
64
|
+
.rmdp-day.rmdp-today span {
|
|
65
|
+
background-color: unset !important;
|
|
66
|
+
color: #000 !important;
|
|
67
|
+
}
|
|
68
|
+
.rmdp-header {
|
|
69
|
+
margin-bottom: 12px;
|
|
70
|
+
}
|
|
71
|
+
.rmdp-day-picker .rmdp-day {
|
|
72
|
+
height: 40px !important;
|
|
73
|
+
width: 40px !important;
|
|
74
|
+
flex: 0 0 14.2857%;
|
|
75
|
+
}
|
|
76
|
+
.rmdp-day-picker .rmdp-day span {
|
|
77
|
+
height: 36px !important;
|
|
78
|
+
width: 36px !important;
|
|
79
|
+
}
|
|
80
|
+
.rmdp-month-picker .rmdp-ym .rmdp-day {
|
|
81
|
+
margin: unset;
|
|
82
|
+
}
|
|
83
|
+
.rmdp-month-picker .rmdp-ym .rmdp-day,
|
|
84
|
+
.rmdp-week-day {
|
|
85
|
+
height: 100%;
|
|
86
|
+
}
|
|
87
|
+
.rmdp-year-picker .rmdp-ym .rmdp-day {
|
|
88
|
+
margin: unset;
|
|
89
|
+
}
|
|
90
|
+
.rmdp-year-picker .rmdp-ym .rmdp-day,
|
|
91
|
+
.rmdp-week-day {
|
|
92
|
+
height: 100%;
|
|
93
|
+
}
|
|
@@ -1,86 +1,86 @@
|
|
|
1
|
-
.date_picker_input {
|
|
2
|
-
cursor: pointer;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
.react-calendar {
|
|
6
|
-
width: 100%;
|
|
7
|
-
border: none;
|
|
8
|
-
padding: 15px 0px 15px 0px;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
.react-calendar__navigation {
|
|
12
|
-
display: flex;
|
|
13
|
-
position: relative;
|
|
14
|
-
}
|
|
15
|
-
.react-calendar__navigation__label__labelText {
|
|
16
|
-
font-family: 'Lato', 'Roboto';
|
|
17
|
-
}
|
|
18
|
-
.react-calendar__navigation button:enabled:hover,
|
|
19
|
-
.react-calendar__navigation button:enabled:focus {
|
|
20
|
-
background-color: #ffffff;
|
|
21
|
-
}
|
|
22
|
-
.react-calendar__navigation__prev-button {
|
|
23
|
-
top: 20px;
|
|
24
|
-
left: 86px;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.react-calendar__navigation__next-button {
|
|
28
|
-
top: 0px;
|
|
29
|
-
left: 86px;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
.react-calendar__navigation__prev2-button {
|
|
33
|
-
top: 20px;
|
|
34
|
-
right: 13px;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
.react-calendar__navigation__next2-button {
|
|
38
|
-
top: 0px;
|
|
39
|
-
right: 13px;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
.react-calendar__navigation__arrow {
|
|
43
|
-
background-color: transparent !important;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
abbr[title] {
|
|
47
|
-
text-decoration: none;
|
|
48
|
-
font-weight: 400;
|
|
49
|
-
color: #abaeb6;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
.react-calendar__tile {
|
|
53
|
-
transition: all 0.5s ease;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
.react-calendar__tile:enabled:hover,
|
|
57
|
-
.react-calendar__tile:enabled:focus {
|
|
58
|
-
background-color: transparent;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
.react-calendar__tile:enabled:hover {
|
|
62
|
-
background: radial-gradient(circle closest-side, #fafafa 0%, #fafafa 98%, rgba(0, 0, 0, 0) 100%);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
.react-calendar__month-view__days__day--weekend,
|
|
66
|
-
.react-calendar__tile {
|
|
67
|
-
color: #3a4154;
|
|
68
|
-
}
|
|
69
|
-
.react-calendar__tile--hasActive {
|
|
70
|
-
background: radial-gradient(circle closest-side, #fafafa 0%, #fafafa 98%, rgba(0, 0, 0, 0) 100%);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
.react-calendar__tile--active,
|
|
74
|
-
.react-calendar__tile--active:enabled:hover,
|
|
75
|
-
.react-calendar__tile--active:enabled:focus {
|
|
76
|
-
background-color: transparent;
|
|
77
|
-
background: radial-gradient(circle closest-side, #3a4154 0%, #3a4154 98%, rgba(0, 0, 0, 0) 100%);
|
|
78
|
-
color: #ffffff;
|
|
79
|
-
}
|
|
80
|
-
.react-calendar__tile--now {
|
|
81
|
-
background-color: transparent;
|
|
82
|
-
}
|
|
83
|
-
.react-calendar__navigation button:disabled {
|
|
84
|
-
background-color: #ffffff;
|
|
85
|
-
color: #3a4154;
|
|
86
|
-
}
|
|
1
|
+
.date_picker_input {
|
|
2
|
+
cursor: pointer;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.react-calendar {
|
|
6
|
+
width: 100%;
|
|
7
|
+
border: none;
|
|
8
|
+
padding: 15px 0px 15px 0px;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.react-calendar__navigation {
|
|
12
|
+
display: flex;
|
|
13
|
+
position: relative;
|
|
14
|
+
}
|
|
15
|
+
.react-calendar__navigation__label__labelText {
|
|
16
|
+
font-family: 'Lato', 'Roboto';
|
|
17
|
+
}
|
|
18
|
+
.react-calendar__navigation button:enabled:hover,
|
|
19
|
+
.react-calendar__navigation button:enabled:focus {
|
|
20
|
+
background-color: #ffffff;
|
|
21
|
+
}
|
|
22
|
+
.react-calendar__navigation__prev-button {
|
|
23
|
+
top: 20px;
|
|
24
|
+
left: 86px;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.react-calendar__navigation__next-button {
|
|
28
|
+
top: 0px;
|
|
29
|
+
left: 86px;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.react-calendar__navigation__prev2-button {
|
|
33
|
+
top: 20px;
|
|
34
|
+
right: 13px;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.react-calendar__navigation__next2-button {
|
|
38
|
+
top: 0px;
|
|
39
|
+
right: 13px;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.react-calendar__navigation__arrow {
|
|
43
|
+
background-color: transparent !important;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
abbr[title] {
|
|
47
|
+
text-decoration: none;
|
|
48
|
+
font-weight: 400;
|
|
49
|
+
color: #abaeb6;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.react-calendar__tile {
|
|
53
|
+
transition: all 0.5s ease;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.react-calendar__tile:enabled:hover,
|
|
57
|
+
.react-calendar__tile:enabled:focus {
|
|
58
|
+
background-color: transparent;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.react-calendar__tile:enabled:hover {
|
|
62
|
+
background: radial-gradient(circle closest-side, #fafafa 0%, #fafafa 98%, rgba(0, 0, 0, 0) 100%);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.react-calendar__month-view__days__day--weekend,
|
|
66
|
+
.react-calendar__tile {
|
|
67
|
+
color: #3a4154;
|
|
68
|
+
}
|
|
69
|
+
.react-calendar__tile--hasActive {
|
|
70
|
+
background: radial-gradient(circle closest-side, #fafafa 0%, #fafafa 98%, rgba(0, 0, 0, 0) 100%);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.react-calendar__tile--active,
|
|
74
|
+
.react-calendar__tile--active:enabled:hover,
|
|
75
|
+
.react-calendar__tile--active:enabled:focus {
|
|
76
|
+
background-color: transparent;
|
|
77
|
+
background: radial-gradient(circle closest-side, #3a4154 0%, #3a4154 98%, rgba(0, 0, 0, 0) 100%);
|
|
78
|
+
color: #ffffff;
|
|
79
|
+
}
|
|
80
|
+
.react-calendar__tile--now {
|
|
81
|
+
background-color: transparent;
|
|
82
|
+
}
|
|
83
|
+
.react-calendar__navigation button:disabled {
|
|
84
|
+
background-color: #ffffff;
|
|
85
|
+
color: #3a4154;
|
|
86
|
+
}
|
|
@@ -57,10 +57,10 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
57
57
|
var _a;
|
|
58
58
|
import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
|
|
59
59
|
import { AuthForType, AuthTypeNumber, FlowsTypes, MigrationStatus } from '../../../@types';
|
|
60
|
-
import { ADD_NEW_ENTITY, AUTH_STEP_NAMES, COLLECT_DOB_INFO_NAFATH, IDENTIFICATION_TYPE, NAFATH_VERIFICATION_FAILED, SCOPE_AUTH, defaultCountry } from '../../../constants';
|
|
60
|
+
import { ADD_NEW_ENTITY, AUTH_STEP_NAMES, COLLECT_DOB_INFO_NAFATH, IDENTIFICATION_TYPE, NAFATH_PACI_TIMEOUT_DURATION, NAFATH_VERIFICATION_FAILED, SCOPE_AUTH, defaultCountry } from '../../../constants';
|
|
61
61
|
import API from '../../../api';
|
|
62
62
|
import { handleCurrentActiveScreen, handleNextScreenStep, handleOpen, handlePrevScreenStep, handleSetCountryByIso2 } from '../../../app/settings';
|
|
63
|
-
import { findCountryByIddPrefix, openConnect, sendCustomEventToGTM, sleep } from '../../../utils';
|
|
63
|
+
import { findCountryByIddPrefix, isNetworkError, isTimeoutError, openConnect, sendCustomEventToGTM, sleep } from '../../../utils';
|
|
64
64
|
export var updateBusinessCountry = createAsyncThunk('auth/updateBusinessCountry', function (countryCode, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
65
65
|
var auth, payload, data;
|
|
66
66
|
return __generator(this, function (_a) {
|
|
@@ -414,17 +414,29 @@ export var verifyNafath = createAsyncThunk('auth/verifyNafath', function (params
|
|
|
414
414
|
interval = 3;
|
|
415
415
|
maxCalls = Math.floor(expiry / interval);
|
|
416
416
|
_loop_1 = function (count) {
|
|
417
|
-
var data, isSuccess, isFailed, screen_1;
|
|
417
|
+
var data, error_1, isSuccess, isFailed, screen_1;
|
|
418
418
|
return __generator(this, function (_h) {
|
|
419
419
|
switch (_h.label) {
|
|
420
420
|
case 0:
|
|
421
421
|
if (thunkApi.signal.aborted) {
|
|
422
422
|
return [2, "break"];
|
|
423
423
|
}
|
|
424
|
-
|
|
424
|
+
data = void 0;
|
|
425
|
+
_h.label = 1;
|
|
425
426
|
case 1:
|
|
427
|
+
_h.trys.push([1, 3, , 4]);
|
|
428
|
+
return [4, API.authService.getVerifyAuth(authResponse === null || authResponse === void 0 ? void 0 : authResponse.auth_token, { timeout: NAFATH_PACI_TIMEOUT_DURATION })];
|
|
429
|
+
case 2:
|
|
426
430
|
data = _h.sent();
|
|
427
|
-
|
|
431
|
+
return [3, 4];
|
|
432
|
+
case 3:
|
|
433
|
+
error_1 = _h.sent();
|
|
434
|
+
if (!isNetworkError(error_1.message) && !isTimeoutError(error_1.message)) {
|
|
435
|
+
throw new Error(error_1);
|
|
436
|
+
}
|
|
437
|
+
return [3, 4];
|
|
438
|
+
case 4:
|
|
439
|
+
isSuccess = ((_b = data === null || data === void 0 ? void 0 : data.status) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === 'success';
|
|
428
440
|
isFailed = ((_c = data === null || data === void 0 ? void 0 : data.status) === null || _c === void 0 ? void 0 : _c.toLowerCase()) === 'failed';
|
|
429
441
|
if (isFailed) {
|
|
430
442
|
(_d = params.onFailure) === null || _d === void 0 ? void 0 : _d.call(params);
|
|
@@ -441,7 +453,7 @@ export var verifyNafath = createAsyncThunk('auth/verifyNafath', function (params
|
|
|
441
453
|
return [2, { value: data }];
|
|
442
454
|
}
|
|
443
455
|
return [4, sleep(interval * 1000)];
|
|
444
|
-
case
|
|
456
|
+
case 5:
|
|
445
457
|
_h.sent();
|
|
446
458
|
return [2];
|
|
447
459
|
}
|
|
@@ -521,7 +533,7 @@ export var createCivilIdAuth = createAsyncThunk('auth/createCivilAuth', function
|
|
|
521
533
|
});
|
|
522
534
|
}); });
|
|
523
535
|
export var verifyPACI = createAsyncThunk('auth/verifyPACI', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
524
|
-
var _a, settings, auth, authResponse, scope, expiry, interval, maxCalls, count, data, isSuccess;
|
|
536
|
+
var _a, settings, auth, authResponse, scope, expiry, interval, maxCalls, count, data, error_2, isSuccess;
|
|
525
537
|
var _b, _c, _d;
|
|
526
538
|
return __generator(this, function (_e) {
|
|
527
539
|
switch (_e.label) {
|
|
@@ -535,13 +547,25 @@ export var verifyPACI = createAsyncThunk('auth/verifyPACI', function (params, th
|
|
|
535
547
|
count = 1;
|
|
536
548
|
_e.label = 1;
|
|
537
549
|
case 1:
|
|
538
|
-
if (!(count <= maxCalls)) return [3,
|
|
550
|
+
if (!(count <= maxCalls)) return [3, 8];
|
|
539
551
|
if (thunkApi.signal.aborted) {
|
|
540
|
-
return [3,
|
|
552
|
+
return [3, 8];
|
|
541
553
|
}
|
|
542
|
-
|
|
554
|
+
data = void 0;
|
|
555
|
+
_e.label = 2;
|
|
543
556
|
case 2:
|
|
557
|
+
_e.trys.push([2, 4, , 5]);
|
|
558
|
+
return [4, API.authService.getVerifyAuth(authResponse === null || authResponse === void 0 ? void 0 : authResponse.auth_token, { timeout: NAFATH_PACI_TIMEOUT_DURATION })];
|
|
559
|
+
case 3:
|
|
544
560
|
data = _e.sent();
|
|
561
|
+
return [3, 5];
|
|
562
|
+
case 4:
|
|
563
|
+
error_2 = _e.sent();
|
|
564
|
+
if (!isNetworkError(error_2.message) && !isTimeoutError(error_2.message)) {
|
|
565
|
+
throw new Error(error_2);
|
|
566
|
+
}
|
|
567
|
+
return [3, 5];
|
|
568
|
+
case 5:
|
|
545
569
|
isSuccess = ((_b = data === null || data === void 0 ? void 0 : data.status) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === 'success';
|
|
546
570
|
if (isSuccess) {
|
|
547
571
|
if (scope === 'merchant') {
|
|
@@ -553,13 +577,13 @@ export var verifyPACI = createAsyncThunk('auth/verifyPACI', function (params, th
|
|
|
553
577
|
return [2, data];
|
|
554
578
|
}
|
|
555
579
|
return [4, sleep(interval * 1000)];
|
|
556
|
-
case
|
|
580
|
+
case 6:
|
|
557
581
|
_e.sent();
|
|
558
|
-
_e.label =
|
|
559
|
-
case
|
|
582
|
+
_e.label = 7;
|
|
583
|
+
case 7:
|
|
560
584
|
count++;
|
|
561
585
|
return [3, 1];
|
|
562
|
-
case
|
|
586
|
+
case 8: throw new Error('paci_verification_failed');
|
|
563
587
|
}
|
|
564
588
|
});
|
|
565
589
|
}); });
|
|
@@ -58,8 +58,8 @@ var _a;
|
|
|
58
58
|
import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
|
|
59
59
|
import API from '../../../api';
|
|
60
60
|
import { BusinessType, FlowsTypes, DocumentPurpose, LicenseType } from '../../../@types';
|
|
61
|
-
import { BUSINESS_STEP_NAMES, COLLECT_DOB_INFO_NAFATH, EXPECTED_SALES_LIST, IDENTIFICATION_TYPE, NAFATH_VERIFICATION_FAILED, OTHER_CR_LICENSE, OTHER_ENTITY_LICENSE, OTHER_FL_LICENSE, defaultCountry } from '../../../constants';
|
|
62
|
-
import { convertNumbers2English, hasKey, sleep, isKW, isSA, dateFormat, isOtherLicense, isOtherThanKWOrSA, hasNoneEditableValue, sendCustomEventToGTM, findCountryByIddPrefix } from '../../../utils';
|
|
61
|
+
import { BUSINESS_STEP_NAMES, COLLECT_DOB_INFO_NAFATH, EXPECTED_SALES_LIST, IDENTIFICATION_TYPE, NAFATH_PACI_TIMEOUT_DURATION, NAFATH_VERIFICATION_FAILED, OTHER_CR_LICENSE, OTHER_ENTITY_LICENSE, OTHER_FL_LICENSE, defaultCountry } from '../../../constants';
|
|
62
|
+
import { convertNumbers2English, hasKey, sleep, isKW, isSA, dateFormat, isOtherLicense, isOtherThanKWOrSA, hasNoneEditableValue, sendCustomEventToGTM, findCountryByIddPrefix, isNetworkError, isTimeoutError } from '../../../utils';
|
|
63
63
|
import { handleNextScreenStep, handlePublicKey, handleSetCountryByIso2 } from '../../../app/settings';
|
|
64
64
|
export var verifyLeadToken = createAsyncThunk('businessVerifyLeadToken', function (token, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
65
65
|
var payload, data, publicKey, countryIso2, boardData, brandData, isicActivityList, leadData, _a, steps, brand, board_id, business_id, entity, brandID, hasBusinessCompleted, hasBusinessCRInfoCompleted, hasBusinessCRActivitiesCompleted, hasBusinessCustomersCompleted, list, list;
|
|
@@ -316,7 +316,7 @@ export var verifyLeadOTP = createAsyncThunk('verifyLeadOTP', function (params, t
|
|
|
316
316
|
});
|
|
317
317
|
}); });
|
|
318
318
|
export var verifyNafath = createAsyncThunk('business/verifyNafathParams', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
319
|
-
var _a, settings, business, responseBody, expiry, interval, maxCalls, count, data, isSuccess, isFailed, isNextScreenDob, isNextScreenCollectMobileOwnership, screen_1;
|
|
319
|
+
var _a, settings, business, responseBody, expiry, interval, maxCalls, count, data, error_1, isSuccess, isFailed, isNextScreenDob, isNextScreenCollectMobileOwnership, screen_1;
|
|
320
320
|
var _b, _c, _d, _e, _f, _g;
|
|
321
321
|
return __generator(this, function (_h) {
|
|
322
322
|
switch (_h.label) {
|
|
@@ -332,24 +332,36 @@ export var verifyNafath = createAsyncThunk('business/verifyNafathParams', functi
|
|
|
332
332
|
count = 1;
|
|
333
333
|
_h.label = 1;
|
|
334
334
|
case 1:
|
|
335
|
-
if (!(count <= maxCalls)) return [3,
|
|
336
|
-
|
|
335
|
+
if (!(count <= maxCalls)) return [3, 11];
|
|
336
|
+
data = undefined;
|
|
337
|
+
_h.label = 2;
|
|
337
338
|
case 2:
|
|
339
|
+
_h.trys.push([2, 4, , 5]);
|
|
340
|
+
return [4, API.authService.getTokenVerify(responseBody === null || responseBody === void 0 ? void 0 : responseBody.verify_token, { timeout: NAFATH_PACI_TIMEOUT_DURATION })];
|
|
341
|
+
case 3:
|
|
338
342
|
data = _h.sent();
|
|
339
|
-
|
|
340
|
-
|
|
343
|
+
return [3, 5];
|
|
344
|
+
case 4:
|
|
345
|
+
error_1 = _h.sent();
|
|
346
|
+
if (!isNetworkError(error_1.message) && !isTimeoutError(error_1.message)) {
|
|
347
|
+
throw new Error(error_1);
|
|
348
|
+
}
|
|
349
|
+
return [3, 5];
|
|
350
|
+
case 5:
|
|
351
|
+
isSuccess = ((_b = data === null || data === void 0 ? void 0 : data.status) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === 'success';
|
|
352
|
+
isFailed = ((_c = data === null || data === void 0 ? void 0 : data.status) === null || _c === void 0 ? void 0 : _c.toLowerCase()) === 'failed';
|
|
341
353
|
if (isFailed) {
|
|
342
354
|
(_d = params.onFailure) === null || _d === void 0 ? void 0 : _d.call(params);
|
|
343
355
|
return [2, { response: data }];
|
|
344
356
|
}
|
|
345
|
-
if (!isSuccess) return [3,
|
|
357
|
+
if (!isSuccess) return [3, 8];
|
|
346
358
|
return [4, thunkApi.dispatch(retrieveEntityList({ leadId: responseBody === null || responseBody === void 0 ? void 0 : responseBody.id }))];
|
|
347
|
-
case
|
|
359
|
+
case 6:
|
|
348
360
|
_h.sent();
|
|
349
361
|
(_f = (_e = settings.data.appConfig).onStepCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, settings.data.activeScreen.name, {});
|
|
350
362
|
(_g = params === null || params === void 0 ? void 0 : params.onSuccess) === null || _g === void 0 ? void 0 : _g.call(params);
|
|
351
363
|
return [4, sleep(3000)];
|
|
352
|
-
case
|
|
364
|
+
case 7:
|
|
353
365
|
_h.sent();
|
|
354
366
|
isNextScreenDob = data.step_name === COLLECT_DOB_INFO_NAFATH;
|
|
355
367
|
isNextScreenCollectMobileOwnership = data.step_name === BUSINESS_STEP_NAMES.BUSINESS_MOBILE_OWNERSHIP;
|
|
@@ -361,18 +373,18 @@ export var verifyNafath = createAsyncThunk('business/verifyNafathParams', functi
|
|
|
361
373
|
thunkApi.dispatch(handleNextScreenStep(screen_1));
|
|
362
374
|
}
|
|
363
375
|
return [2, { response: data, isNextScreenDob: isNextScreenDob }];
|
|
364
|
-
case
|
|
365
|
-
case
|
|
376
|
+
case 8: return [4, sleep(interval * 1000)];
|
|
377
|
+
case 9:
|
|
366
378
|
_h.sent();
|
|
367
|
-
_h.label =
|
|
368
|
-
case
|
|
379
|
+
_h.label = 10;
|
|
380
|
+
case 10:
|
|
369
381
|
count++;
|
|
370
382
|
return [3, 1];
|
|
371
|
-
case
|
|
383
|
+
case 11: throw new Error(NAFATH_VERIFICATION_FAILED);
|
|
372
384
|
}
|
|
373
385
|
});
|
|
374
386
|
}); });
|
|
375
|
-
export var updateLeadMobile = createAsyncThunk('
|
|
387
|
+
export var updateLeadMobile = createAsyncThunk('business/updateLeadMobile', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
376
388
|
var _a, settings, business, lead_id, payload, leadResponse, isNextScreenDob, screen;
|
|
377
389
|
var _b, _c;
|
|
378
390
|
return __generator(this, function (_d) {
|
|
@@ -405,7 +417,7 @@ export var updateLeadMobile = createAsyncThunk('connect/updateLeadMobile', funct
|
|
|
405
417
|
}
|
|
406
418
|
});
|
|
407
419
|
}); });
|
|
408
|
-
export var skipUpdateLeadMobile = createAsyncThunk('
|
|
420
|
+
export var skipUpdateLeadMobile = createAsyncThunk('business/skipUpdateLeadMobile', function (_, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
409
421
|
var _a, settings, business, lead_id, payload, leadResponse, isNextScreenDob, screen;
|
|
410
422
|
var _b, _c;
|
|
411
423
|
return __generator(this, function (_d) {
|
|
@@ -430,7 +442,7 @@ export var skipUpdateLeadMobile = createAsyncThunk('connect/skipUpdateLeadMobile
|
|
|
430
442
|
});
|
|
431
443
|
}); });
|
|
432
444
|
export var verifyPACI = createAsyncThunk('businessVerifyPACI', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
433
|
-
var _a, settings, business, responseBody, _b, business_id, entity, expiry, interval, maxCalls, count, data, isSuccess;
|
|
445
|
+
var _a, settings, business, responseBody, _b, business_id, entity, expiry, interval, maxCalls, count, data, error_2, isSuccess;
|
|
434
446
|
var _c, _d, _e, _f;
|
|
435
447
|
return __generator(this, function (_g) {
|
|
436
448
|
switch (_g.label) {
|
|
@@ -447,30 +459,42 @@ export var verifyPACI = createAsyncThunk('businessVerifyPACI', function (params,
|
|
|
447
459
|
count = 1;
|
|
448
460
|
_g.label = 1;
|
|
449
461
|
case 1:
|
|
450
|
-
if (!(count <= maxCalls)) return [3,
|
|
451
|
-
|
|
462
|
+
if (!(count <= maxCalls)) return [3, 11];
|
|
463
|
+
data = undefined;
|
|
464
|
+
_g.label = 2;
|
|
452
465
|
case 2:
|
|
466
|
+
_g.trys.push([2, 4, , 5]);
|
|
467
|
+
return [4, API.authService.getTokenVerify(responseBody === null || responseBody === void 0 ? void 0 : responseBody.verify_token, { timeout: NAFATH_PACI_TIMEOUT_DURATION })];
|
|
468
|
+
case 3:
|
|
453
469
|
data = _g.sent();
|
|
454
|
-
|
|
455
|
-
|
|
470
|
+
return [3, 5];
|
|
471
|
+
case 4:
|
|
472
|
+
error_2 = _g.sent();
|
|
473
|
+
if (!isNetworkError(error_2.message) && !isTimeoutError(error_2.message)) {
|
|
474
|
+
throw new Error(error_2);
|
|
475
|
+
}
|
|
476
|
+
return [3, 5];
|
|
477
|
+
case 5:
|
|
478
|
+
isSuccess = ((_c = data === null || data === void 0 ? void 0 : data.status) === null || _c === void 0 ? void 0 : _c.toLowerCase()) === 'success';
|
|
479
|
+
if (!isSuccess) return [3, 8];
|
|
456
480
|
return [4, thunkApi.dispatch(retrieveAllEntityList({ businessId: business_id, entityId: entity === null || entity === void 0 ? void 0 : entity.id }))];
|
|
457
|
-
case
|
|
481
|
+
case 6:
|
|
458
482
|
_g.sent();
|
|
459
483
|
(_e = (_d = settings.data.appConfig).onStepCompleted) === null || _e === void 0 ? void 0 : _e.call(_d, settings.data.activeScreen.name, {});
|
|
460
484
|
(_f = params === null || params === void 0 ? void 0 : params.onSuccess) === null || _f === void 0 ? void 0 : _f.call(params);
|
|
461
485
|
return [4, sleep(3000)];
|
|
462
|
-
case
|
|
486
|
+
case 7:
|
|
463
487
|
_g.sent();
|
|
464
488
|
thunkApi.dispatch(handleNextScreenStep());
|
|
465
489
|
return [2, { response: data }];
|
|
466
|
-
case
|
|
467
|
-
case
|
|
490
|
+
case 8: return [4, sleep(interval * 1000)];
|
|
491
|
+
case 9:
|
|
468
492
|
_g.sent();
|
|
469
|
-
_g.label =
|
|
470
|
-
case
|
|
493
|
+
_g.label = 10;
|
|
494
|
+
case 10:
|
|
471
495
|
count++;
|
|
472
496
|
return [3, 1];
|
|
473
|
-
case
|
|
497
|
+
case 11: throw new Error('paci_verification_failed');
|
|
474
498
|
}
|
|
475
499
|
});
|
|
476
500
|
}); });
|