@tap-payments/auth-jsconnect 2.1.1-test → 2.1.3-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/features/app/business/businessStore.js +18 -11
- package/build/features/app/entity/entityStore.js +12 -5
- package/build/features/app/individual/individualStore.js +9 -3
- package/build/features/app/tax/taxStore.js +3 -0
- package/build/features/bank/screens/Success/Success.js +7 -3
- package/build/features/entity/screens/Success/Success.js +7 -3
- package/build/features/individual/screens/Success/Success.js +7 -3
- package/build/features/shared/SuccessScreen/SuccessScreen.js +2 -1
- package/build/features/tax/screens/Success/Success.js +9 -3
- package/package.json +1 -1
|
@@ -78,14 +78,21 @@ export var verifyLeadToken = createAsyncThunk('businessVerifyLeadToken', functio
|
|
|
78
78
|
leadResponse = undefined;
|
|
79
79
|
brandInfo = undefined;
|
|
80
80
|
boardResponse = undefined;
|
|
81
|
+
countryIso2 = undefined;
|
|
81
82
|
if (!(!(data === null || data === void 0 ? void 0 : data.errors) && !(data === null || data === void 0 ? void 0 : data.mw_error))) return [3, 18];
|
|
83
|
+
if (data === null || data === void 0 ? void 0 : data.country_code) {
|
|
84
|
+
countryIso2 = data === null || data === void 0 ? void 0 : data.country_code;
|
|
85
|
+
thunkApi.dispatch(handleSetCountryByIso2(countryIso2));
|
|
86
|
+
}
|
|
82
87
|
if (!(data.step_name !== BUSINESS_STEP_NAMES.PHONE_AUTH)) return [3, 18];
|
|
83
88
|
return [4, API.leadService.retrieveLead(data === null || data === void 0 ? void 0 : data.id)];
|
|
84
89
|
case 2:
|
|
85
90
|
leadResponse = _h.sent();
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
91
|
+
if (!countryIso2) {
|
|
92
|
+
countryIso2 = (_a = leadResponse === null || leadResponse === void 0 ? void 0 : leadResponse.data) === null || _a === void 0 ? void 0 : _a.country_code;
|
|
93
|
+
if (countryIso2)
|
|
94
|
+
thunkApi.dispatch(handleSetCountryByIso2(countryIso2));
|
|
95
|
+
}
|
|
89
96
|
if (data.step_name === BUSINESS_STEP_NAMES.IDENTITY_AUTH && isKW(countryIso2)) {
|
|
90
97
|
thunkApi.dispatch(handleNextScreenStep('BUSINESS_CIVIL_ID_STEP'));
|
|
91
98
|
}
|
|
@@ -821,10 +828,10 @@ export var businessSlice = createSlice({
|
|
|
821
828
|
state.error = null;
|
|
822
829
|
})
|
|
823
830
|
.addCase(verifyLeadOTP.fulfilled, function (state, action) {
|
|
824
|
-
var _a, _b, _c, _d
|
|
831
|
+
var _a, _b, _c, _d;
|
|
825
832
|
state.loading = false;
|
|
826
833
|
state.error = null;
|
|
827
|
-
var
|
|
834
|
+
var _e = action.payload, data = _e.data, formData = _e.formData, brandInfo = _e.brandInfo, leadData = _e.leadData;
|
|
828
835
|
var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
|
|
829
836
|
if (description) {
|
|
830
837
|
state.error = description;
|
|
@@ -832,11 +839,11 @@ export var businessSlice = createSlice({
|
|
|
832
839
|
}
|
|
833
840
|
state.data.otpData = formData;
|
|
834
841
|
state.data.otpData.responseBody = data;
|
|
835
|
-
state.data.verify.responseBody = __assign(__assign(__assign({}, state.data.verify.responseBody),
|
|
836
|
-
var
|
|
842
|
+
state.data.verify.responseBody = __assign(__assign(__assign({}, leadData), state.data.verify.responseBody), { flows: leadData === null || leadData === void 0 ? void 0 : leadData.flows });
|
|
843
|
+
var _f = leadData || {}, entity = _f.entity, entity_activities = _f.entity_activities, business_type = _f.business_type, business_name = _f.business_name;
|
|
837
844
|
var issuingDate = (brandInfo === null || brandInfo === void 0 ? void 0 : brandInfo.business_operation_start_at)
|
|
838
845
|
? brandInfo === null || brandInfo === void 0 ? void 0 : brandInfo.business_operation_start_at
|
|
839
|
-
: (
|
|
846
|
+
: (_b = entity === null || entity === void 0 ? void 0 : entity.license) === null || _b === void 0 ? void 0 : _b.issuing_date;
|
|
840
847
|
if (!!issuingDate) {
|
|
841
848
|
var formattedDate = moment(issuingDate).format('YYYY-MM-DD');
|
|
842
849
|
state.data.activitiesData.operationStartDate = convertNumbers2English(formattedDate);
|
|
@@ -851,13 +858,13 @@ export var businessSlice = createSlice({
|
|
|
851
858
|
state.data.businessTypeData.responseBody = __assign(__assign({}, state.data.businessTypeData.responseBody), { entity_id: entity === null || entity === void 0 ? void 0 : entity.id, activities: activities });
|
|
852
859
|
state.data.businessTypeData.entityLegalName = (business_name === null || business_name === void 0 ? void 0 : business_name.en) || '';
|
|
853
860
|
if (!!(entity === null || entity === void 0 ? void 0 : entity.license)) {
|
|
854
|
-
var licenseNumber_2 = (
|
|
855
|
-
var
|
|
861
|
+
var licenseNumber_2 = (_c = entity === null || entity === void 0 ? void 0 : entity.license) === null || _c === void 0 ? void 0 : _c.number;
|
|
862
|
+
var _g = state.data.businessTypeData || {}, responseBody = _g.responseBody, selectedLicense = _g.selectedLicense;
|
|
856
863
|
var licenseList = (responseBody || {}).licenseList;
|
|
857
864
|
var selectedLicenseData = selectedLicense;
|
|
858
865
|
if (!!licenseNumber_2) {
|
|
859
866
|
selectedLicenseData =
|
|
860
|
-
((
|
|
867
|
+
((_d = licenseList === null || licenseList === void 0 ? void 0 : licenseList.find) === null || _d === void 0 ? void 0 : _d.call(licenseList, function (_a) {
|
|
861
868
|
var license = _a.license;
|
|
862
869
|
return (license === null || license === void 0 ? void 0 : license.number) === licenseNumber_2;
|
|
863
870
|
})) ||
|
|
@@ -54,7 +54,7 @@ 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,
|
|
57
|
+
var payload, data, boardData, entityData, boardInfoData, countryIso2, board_id, board_info_id, entityId, info, hasEntityCompleted;
|
|
58
58
|
var _a, _b, _c, _d;
|
|
59
59
|
return __generator(this, function (_e) {
|
|
60
60
|
switch (_e.label) {
|
|
@@ -66,8 +66,13 @@ export var verifyLeadToken = createAsyncThunk('entityVerifyLeadToken', function
|
|
|
66
66
|
return [4, API.leadService.verifyLeadToken(payload)];
|
|
67
67
|
case 1:
|
|
68
68
|
data = (_e.sent()).data;
|
|
69
|
-
|
|
69
|
+
countryIso2 = undefined;
|
|
70
70
|
if (!(!(data === null || data === void 0 ? void 0 : data.errors) && !(data === null || data === void 0 ? void 0 : data.mw_error))) return [3, 8];
|
|
71
|
+
if (data === null || data === void 0 ? void 0 : data.country_code) {
|
|
72
|
+
countryIso2 = data === null || data === void 0 ? void 0 : data.country_code;
|
|
73
|
+
if (countryIso2)
|
|
74
|
+
thunkApi.dispatch(handleSetCountryByIso2(countryIso2));
|
|
75
|
+
}
|
|
71
76
|
if (!(data.step_name !== ENTITY_STEP_NAMES.PHONE_AUTH)) return [3, 8];
|
|
72
77
|
board_id = data === null || data === void 0 ? void 0 : data.id;
|
|
73
78
|
board_info_id = data === null || data === void 0 ? void 0 : data.board_info_id;
|
|
@@ -90,9 +95,11 @@ export var verifyLeadToken = createAsyncThunk('entityVerifyLeadToken', function
|
|
|
90
95
|
entityData = _e.sent();
|
|
91
96
|
_e.label = 7;
|
|
92
97
|
case 7:
|
|
93
|
-
countryIso2
|
|
94
|
-
|
|
95
|
-
|
|
98
|
+
if (!countryIso2) {
|
|
99
|
+
countryIso2 = entityData.country;
|
|
100
|
+
if (countryIso2)
|
|
101
|
+
thunkApi.dispatch(handleSetCountryByIso2(countryIso2));
|
|
102
|
+
}
|
|
96
103
|
info = boardInfoData.info;
|
|
97
104
|
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';
|
|
98
105
|
if (hasEntityCompleted) {
|
|
@@ -68,6 +68,10 @@ export var verifyLeadToken = createAsyncThunk('individualVerifyLeadToken', funct
|
|
|
68
68
|
boardInfoData = undefined;
|
|
69
69
|
countries = settings.data.countries;
|
|
70
70
|
if (!(!(data === null || data === void 0 ? void 0 : data.errors) && !(data === null || data === void 0 ? void 0 : data.mw_error))) return [3, 10];
|
|
71
|
+
if (data === null || data === void 0 ? void 0 : data.country_code) {
|
|
72
|
+
countryCode = data === null || data === void 0 ? void 0 : data.country_code;
|
|
73
|
+
thunkApi.dispatch(handleSetCountryByIso2(countryCode));
|
|
74
|
+
}
|
|
71
75
|
if (!(data.step_name !== INDIVIDUAl_STEP_NAMES.PHONE_AUTH)) return [3, 10];
|
|
72
76
|
board_id = data === null || data === void 0 ? void 0 : data.id;
|
|
73
77
|
board_info_id = data === null || data === void 0 ? void 0 : data.board_info_id;
|
|
@@ -89,9 +93,11 @@ export var verifyLeadToken = createAsyncThunk('individualVerifyLeadToken', funct
|
|
|
89
93
|
boardData = _f.sent();
|
|
90
94
|
_f.label = 6;
|
|
91
95
|
case 6:
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
96
|
+
if (!countryCode) {
|
|
97
|
+
countryCode = (_b = boardData === null || boardData === void 0 ? void 0 : boardData.entity) === null || _b === void 0 ? void 0 : _b.country;
|
|
98
|
+
if (countryCode)
|
|
99
|
+
thunkApi.dispatch(handleSetCountryByIso2(countryCode));
|
|
100
|
+
}
|
|
95
101
|
info = boardInfoData.info;
|
|
96
102
|
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';
|
|
97
103
|
if (!hasIndividualCompleted) return [3, 7];
|
|
@@ -354,6 +354,7 @@ export var taxSlice = createSlice({
|
|
|
354
354
|
.addCase(updateLeadSuccess.fulfilled, function (state, action) {
|
|
355
355
|
var _a;
|
|
356
356
|
state.loading = false;
|
|
357
|
+
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { updateBoardSuccessLoading: false });
|
|
357
358
|
state.error = null;
|
|
358
359
|
var response = (action.payload || {}).response;
|
|
359
360
|
var description = (((_a = response === null || response === void 0 ? void 0 : response.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
|
|
@@ -366,10 +367,12 @@ export var taxSlice = createSlice({
|
|
|
366
367
|
})
|
|
367
368
|
.addCase(updateLeadSuccess.pending, function (state) {
|
|
368
369
|
state.loading = true;
|
|
370
|
+
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { updateBoardSuccessLoading: true });
|
|
369
371
|
state.error = null;
|
|
370
372
|
})
|
|
371
373
|
.addCase(updateLeadSuccess.rejected, function (state, action) {
|
|
372
374
|
state.loading = false;
|
|
375
|
+
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { updateBoardSuccessLoading: false });
|
|
373
376
|
state.error = action.error.message;
|
|
374
377
|
});
|
|
375
378
|
}
|
|
@@ -7,10 +7,14 @@ import { bankSelector, updateBoardSuccess } from '../../../app/bank/bankStore';
|
|
|
7
7
|
var Success = function (_a) {
|
|
8
8
|
var t = useTranslation().t;
|
|
9
9
|
var dispatch = useAppDispatch();
|
|
10
|
-
var _b = useAppSelector(bankSelector),
|
|
11
|
-
var
|
|
10
|
+
var _b = useAppSelector(bankSelector), error = _b.error, loading = _b.loading;
|
|
11
|
+
var _c = React.useState(false), clicked = _c[0], setClicked = _c[1];
|
|
12
|
+
React.useEffect(function () {
|
|
12
13
|
dispatch(updateBoardSuccess());
|
|
14
|
+
}, []);
|
|
15
|
+
var onSuccess = function () {
|
|
16
|
+
setClicked(true);
|
|
13
17
|
};
|
|
14
|
-
return (_jsx(SuccessScreen, { title: t('bank_success_title'), onSuccess: onSuccess, successTitle: t('continue'), loading: loading, error: error || '' }));
|
|
18
|
+
return (_jsx(SuccessScreen, { title: t('bank_success_title'), onSuccess: onSuccess, successTitle: t('continue'), loading: clicked && loading, error: error || '' }));
|
|
15
19
|
};
|
|
16
20
|
export default React.memo(Success);
|
|
@@ -7,10 +7,14 @@ import SuccessScreen from '../../../shared/SuccessScreen';
|
|
|
7
7
|
var Success = function (_a) {
|
|
8
8
|
var t = useTranslation().t;
|
|
9
9
|
var dispatch = useAppDispatch();
|
|
10
|
-
var _b = useAppSelector(entitySelector),
|
|
11
|
-
var
|
|
10
|
+
var _b = useAppSelector(entitySelector), error = _b.error, loading = _b.loading;
|
|
11
|
+
var _c = React.useState(false), clicked = _c[0], setClicked = _c[1];
|
|
12
|
+
React.useEffect(function () {
|
|
12
13
|
dispatch(updateBoardSuccess());
|
|
14
|
+
}, []);
|
|
15
|
+
var onSuccess = function () {
|
|
16
|
+
setClicked(true);
|
|
13
17
|
};
|
|
14
|
-
return (_jsx(SuccessScreen, { title: t('entity_success_title'), onSuccess: onSuccess, successTitle: t('continue'), loading: loading, error: error || '' }));
|
|
18
|
+
return (_jsx(SuccessScreen, { title: t('entity_success_title'), onSuccess: onSuccess, successTitle: t('continue'), loading: clicked && loading, error: error || '' }));
|
|
15
19
|
};
|
|
16
20
|
export default React.memo(Success);
|
|
@@ -7,10 +7,14 @@ import SuccessScreen from '../../../shared/SuccessScreen';
|
|
|
7
7
|
var Success = function (_a) {
|
|
8
8
|
var t = useTranslation().t;
|
|
9
9
|
var dispatch = useAppDispatch();
|
|
10
|
-
var _b = useAppSelector(individualSelector),
|
|
11
|
-
var
|
|
10
|
+
var _b = useAppSelector(individualSelector), error = _b.error, loading = _b.loading;
|
|
11
|
+
var _c = React.useState(false), clicked = _c[0], setClicked = _c[1];
|
|
12
|
+
React.useEffect(function () {
|
|
12
13
|
dispatch(updateBoardSuccess());
|
|
14
|
+
}, []);
|
|
15
|
+
var onSuccess = function () {
|
|
16
|
+
setClicked(true);
|
|
13
17
|
};
|
|
14
|
-
return (_jsx(SuccessScreen, { title: t('individual_success_title'), onSuccess: onSuccess, successTitle: t('continue'), loading: loading, error: error || '' }));
|
|
18
|
+
return (_jsx(SuccessScreen, { title: t('individual_success_title'), onSuccess: onSuccess, successTitle: t('continue'), loading: clicked && loading, error: error || '' }));
|
|
15
19
|
};
|
|
16
20
|
export default React.memo(Success);
|
|
@@ -36,7 +36,8 @@ var ContainerStyled = styled(Container)(function (_a) {
|
|
|
36
36
|
return ({
|
|
37
37
|
justifyContent: 'space-between',
|
|
38
38
|
minHeight: theme.spacing(30),
|
|
39
|
-
alignItems: 'center'
|
|
39
|
+
alignItems: 'center',
|
|
40
|
+
pointerEvents: 'auto'
|
|
40
41
|
});
|
|
41
42
|
});
|
|
42
43
|
var IconStyled = styled(Icon)(function (_a) {
|
|
@@ -7,10 +7,16 @@ import SuccessScreen from '../../../shared/SuccessScreen';
|
|
|
7
7
|
var Success = function (_a) {
|
|
8
8
|
var t = useTranslation().t;
|
|
9
9
|
var dispatch = useAppDispatch();
|
|
10
|
-
var _b = useAppSelector(taxSelector),
|
|
11
|
-
var
|
|
10
|
+
var _b = useAppSelector(taxSelector), error = _b.error, data = _b.data;
|
|
11
|
+
var _c = React.useState(false), clicked = _c[0], setClicked = _c[1];
|
|
12
|
+
var responseBody = data.verify.responseBody;
|
|
13
|
+
var updateBoardSuccessLoading = (responseBody || {}).updateBoardSuccessLoading;
|
|
14
|
+
React.useEffect(function () {
|
|
12
15
|
dispatch(updateLeadSuccess());
|
|
16
|
+
}, []);
|
|
17
|
+
var onSuccess = function () {
|
|
18
|
+
setClicked(true);
|
|
13
19
|
};
|
|
14
|
-
return (_jsx(SuccessScreen, { title: t('tax_success_title'), onSuccess: onSuccess, successTitle: t('continue'), loading:
|
|
20
|
+
return (_jsx(SuccessScreen, { title: t('tax_success_title'), onSuccess: onSuccess, successTitle: t('continue'), loading: clicked && updateBoardSuccessLoading, error: error || '' }));
|
|
15
21
|
};
|
|
16
22
|
export default React.memo(Success);
|