@tap-payments/auth-jsconnect 2.9.2-development → 2.9.3-development
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/assets/locales/ar.json +1 -0
- package/build/assets/locales/en.json +1 -0
- package/build/constants/app.js +6 -0
- package/build/constants/flows.d.ts +2 -0
- package/build/constants/flows.js +2 -0
- package/build/features/featuresScreens.js +5 -0
- package/build/features/kyc/KYC.js +5 -1
- package/build/features/kyc/screens/TokenError/TokenError.d.ts +5 -0
- package/build/features/kyc/screens/TokenError/TokenError.js +9 -0
- package/build/features/kyc/screens/TokenError/index.d.ts +2 -0
- package/build/features/kyc/screens/TokenError/index.js +2 -0
- package/build/features/kyc/screens/Users/Users.js +5 -2
- package/package.json +1 -1
|
@@ -372,6 +372,7 @@
|
|
|
372
372
|
"kyc_terms_description": "يجب على الممثل المعتمد للشركة قراءة الوثائق القانونية والموافقة عليها",
|
|
373
373
|
"kyc_terms_description_single_user": "يجب على الشخص المخول الذي يحمل الهوية {{id_number}} قراءة المستندات القانونية والموافقة عليها",
|
|
374
374
|
"kyc_terms_title": "وثائق قانونية",
|
|
375
|
+
"kyc_token_invalid": "الرجاء مراجعة رابط المرسل اليك",
|
|
375
376
|
"kyc_users_description": "يرجى اختيار رقم هوية الممثل المعتمد للموافقة عليه مع {{provider}}",
|
|
376
377
|
"language": "English",
|
|
377
378
|
"license_info": "معلومات الترخيص",
|
|
@@ -385,6 +385,7 @@
|
|
|
385
385
|
"kyc_terms_description": "An authorized representative of the company must read and approve the legal documents",
|
|
386
386
|
"kyc_terms_description_single_user": "The authorized person with the ID {{id_number}} must read and approve the legal documents",
|
|
387
387
|
"kyc_terms_title": "Legal documents",
|
|
388
|
+
"kyc_token_invalid": "May you please verify link of which you are trying to open.",
|
|
388
389
|
"kyc_users_description": "Please select an authorized registered ID to approve with {{provider}}",
|
|
389
390
|
"kyc_verification": "Know Your Customer (KYC)",
|
|
390
391
|
"language": "العربية",
|
package/build/constants/app.js
CHANGED
|
@@ -404,6 +404,12 @@ export var KYC_SCREENS_NAVIGATION = [
|
|
|
404
404
|
prev: '',
|
|
405
405
|
order: 1
|
|
406
406
|
},
|
|
407
|
+
{
|
|
408
|
+
name: CONNECT_FLOWS.kyc.tokenError,
|
|
409
|
+
next: '',
|
|
410
|
+
prev: '',
|
|
411
|
+
order: 1
|
|
412
|
+
},
|
|
407
413
|
{
|
|
408
414
|
name: CONNECT_FLOWS.kyc.users,
|
|
409
415
|
next: [CONNECT_FLOWS.kyc.verifyNafath, CONNECT_FLOWS.kyc.verifyPACI],
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export declare enum KYC_FLOWS {
|
|
2
2
|
loadingData = "KYC_LOADING_DATA_STEP",
|
|
3
|
+
tokenError = "TOKEN_ERROR_STEP",
|
|
3
4
|
verify = "KYC_VERIFY_STEP",
|
|
4
5
|
terms = "KYC_TERMS_STEP",
|
|
5
6
|
users = "KYC_USERS_STEP",
|
|
@@ -11,6 +12,7 @@ export declare enum KYC_FLOWS {
|
|
|
11
12
|
export declare const CONNECT_FLOWS: {
|
|
12
13
|
kyc: {
|
|
13
14
|
loadingData: KYC_FLOWS;
|
|
15
|
+
tokenError: KYC_FLOWS;
|
|
14
16
|
verify: KYC_FLOWS;
|
|
15
17
|
terms: KYC_FLOWS;
|
|
16
18
|
users: KYC_FLOWS;
|
package/build/constants/flows.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export var KYC_FLOWS;
|
|
2
2
|
(function (KYC_FLOWS) {
|
|
3
3
|
KYC_FLOWS["loadingData"] = "KYC_LOADING_DATA_STEP";
|
|
4
|
+
KYC_FLOWS["tokenError"] = "TOKEN_ERROR_STEP";
|
|
4
5
|
KYC_FLOWS["verify"] = "KYC_VERIFY_STEP";
|
|
5
6
|
KYC_FLOWS["terms"] = "KYC_TERMS_STEP";
|
|
6
7
|
KYC_FLOWS["users"] = "KYC_USERS_STEP";
|
|
@@ -12,6 +13,7 @@ export var KYC_FLOWS;
|
|
|
12
13
|
export var CONNECT_FLOWS = {
|
|
13
14
|
kyc: {
|
|
14
15
|
loadingData: KYC_FLOWS.loadingData,
|
|
16
|
+
tokenError: KYC_FLOWS.tokenError,
|
|
15
17
|
verify: KYC_FLOWS.verify,
|
|
16
18
|
terms: KYC_FLOWS.terms,
|
|
17
19
|
users: KYC_FLOWS.users,
|
|
@@ -128,6 +128,7 @@ import BoardResetPasswordSuccessPage from './board/screens/ResetPasswordSuccess'
|
|
|
128
128
|
import BoardDataLoadingPage from './board/screens/PrepareDataLoading';
|
|
129
129
|
import BoardOperatorError from './board/screens/OperatorError';
|
|
130
130
|
import KycLoadingPage from './kyc/screens/Loading';
|
|
131
|
+
import KycTokenErrorPage from './kyc/screens/TokenError';
|
|
131
132
|
import KycVerifyNafathPage from './kyc/screens/VerifyNafath';
|
|
132
133
|
import KycVerifyPaciPage from './kyc/screens/VerifyPaci';
|
|
133
134
|
import KycOperatorErrorPage from './kyc/screens/OperatorError';
|
|
@@ -645,6 +646,10 @@ export var kycFeatureScreens = [
|
|
|
645
646
|
name: CONNECT_FLOWS.kyc.loadingData,
|
|
646
647
|
element: KycLoadingPage
|
|
647
648
|
},
|
|
649
|
+
{
|
|
650
|
+
name: CONNECT_FLOWS.kyc.tokenError,
|
|
651
|
+
element: KycTokenErrorPage
|
|
652
|
+
},
|
|
648
653
|
{
|
|
649
654
|
name: CONNECT_FLOWS.kyc.terms,
|
|
650
655
|
element: KycTermsPage
|
|
@@ -56,7 +56,11 @@ var KYC = memo(function (_a) {
|
|
|
56
56
|
var nextScreen = _a.nextScreen;
|
|
57
57
|
dispatch(handleCurrentActiveScreen(nextScreen));
|
|
58
58
|
})
|
|
59
|
-
.catch(function () {
|
|
59
|
+
.catch(function (error) {
|
|
60
|
+
if (error.message.toLowerCase() === 'failed to decrypt verify_token') {
|
|
61
|
+
dispatch(handleCurrentActiveScreen(CONNECT_FLOWS.kyc.tokenError));
|
|
62
|
+
}
|
|
63
|
+
});
|
|
60
64
|
};
|
|
61
65
|
};
|
|
62
66
|
useVerifyToken({
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { useTranslation } from 'react-i18next';
|
|
4
|
+
import GenericError from '../../../shared/GenericError';
|
|
5
|
+
var TokenError = function (_a) {
|
|
6
|
+
var t = useTranslation().t;
|
|
7
|
+
return _jsx(GenericError, { error: t('kyc_token_invalid'), errorTitle: t('oops') });
|
|
8
|
+
};
|
|
9
|
+
export default React.memo(TokenError);
|
|
@@ -16,11 +16,12 @@ import { styled } from '@mui/material/styles';
|
|
|
16
16
|
import { handleNextScreenStep, settingsSelector } from '../../../../app/settings';
|
|
17
17
|
import Text from '../../../../components/Text';
|
|
18
18
|
import Loader from '../../../../components/Loader';
|
|
19
|
+
import Warning from '../../../../components/Warning';
|
|
19
20
|
import { isSA, maskIDNumber } from '../../../../utils';
|
|
20
21
|
import { CONNECT_FLOWS, ICONS_NAMES } from '../../../../constants';
|
|
21
22
|
import { useAppDispatch, useAppSelector, useSanitizedTranslation } from '../../../../hooks';
|
|
22
23
|
import ScreenContainer from '../../../shared/Containers/ScreenContainer';
|
|
23
|
-
import { createNafathAuth, createPaciAuth, kycSelector } from '../../../app/kyc/kycStore';
|
|
24
|
+
import { clearError, createNafathAuth, createPaciAuth, kycSelector } from '../../../app/kyc/kycStore';
|
|
24
25
|
var BoxStyled = styled(Box, { shouldForwardProp: function (prop) { return !['loading'].includes(prop.toString()); } })(function (_a) {
|
|
25
26
|
var theme = _a.theme, loading = _a.loading;
|
|
26
27
|
return (__assign({ marginTop: theme.spacing(1), boxShadow: theme.shadows[3], backgroundColor: theme.palette.common.white, fontWeight: theme.typography.fontWeightMedium, fontSize: theme.spacing(1.875), padding: theme.spacing(1.5), borderRadius: theme.spacing(3.875), textAlign: 'center', cursor: 'pointer', display: 'flex', justifyContent: 'space-between' }, (loading && {
|
|
@@ -49,6 +50,8 @@ var Users = function () {
|
|
|
49
50
|
var userList = ((_a = data.responseData) === null || _a === void 0 ? void 0 : _a.userList) || [];
|
|
50
51
|
var isSACountry = React.useMemo(function () { return isSA(settingsData.businessCountry.iso2); }, [settingsData.businessCountry.iso2]);
|
|
51
52
|
var onClickUser = function (user) {
|
|
53
|
+
if (error)
|
|
54
|
+
dispatch(clearError());
|
|
52
55
|
setActiveUser(user);
|
|
53
56
|
if (isSACountry) {
|
|
54
57
|
dispatch(createNafathAuth(user))
|
|
@@ -68,6 +71,6 @@ var Users = function () {
|
|
|
68
71
|
};
|
|
69
72
|
return (_jsxs(ScreenContainer, __assign({ sx: { pl: 2, pr: 2 } }, { children: [_jsx(DescriptionStyled, { children: st('kyc_users_description', { provider: isSACountry ? 'NAFATH' : 'PACI' }) }), userList.map(function (user, index) {
|
|
70
73
|
return (_jsx(BoxStyled, __assign({ onClick: function () { return onClickUser(user); } }, { children: (activeUser === null || activeUser === void 0 ? void 0 : activeUser.id) === user.id && loading ? (_jsx(Loader, { innerColor: 'black', outerColor: 'black', size: 8, style: { height: 20, width: 20 }, toggleAnimation: !!loading })) : (_jsxs(_Fragment, { children: [_jsx(ImgStyled, { src: ICONS_NAMES.individual_filled_icon }), maskIDNumber(user.identification.id), _jsx("span", {})] })) }), index));
|
|
71
|
-
})] })));
|
|
74
|
+
}), error && (_jsx(Warning, __assign({ sx: { mt: 3, mb: 3 }, warningType: 'error' }, { children: error })))] })));
|
|
72
75
|
};
|
|
73
76
|
export default memo(Users);
|