@tap-payments/auth-jsconnect 2.9.2-development → 2.9.4-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.
@@ -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": "العربية",
@@ -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;
@@ -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,
@@ -140,8 +140,8 @@ var MobileNumber = React.forwardRef(function (_a, ref) {
140
140
  var filteredCountries = countries.filter(function (country) {
141
141
  return country.idd_prefix.toString().toLowerCase().startsWith(value.replace('+', '').toLowerCase()) ||
142
142
  country.capital.toLowerCase().startsWith(value.toLowerCase()) ||
143
- country.name.arabic.toLowerCase().startsWith(value.toLowerCase()) ||
144
- country.name.english.toLowerCase().startsWith(value.toLowerCase());
143
+ country.name.arabic.toLowerCase().includes(value.toLowerCase()) ||
144
+ country.name.english.toLowerCase().includes(value.toLowerCase());
145
145
  });
146
146
  setCountries(filteredCountries);
147
147
  };
@@ -142,8 +142,8 @@ var MobileNumber = React.forwardRef(function (_a, ref) {
142
142
  var filteredCountries = countries.filter(function (country) {
143
143
  return country.idd_prefix.toString().toLowerCase().startsWith(value.replace('+', '').toLowerCase()) ||
144
144
  country.capital.toLowerCase().startsWith(value.toLowerCase()) ||
145
- country.name.arabic.toLowerCase().startsWith(value.toLowerCase()) ||
146
- country.name.english.toLowerCase().startsWith(value.toLowerCase());
145
+ country.name.arabic.toLowerCase().includes(value.toLowerCase()) ||
146
+ country.name.english.toLowerCase().includes(value.toLowerCase());
147
147
  });
148
148
  setCountries(filteredCountries);
149
149
  };
@@ -150,8 +150,8 @@ var MobileNumber = React.forwardRef(function (_a, ref) {
150
150
  var filteredCountries = countries.filter(function (country) {
151
151
  return country.idd_prefix.toString().toLowerCase().startsWith(value.replace('+', '').toLowerCase()) ||
152
152
  country.capital.toLowerCase().startsWith(value.toLowerCase()) ||
153
- country.name.arabic.toLowerCase().startsWith(value.toLowerCase()) ||
154
- country.name.english.toLowerCase().startsWith(value.toLowerCase());
153
+ country.name.arabic.toLowerCase().includes(value.toLowerCase()) ||
154
+ country.name.english.toLowerCase().includes(value.toLowerCase());
155
155
  });
156
156
  setCountries(filteredCountries);
157
157
  };
@@ -138,8 +138,8 @@ var MobileNumber = React.forwardRef(function (_a, ref) {
138
138
  var filteredCountries = countries.filter(function (country) {
139
139
  return country.idd_prefix.toString().toLowerCase().startsWith(value.replace('+', '').toLowerCase()) ||
140
140
  country.capital.toLowerCase().startsWith(value.toLowerCase()) ||
141
- country.name.arabic.toLowerCase().startsWith(value.toLowerCase()) ||
142
- country.name.english.toLowerCase().startsWith(value.toLowerCase());
141
+ country.name.arabic.toLowerCase().includes(value.toLowerCase()) ||
142
+ country.name.english.toLowerCase().includes(value.toLowerCase());
143
143
  });
144
144
  setCountries(filteredCountries);
145
145
  };
@@ -143,8 +143,8 @@ var MobileNumber = React.forwardRef(function (_a, ref) {
143
143
  var filteredCountries = countries.filter(function (country) {
144
144
  return country.idd_prefix.toString().toLowerCase().startsWith(value.replace('+', '').toLowerCase()) ||
145
145
  country.capital.toLowerCase().startsWith(value.toLowerCase()) ||
146
- country.name.arabic.toLowerCase().startsWith(value.toLowerCase()) ||
147
- country.name.english.toLowerCase().startsWith(value.toLowerCase());
146
+ country.name.arabic.toLowerCase().includes(value.toLowerCase()) ||
147
+ country.name.english.toLowerCase().includes(value.toLowerCase());
148
148
  });
149
149
  setCountries(filteredCountries);
150
150
  };
@@ -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,5 @@
1
+ import * as React from 'react';
2
+ export interface TokenErrorProps {
3
+ }
4
+ declare const _default: React.MemoExoticComponent<({}: TokenErrorProps) => import("react/jsx-runtime").JSX.Element>;
5
+ export default _default;
@@ -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);
@@ -0,0 +1,2 @@
1
+ import TokenError from './TokenError';
2
+ export default TokenError;
@@ -0,0 +1,2 @@
1
+ import TokenError from './TokenError';
2
+ export default 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);
@@ -140,8 +140,8 @@ var MobileNumber = React.forwardRef(function (_a, ref) {
140
140
  var filteredCountries = countries.filter(function (country) {
141
141
  return country.idd_prefix.toString().toLowerCase().startsWith(value.replace('+', '').toLowerCase()) ||
142
142
  country.capital.toLowerCase().startsWith(value.toLowerCase()) ||
143
- country.name.arabic.toLowerCase().startsWith(value.toLowerCase()) ||
144
- country.name.english.toLowerCase().startsWith(value.toLowerCase());
143
+ country.name.arabic.toLowerCase().includes(value.toLowerCase()) ||
144
+ country.name.english.toLowerCase().includes(value.toLowerCase());
145
145
  });
146
146
  setCountries(filteredCountries);
147
147
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tap-payments/auth-jsconnect",
3
- "version": "2.9.2-development",
3
+ "version": "2.9.4-development",
4
4
  "description": "connect library, auth",
5
5
  "private": false,
6
6
  "main": "build/index.js",