@tap-payments/auth-jsconnect 2.9.5-development → 2.9.6-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.
@@ -364,6 +364,7 @@
364
364
  "issue_date": "تاريخ الإصدار",
365
365
  "issued_country_label": "بلد الإصدار",
366
366
  "join_our_community": "",
367
+ "kyc_already_submitted_title": "لقد وافقت مسبقاً على كافة الوثائق",
367
368
  "kyc_dispute_policy": "سياسة المنازعات",
368
369
  "kyc_refund_policy": "سياسة الاسترجاع",
369
370
  "kyc_success_button": "حساب لوحة التحكم",
@@ -377,6 +377,7 @@
377
377
  "issue_date": "Date of issuance",
378
378
  "issued_country_label": "Issued Country",
379
379
  "join_our_community": "",
380
+ "kyc_already_submitted_title": "You already approved all documents",
380
381
  "kyc_dispute_policy": "Dispute Policy",
381
382
  "kyc_refund_policy": "Refund Policy",
382
383
  "kyc_success_button": "Go to my board",
@@ -398,6 +398,12 @@ export var KYC_SCREENS_NAVIGATION = [
398
398
  prev: '',
399
399
  order: 1
400
400
  },
401
+ {
402
+ name: CONNECT_FLOWS.kyc.alreadySubmitted,
403
+ next: '',
404
+ prev: '',
405
+ order: 1
406
+ },
401
407
  {
402
408
  name: CONNECT_FLOWS.kyc.operatorError,
403
409
  next: '',
@@ -1,5 +1,6 @@
1
1
  export declare enum KYC_FLOWS {
2
2
  loadingData = "KYC_LOADING_DATA_STEP",
3
+ alreadySubmitted = "ALREADY_SUBMITTED",
3
4
  tokenError = "TOKEN_ERROR_STEP",
4
5
  verify = "KYC_VERIFY_STEP",
5
6
  terms = "KYC_TERMS_STEP",
@@ -12,6 +13,7 @@ export declare enum KYC_FLOWS {
12
13
  export declare const CONNECT_FLOWS: {
13
14
  kyc: {
14
15
  loadingData: KYC_FLOWS;
16
+ alreadySubmitted: KYC_FLOWS;
15
17
  tokenError: KYC_FLOWS;
16
18
  verify: KYC_FLOWS;
17
19
  terms: 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["alreadySubmitted"] = "ALREADY_SUBMITTED";
4
5
  KYC_FLOWS["tokenError"] = "TOKEN_ERROR_STEP";
5
6
  KYC_FLOWS["verify"] = "KYC_VERIFY_STEP";
6
7
  KYC_FLOWS["terms"] = "KYC_TERMS_STEP";
@@ -13,6 +14,7 @@ export var KYC_FLOWS;
13
14
  export var CONNECT_FLOWS = {
14
15
  kyc: {
15
16
  loadingData: KYC_FLOWS.loadingData,
17
+ alreadySubmitted: KYC_FLOWS.alreadySubmitted,
16
18
  tokenError: KYC_FLOWS.tokenError,
17
19
  verify: KYC_FLOWS.verify,
18
20
  terms: KYC_FLOWS.terms,
@@ -55,7 +55,7 @@ import { sendCustomEventToGTM, sleep } from '../../../utils';
55
55
  export var verifyTokenApi = createAsyncThunk('kyc/verifyTokenApi', function (_a, thunkApi) {
56
56
  var token = _a.token;
57
57
  return __awaiter(void 0, void 0, void 0, function () {
58
- var payload, data, _b, config, country_code, segment_id, boardId, recipient, publicKey, nextScreen, userList, userPayload, users;
58
+ var payload, data, _b, config, country_code, segment_id, boardId, status, publicKey, nextScreen, userList, userPayload, users;
59
59
  return __generator(this, function (_c) {
60
60
  switch (_c.label) {
61
61
  case 0:
@@ -69,9 +69,9 @@ export var verifyTokenApi = createAsyncThunk('kyc/verifyTokenApi', function (_a,
69
69
  return [4, API.leadService.verifyToken(payload)];
70
70
  case 1:
71
71
  data = _c.sent();
72
- _b = data || {}, config = _b.config, country_code = _b.country_code, segment_id = _b.segment_id, boardId = _b.id, recipient = _b.recipient;
72
+ _b = data || {}, config = _b.config, country_code = _b.country_code, segment_id = _b.segment_id, boardId = _b.id, status = _b.status;
73
73
  publicKey = config === null || config === void 0 ? void 0 : config.public_key;
74
- nextScreen = CONNECT_FLOWS.kyc.terms;
74
+ nextScreen = status === 'completed' ? CONNECT_FLOWS.kyc.alreadySubmitted : CONNECT_FLOWS.kyc.terms;
75
75
  userList = [];
76
76
  if (country_code)
77
77
  thunkApi.dispatch(handleSetCountryByIso2(country_code));
@@ -80,7 +80,7 @@ export var verifyTokenApi = createAsyncThunk('kyc/verifyTokenApi', function (_a,
80
80
  userPayload = {
81
81
  page: 1,
82
82
  limit: 25,
83
- is_authorized: recipient.is_authorized,
83
+ is_authorized: true,
84
84
  segment_ids: [segment_id]
85
85
  };
86
86
  return [4, API.userService.getUserListUsingSegmentId(userPayload)];
@@ -129,6 +129,7 @@ import BoardDataLoadingPage from './board/screens/PrepareDataLoading';
129
129
  import BoardOperatorError from './board/screens/OperatorError';
130
130
  import KycLoadingPage from './kyc/screens/Loading';
131
131
  import KycTokenErrorPage from './kyc/screens/TokenError';
132
+ import KycAlreadySubmittedPage from './kyc/screens/AlreadySubmitted';
132
133
  import KycVerifyNafathPage from './kyc/screens/VerifyNafath';
133
134
  import KycVerifyPaciPage from './kyc/screens/VerifyPaci';
134
135
  import KycOperatorErrorPage from './kyc/screens/OperatorError';
@@ -650,6 +651,10 @@ export var kycFeatureScreens = [
650
651
  name: CONNECT_FLOWS.kyc.tokenError,
651
652
  element: KycTokenErrorPage
652
653
  },
654
+ {
655
+ name: CONNECT_FLOWS.kyc.alreadySubmitted,
656
+ element: KycAlreadySubmittedPage
657
+ },
653
658
  {
654
659
  name: CONNECT_FLOWS.kyc.terms,
655
660
  element: KycTermsPage
@@ -0,0 +1,5 @@
1
+ import * as React from 'react';
2
+ export interface AlreadySubmittedProps {
3
+ }
4
+ declare const _default: React.MemoExoticComponent<({}: AlreadySubmittedProps) => import("react/jsx-runtime").JSX.Element>;
5
+ export default _default;
@@ -0,0 +1,19 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import * as React from 'react';
3
+ import { useTranslation } from 'react-i18next';
4
+ import SuccessScreen from '../../../shared/SuccessScreen';
5
+ import { useAppSelector } from '../../../../hooks';
6
+ import { kycSelector } from '../../../app/kyc/kycStore';
7
+ var AlreadySubmitted = function (_a) {
8
+ var t = useTranslation().t;
9
+ var _b = useAppSelector(kycSelector), error = _b.error, loading = _b.loading, data = _b.data;
10
+ var redirectToBoard = function () {
11
+ var _a, _b;
12
+ var baseUrl = window.location.origin;
13
+ var boardId = ((_b = (_a = data.responseData) === null || _a === void 0 ? void 0 : _a.verifyTokenData) === null || _b === void 0 ? void 0 : _b.boardId) || '';
14
+ var boardUrl = "".concat(baseUrl, "/board?board_id=").concat(boardId);
15
+ window.open(boardUrl, '_self');
16
+ };
17
+ return (_jsx(SuccessScreen, { title: t('kyc_already_submitted_title'), onSuccess: redirectToBoard, successTitle: t('kyc_success_button'), loading: loading, error: error || '' }));
18
+ };
19
+ export default React.memo(AlreadySubmitted);
@@ -0,0 +1,2 @@
1
+ import AlreadySubmitted from './AlreadySubmitted';
2
+ export default AlreadySubmitted;
@@ -0,0 +1,2 @@
1
+ import AlreadySubmitted from './AlreadySubmitted';
2
+ export default AlreadySubmitted;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tap-payments/auth-jsconnect",
3
- "version": "2.9.5-development",
3
+ "version": "2.9.6-development",
4
4
  "description": "connect library, auth",
5
5
  "private": false,
6
6
  "main": "build/index.js",