@tap-payments/auth-jsconnect 1.0.57 → 1.0.61

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.
Files changed (65) hide show
  1. package/build/@types/form.d.ts +2 -2
  2. package/build/api/entity.d.ts +20 -0
  3. package/build/api/entity.js +5 -1
  4. package/build/api/index.d.ts +3 -2
  5. package/build/assets/locales/ar.json +13 -1
  6. package/build/assets/locales/en.json +13 -1
  7. package/build/constants/api.d.ts +1 -0
  8. package/build/constants/api.js +3 -1
  9. package/build/constants/app.js +18 -18
  10. package/build/constants/assets.d.ts +7 -0
  11. package/build/constants/assets.js +8 -1
  12. package/build/features/Landing/Landing.js +5 -8
  13. package/build/features/Landing/screens/VerifyAndRedirect/VerifyAndRedirect.js +6 -20
  14. package/build/features/app/bank/bankStore.d.ts +5 -3
  15. package/build/features/app/bank/bankStore.js +81 -16
  16. package/build/features/app/business/businessStore.js +15 -17
  17. package/build/features/app/connect/connectStore.js +27 -19
  18. package/build/features/app/individual/individualStore.d.ts +4 -0
  19. package/build/features/app/individual/individualStore.js +80 -18
  20. package/build/features/bank/screens/BankDetails/BankDetails.js +7 -9
  21. package/build/features/bank/screens/BankDetails/Beneficiary.js +9 -1
  22. package/build/features/bank/screens/Success/Success.js +6 -0
  23. package/build/features/business/screens/BusinessType/LicenseNumber.js +1 -1
  24. package/build/features/business/screens/Success/Success.js +3 -2
  25. package/build/features/business/screens/{Confirm/Confirm.d.ts → SuccessWithFlowButtons/SuccessWithFlowButtons.d.ts} +1 -3
  26. package/build/features/business/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +79 -0
  27. package/build/features/business/screens/SuccessWithFlowButtons/index.d.ts +2 -0
  28. package/build/features/business/screens/SuccessWithFlowButtons/index.js +2 -0
  29. package/build/features/connect/screens/ThankYou/ThankYou.js +1 -4
  30. package/build/features/featuresScreens.js +3 -6
  31. package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +18 -15
  32. package/build/features/individual/screens/AdditionalIndividualInfo/EmployerName.js +10 -1
  33. package/build/features/individual/screens/AdditionalIndividualInfo/SourceOfIncome.js +1 -1
  34. package/build/features/individual/screens/AdditionalIndividualInfo/validation.js +2 -2
  35. package/build/features/individual/screens/Success/Success.js +6 -0
  36. package/build/features/shared/Button/EmailProvidersButtons.d.ts +13 -0
  37. package/build/features/shared/Button/EmailProvidersButtons.js +92 -0
  38. package/build/features/shared/Button/FlowsButtons.d.ts +12 -0
  39. package/build/features/shared/Button/FlowsButtons.js +57 -0
  40. package/build/features/shared/Button/index.d.ts +3 -1
  41. package/build/features/shared/Button/index.js +3 -1
  42. package/build/features/shared/SuccessScreen/SuccessScreen.d.ts +4 -2
  43. package/build/features/shared/SuccessScreen/SuccessScreen.js +4 -4
  44. package/package.json +1 -1
  45. package/build/features/business/screens/BusinessType/CRNumber.d.ts +0 -7
  46. package/build/features/business/screens/BusinessType/CRNumber.js +0 -41
  47. package/build/features/business/screens/BusinessType/CompanyLicense.d.ts +0 -11
  48. package/build/features/business/screens/BusinessType/CompanyLicense.js +0 -127
  49. package/build/features/business/screens/BusinessType/FLNumber.d.ts +0 -7
  50. package/build/features/business/screens/BusinessType/FLNumber.js +0 -41
  51. package/build/features/business/screens/BusinessType/FreelanceLicense.d.ts +0 -11
  52. package/build/features/business/screens/BusinessType/FreelanceLicense.js +0 -127
  53. package/build/features/business/screens/Confirm/Confirm.js +0 -56
  54. package/build/features/business/screens/Confirm/index.d.ts +0 -3
  55. package/build/features/business/screens/Confirm/index.js +0 -2
  56. package/build/features/connect/screens/Mobile/BusinessCountry.d.ts +0 -8
  57. package/build/features/connect/screens/Mobile/BusinessCountry.js +0 -40
  58. package/build/features/connect/screens/Password/Password.d.ts +0 -5
  59. package/build/features/connect/screens/Password/Password.js +0 -60
  60. package/build/features/connect/screens/Password/PasswordInput.d.ts +0 -5
  61. package/build/features/connect/screens/Password/PasswordInput.js +0 -39
  62. package/build/features/connect/screens/Password/index.d.ts +0 -3
  63. package/build/features/connect/screens/Password/index.js +0 -2
  64. package/build/features/connect/screens/Password/validation.d.ts +0 -8
  65. package/build/features/connect/screens/Password/validation.js +0 -4
@@ -54,10 +54,10 @@ export declare type TaxFormValues = {
54
54
  vatId: string;
55
55
  };
56
56
  export declare type IndividualExtraFormValues = {
57
- sourceIncome: SourceOfIncome;
57
+ sourceIncome: SourceOfIncome | undefined;
58
58
  monthlyIncome: string;
59
59
  employerName: string;
60
- employerLocation: CountryCode;
60
+ employerLocation: CountryCode | undefined;
61
61
  isPEP: boolean | null;
62
62
  isInfluencer: boolean | null;
63
63
  };
@@ -10,14 +10,34 @@ export declare type EntityInfoCreateBody = {
10
10
  vat_id?: string;
11
11
  agree_chargeback?: boolean;
12
12
  agree_refund?: boolean;
13
+ employer_name?: string;
14
+ employer_city?: string | null;
15
+ source_income?: Array<string | undefined>;
16
+ actual_income?: string;
17
+ is_relative_PEP?: boolean | null;
18
+ is_influencer?: boolean | null;
13
19
  step_name: string;
14
20
  encryption_contract?: Array<string>;
15
21
  };
22
+ export declare type EntityBankUpdateBody = {
23
+ wallet_id?: string;
24
+ entity_id: string;
25
+ bank_account: {
26
+ bank_name: string;
27
+ beneficiary_name: string;
28
+ bank_statement_file_id?: string;
29
+ iban: string;
30
+ swift_code?: string;
31
+ account_number?: string;
32
+ };
33
+ step_name: string;
34
+ };
16
35
  export interface EntityInfoUpdateBody extends EntityInfoCreateBody {
17
36
  id: string;
18
37
  }
19
38
  declare const entityService: {
20
39
  createEntityInfo: (data: EntityInfoCreateBody, config?: AxiosRequestConfig) => Promise<import("axios").AxiosResponse<any, any>>;
21
40
  updateEntityInfo: (data: EntityInfoUpdateBody, config?: AxiosRequestConfig) => Promise<import("axios").AxiosResponse<any, any>>;
41
+ createBankAccount: (data: EntityBankUpdateBody, config?: AxiosRequestConfig) => Promise<import("axios").AxiosResponse<any, any>>;
22
42
  };
23
43
  export { entityService };
@@ -6,8 +6,12 @@ var createEntityInfo = function (data, config) {
6
6
  var updateEntityInfo = function (data, config) {
7
7
  return instance.put("".concat(ENDPOINT_PATHS.ENTITY), data, config);
8
8
  };
9
+ var createBankAccount = function (data, config) {
10
+ return instance.post("".concat(ENDPOINT_PATHS.BANK), data, config);
11
+ };
9
12
  var entityService = {
10
13
  createEntityInfo: createEntityInfo,
11
- updateEntityInfo: updateEntityInfo
14
+ updateEntityInfo: updateEntityInfo,
15
+ createBankAccount: createBankAccount
12
16
  };
13
17
  export { entityService };
@@ -3,7 +3,7 @@ import { ValidateOperatorBody } from './operator';
3
3
  import { CreateAuthBody, VerifyAuthBody } from './auth';
4
4
  import { UpdateLeadBody, LeadVerifyBody, CreateLeadBody, LeadOTPVerifyBody, LeadIdentityUpdateBody } from './lead';
5
5
  import { CheckEmailBody, CheckBrandBody } from './availabilityServices';
6
- import { EntityInfoUpdateBody, EntityInfoCreateBody } from './entity';
6
+ import { EntityInfoUpdateBody, EntityInfoCreateBody, EntityBankUpdateBody } from './entity';
7
7
  import { CreateAccountBody } from './account';
8
8
  declare const API: {
9
9
  ipService: {
@@ -32,6 +32,7 @@ declare const API: {
32
32
  entityService: {
33
33
  createEntityInfo: (data: EntityInfoCreateBody, config?: import("axios").AxiosRequestConfig<any> | undefined) => Promise<import("axios").AxiosResponse<any, any>>;
34
34
  updateEntityInfo: (data: EntityInfoUpdateBody, config?: import("axios").AxiosRequestConfig<any> | undefined) => Promise<import("axios").AxiosResponse<any, any>>;
35
+ createBankAccount: (data: EntityBankUpdateBody, config?: import("axios").AxiosRequestConfig<any> | undefined) => Promise<import("axios").AxiosResponse<any, any>>;
35
36
  };
36
37
  availabilityServices: {
37
38
  checkEmail: (data: CheckEmailBody, config?: import("axios").AxiosRequestConfig<any> | undefined) => Promise<import("axios").AxiosResponse<any, any>>;
@@ -50,6 +51,6 @@ declare const API: {
50
51
  getExpectedCustomerSales: () => Promise<import("axios").AxiosResponse<any, any>>;
51
52
  };
52
53
  };
53
- export type { ValidateOperatorBody, CreateAuthBody, VerifyAuthBody, CreateLeadBody, UpdateLeadBody, LeadVerifyBody, LeadOTPVerifyBody, CheckEmailBody, CheckBrandBody, LeadIdentityUpdateBody, EntityInfoCreateBody, EntityInfoUpdateBody, CreateAccountBody };
54
+ export type { ValidateOperatorBody, CreateAuthBody, VerifyAuthBody, CreateLeadBody, UpdateLeadBody, LeadVerifyBody, LeadOTPVerifyBody, CheckEmailBody, CheckBrandBody, LeadIdentityUpdateBody, EntityInfoCreateBody, EntityInfoUpdateBody, CreateAccountBody, EntityBankUpdateBody };
54
55
  export { setAxiosGlobalHeaders, removeAxiosGlobalHeaders };
55
56
  export default API;
@@ -215,10 +215,22 @@
215
215
  "select_brand_label": "Brand List",
216
216
  "choose_brand": "Choose Brand",
217
217
  "confirm_enter_iban": "الايبان",
218
+ "open_gmail": "Gmail",
219
+ "open_outlook": "Outlook",
220
+ "open_apple": "Apple",
218
221
  "choose_any_license": "Choose Licene",
219
222
  "future_work": "Future Work",
220
223
  "add_other_fl": "Add Freelance",
221
224
  "add_other_cr": "Add CR",
222
225
  "cr_number": "CR Number",
223
- "fl_number": "FL Number"
226
+ "fl_number": "FL Number",
227
+ "tax_flow_completed": "Tax",
228
+ "individual_flow_completed": "Individual",
229
+ "bank_flow_completed": "Bank",
230
+ "password_flow_completed": "Password",
231
+ "tax_flow_pending": "Tax",
232
+ "individual_flow_pending": "Individual",
233
+ "bank_flow_pending": "Bank",
234
+ "password_flow_pending": "Password",
235
+ "continue": "Continue"
224
236
  }
@@ -229,10 +229,22 @@
229
229
  "select_brand_label": "Brand List",
230
230
  "choose_brand": "Choose Brand",
231
231
  "confirm_enter_iban": "IBAN",
232
+ "open_gmail": "Gmail",
233
+ "open_outlook": "Outlook",
234
+ "open_apple": "Apple",
232
235
  "choose_any_license": "Choose Licene",
233
236
  "future_work": "Future Work",
234
237
  "add_other_fl": "Add Freelance",
235
238
  "add_other_cr": "Add CR",
236
239
  "cr_number": "CR Number",
237
- "fl_number": "FL Number"
240
+ "fl_number": "FL Number",
241
+ "tax_flow_completed": "Tax",
242
+ "individual_flow_completed": "Individual",
243
+ "bank_flow_completed": "Bank",
244
+ "password_flow_completed": "Password",
245
+ "tax_flow_pending": "Tax",
246
+ "individual_flow_pending": "Individual",
247
+ "bank_flow_pending": "Bank",
248
+ "password_flow_pending": "Password",
249
+ "continue": "Continue"
238
250
  }
@@ -18,4 +18,5 @@ export declare const ENDPOINT_PATHS: {
18
18
  CUSTOMER_BASES: string;
19
19
  SALES: string;
20
20
  EXPECTED_CUSTOMERS: string;
21
+ BANK: string;
21
22
  };
@@ -9,6 +9,7 @@ var LEAD_IDENTITY_PATH = '/lead/identity';
9
9
  var LEAD_IDENTITY_VERIFY_PATH = 'lead/identity/verify';
10
10
  var RETRIEVE_ENTITY_LIST_PATH = '/lead/entity/list';
11
11
  var ENTITY_PATH = '/entity';
12
+ var BANK_PATH = '/entity/bankaccount';
12
13
  var CHECK_EMAIL = '/lead/identity/emailcheck';
13
14
  var CHECK_BRAND = 'lead/profile/profile_name';
14
15
  var CREATE_ACCOUNT_PATH = '/account/create';
@@ -36,5 +37,6 @@ export var ENDPOINT_PATHS = {
36
37
  CHANNEL: CHANNEL_PATH,
37
38
  CUSTOMER_BASES: CUSTOMER_BASES_PATH,
38
39
  SALES: SALES_PATH,
39
- EXPECTED_CUSTOMERS: EXPECTED_CUSTOMERS_PATH
40
+ EXPECTED_CUSTOMERS: EXPECTED_CUSTOMERS_PATH,
41
+ BANK: BANK_PATH
40
42
  };
@@ -63,18 +63,18 @@ export var BUSINESS_SCREENS_NAVIGATION = [
63
63
  prev: 'BUSINESS_VERIFY_NUMBER_STEP',
64
64
  order: 2
65
65
  },
66
- {
67
- name: 'BUSINESS_OTP_STEP',
68
- next: 'BUSINESS_BUSINESS_TYPE_STEP',
69
- prev: 'BUSINESS_IDBOD_STEP',
70
- order: 3
71
- },
72
66
  {
73
67
  name: 'BUSINESS_BUSINESS_TYPE_STEP',
74
68
  next: 'BUSINESS_ACTIVITIES_STEP',
75
69
  prev: 'BUSINESS_IDBOD_STEP',
76
70
  order: 2
77
71
  },
72
+ {
73
+ name: 'BUSINESS_OTP_STEP',
74
+ next: 'BUSINESS_BUSINESS_TYPE_STEP',
75
+ prev: 'BUSINESS_IDBOD_STEP',
76
+ order: 3
77
+ },
78
78
  {
79
79
  name: 'BUSINESS_CONFIRM_STEP',
80
80
  next: 'BUSINESS_ACTIVITIES_STEP',
@@ -95,35 +95,35 @@ export var BUSINESS_SCREENS_NAVIGATION = [
95
95
  },
96
96
  {
97
97
  name: 'BUSINESS_SUCCESS_STEP',
98
- next: '',
98
+ next: 'BUSINESS_SUCCESS_FOUR_FLOWS_BUTTONS_STEP',
99
99
  prev: 'BUSINESS_CUSTOMERS_STEP',
100
100
  order: 6
101
+ },
102
+ {
103
+ name: 'BUSINESS_SUCCESS_FOUR_FLOWS_BUTTONS_STEP',
104
+ next: '',
105
+ prev: '',
106
+ order: 6
101
107
  }
102
108
  ];
103
109
  export var INDIVIDUAL_SCREENS_NAVIGATION = [
104
110
  {
105
111
  name: 'INDIVIDUAL_VERIFY_STEP',
106
- next: 'INDIVIDUAL_SHOW_INDIVIDUAL_INFO_STEP',
112
+ next: ['INDIVIDUAL_ADDITIONAL_INDIVIDUAL_INFO_STEP', 'INDIVIDUAL_SUCCESS_STEP'],
107
113
  prev: '',
108
114
  order: 1
109
115
  },
110
- {
111
- name: 'INDIVIDUAL_SHOW_INDIVIDUAL_INFO_STEP',
112
- next: 'INDIVIDUAL_ADDITIONAL_INDIVIDUAL_INFO_STEP',
113
- prev: 'INDIVIDUAL_VERIFY_STEP',
114
- order: 2
115
- },
116
116
  {
117
117
  name: 'INDIVIDUAL_ADDITIONAL_INDIVIDUAL_INFO_STEP',
118
118
  next: 'INDIVIDUAL_SUCCESS_STEP',
119
- prev: 'INDIVIDUAL_SHOW_INDIVIDUAL_INFO_STEP',
120
- order: 3
119
+ prev: 'INDIVIDUAL_VERIFY_STEP',
120
+ order: 2
121
121
  },
122
122
  {
123
123
  name: 'INDIVIDUAL_SUCCESS_STEP',
124
124
  next: '',
125
125
  prev: 'INDIVIDUAL_ADDITIONAL_INDIVIDUAL_INFO_STEP',
126
- order: 4
126
+ order: 3
127
127
  }
128
128
  ];
129
129
  export var PASSWORD_SCREENS_NAVIGATION = [
@@ -149,7 +149,7 @@ export var PASSWORD_SCREENS_NAVIGATION = [
149
149
  export var BANK_SCREENS_NAVIGATION = [
150
150
  {
151
151
  name: 'BANK_VERIFY_STEP',
152
- next: 'BANK_BANK_DETAILS_STEP',
152
+ next: ['BANK_BANK_DETAILS_STEP', 'BANK_DETAILS_SUCCESS_STEP'],
153
153
  prev: '',
154
154
  order: 1
155
155
  },
@@ -34,4 +34,11 @@ export declare const ICONS_NAMES: {
34
34
  ABSHER_LOGO: string;
35
35
  EMAIL_ICON: string;
36
36
  MOBILE_ICON: string;
37
+ GMAIL_ICON: string;
38
+ OUTLOOK_ICON: string;
39
+ APPLE_MAIL_ICON: string;
40
+ TAX_ICON: string;
41
+ BANK_ICON: string;
42
+ INDIVIDUAL_ICON: string;
43
+ PASSWORD_ICON: string;
37
44
  };
@@ -33,5 +33,12 @@ export var ICONS_NAMES = {
33
33
  SUCCESS: 'https://tap-connecet.b-cdn.net/imgs/success.svg',
34
34
  ABSHER_LOGO: 'https://dash.b-cdn.net/icons/menu/Absher.svg',
35
35
  EMAIL_ICON: 'https://dash.b-cdn.net/icons/menu/email.png',
36
- MOBILE_ICON: 'https://dash.b-cdn.net/icons/menu/mobile.svg'
36
+ MOBILE_ICON: 'https://dash.b-cdn.net/icons/menu/mobile.svg',
37
+ GMAIL_ICON: 'https://dash.b-cdn.net/icons/menu/gmail-icon.svg',
38
+ OUTLOOK_ICON: 'https://dash.b-cdn.net/icons/menu/outlook-icon.svg',
39
+ APPLE_MAIL_ICON: 'https://dash.b-cdn.net/icons/menu/apple-icon.svg',
40
+ TAX_ICON: 'https://email-templates.b-cdn.net/file.png',
41
+ BANK_ICON: 'https://email-templates.b-cdn.net/dollar_square.png',
42
+ INDIVIDUAL_ICON: 'https://email-templates.b-cdn.net/user.png',
43
+ PASSWORD_ICON: 'https://email-templates.b-cdn.net/lock_square.png'
37
44
  };
@@ -13,15 +13,12 @@ import { jsx as _jsx } from "react/jsx-runtime";
13
13
  import React, { memo, useEffect } from 'react';
14
14
  import { useAppTheme, useAppDispatch, useAppSelector, useErrorListener, useAppConfig } from '../../hooks';
15
15
  import { settingsSelector } from '../../app/settings';
16
- import AnimationFlow from '../../components/AnimationFlow';
17
16
  import { store } from '../../app/store';
18
17
  import { ReduxProvider, ThemeProvider } from '../../components/Providers';
19
18
  import Collapse from '../../components/Collapse';
20
19
  import { getParameterByName, reactElement } from '../../utils';
21
- import { FeatureContainer } from '../shared/Containers';
22
20
  import { LANDING_SCREENS_NAVIGATION } from '../../constants';
23
21
  import { landingFeatureScreens } from '../featuresScreens';
24
- import CustomFooter from '../shared/Footer';
25
22
  import { verifyAuthToken } from '../app/landing/landingStore';
26
23
  var Landing = memo(function (props) {
27
24
  var open = React.useState(true)[0];
@@ -41,11 +38,11 @@ var Landing = memo(function (props) {
41
38
  if (!loading)
42
39
  verifyToken();
43
40
  }, [loading]);
44
- return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(AnimationFlow, __assign({ open: open, breakpoint: 'sm', footer: _jsx(CustomFooter, {}) }, { children: _jsx(FeatureContainer, { children: landingFeatureScreens.map(function (_a, index) {
45
- var Element = _a.element, name = _a.name;
46
- var isActive = activeScreen.name === name;
47
- return (_jsx(Collapse, __assign({ in: isActive, timeout: { enter: 1000, exit: 800 } }, { children: _jsx(Element, {}) }), index));
48
- }) }) })) })));
41
+ return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: landingFeatureScreens.map(function (_a, index) {
42
+ var Element = _a.element, name = _a.name;
43
+ var isActive = activeScreen.name === name;
44
+ return (_jsx(Collapse, __assign({ in: isActive, timeout: { enter: 1000, exit: 800 } }, { children: _jsx(Element, {}) }), index));
45
+ }) })));
49
46
  });
50
47
  export function LandingLib(props) {
51
48
  return (_jsx(ReduxProvider, __assign({ store: store }, { children: _jsx(Landing, __assign({}, props)) })));
@@ -4,32 +4,18 @@ import Box from '@mui/material/Box/Box';
4
4
  import { styled } from '@mui/material/styles';
5
5
  import { settingsSelector } from '../../../../app/settings';
6
6
  import { landingSelector } from '../../../app/landing/landingStore';
7
- import BouncingDotsLoader from '../../../shared/BouncingDotsLoader';
8
7
  import { useAppSelector } from '../../../../hooks';
9
- import Text from '../../../../components/Text';
8
+ import Loader from '../../../../components/AnimationFlow/Loader';
9
+ import Error from '../../../../components/AnimationFlow/Error';
10
10
  import { getParameterByName } from '../../../../utils';
11
- var TextStyledWithThreeDots = styled(Text)(function (_a) {
12
- var theme = _a.theme;
13
- return ({
14
- fontWeight: theme.typography.fontWeightBold,
15
- fontSize: theme.spacing(3),
16
- color: theme.palette.text.primary,
17
- marginBottom: '5px'
18
- });
19
- });
20
11
  var ScreenContainerStyled = styled(Box)(function (_a) {
21
12
  var theme = _a.theme;
22
13
  return ({
23
14
  display: 'flex',
24
- height: theme.spacing(23),
25
15
  justifyContent: 'center',
26
- alignItems: 'center'
27
- });
28
- });
29
- var ContainerStyled = styled(Box)(function (_a) {
30
- var theme = _a.theme;
31
- return ({
32
- display: 'flex'
16
+ alignItems: 'center',
17
+ width: '100vw',
18
+ height: '100vh'
33
19
  });
34
20
  });
35
21
  var VerifyAndRedirect = function (_a) {
@@ -50,6 +36,6 @@ var VerifyAndRedirect = function (_a) {
50
36
  }, 300);
51
37
  }
52
38
  }, [data.verify.responseBody]);
53
- return (_jsxs(ScreenContainerStyled, { children: [isLoading && (_jsxs(ContainerStyled, { children: [_jsx(TextStyledWithThreeDots, { children: "Verifying" }), _jsx(BouncingDotsLoader, {})] })), errorMessage && _jsx(TextStyledWithThreeDots, { children: errorMessage }), !isLoading && !errorMessage && _jsx(TextStyledWithThreeDots, { children: "Verified" })] }));
39
+ return (_jsxs(ScreenContainerStyled, { children: [isLoading && _jsx(Loader, {}), errorMessage && _jsx(Error, { error: errorMessage }), !isLoading && !errorMessage && _jsx(Error, { error: 'verified' })] }));
54
40
  };
55
41
  export default React.memo(VerifyAndRedirect);
@@ -7,10 +7,12 @@ export declare const verifyLeadToken: import("@reduxjs/toolkit").AsyncThunk<{
7
7
  }, string, {}>;
8
8
  export declare const verifyBankLeadOTP: import("@reduxjs/toolkit").AsyncThunk<{
9
9
  data: any;
10
- formData: {
11
- otp: string;
12
- };
10
+ formData: OTPFormValues;
13
11
  }, OTPFormValues, {}>;
12
+ export declare const createBankAccount: import("@reduxjs/toolkit").AsyncThunk<{
13
+ data: any;
14
+ formData: BankFormValues;
15
+ }, BankFormValues, {}>;
14
16
  export declare const updateLeadSuccess: import("@reduxjs/toolkit").AsyncThunk<{
15
17
  response: any;
16
18
  formData: void;
@@ -77,10 +77,10 @@ export var verifyLeadToken = createAsyncThunk('verifyLeadToken', function (token
77
77
  });
78
78
  }); });
79
79
  export var verifyBankLeadOTP = createAsyncThunk('verifyBankLeadOTP', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
80
- var _a, bank, settings, responseBody, payload, data;
81
- var _b, _c, _d;
82
- return __generator(this, function (_e) {
83
- switch (_e.label) {
80
+ var _a, bank, settings, responseBody, payload, data, steps, hasBankCompleted;
81
+ var _b, _c, _d, _e;
82
+ return __generator(this, function (_f) {
83
+ switch (_f.label) {
84
84
  case 0:
85
85
  _a = thunkApi.getState(), bank = _a.bank, settings = _a.settings;
86
86
  responseBody = bank.data.verify.responseBody;
@@ -93,33 +93,73 @@ export var verifyBankLeadOTP = createAsyncThunk('verifyBankLeadOTP', function (p
93
93
  };
94
94
  return [4, API.leadService.verifyLeadOTP(payload)];
95
95
  case 1:
96
- data = (_e.sent()).data;
96
+ data = (_f.sent()).data;
97
97
  if (!data.errors) {
98
98
  (_d = (_c = settings.data.appConfig).onStepCompleted) === null || _d === void 0 ? void 0 : _d.call(_c, settings.data.activeScreen.name, { otp: params.otp });
99
+ steps = (_e = bank.data.verify.responseBody) === null || _e === void 0 ? void 0 : _e.steps;
100
+ hasBankCompleted = Object.keys(steps).find(function (key) { return key === BANK_STEP_NAMES.BANK_SUCCESS; });
101
+ if (hasBankCompleted) {
102
+ thunkApi.dispatch(handleNextScreenStep('BANK_DETAILS_SUCCESS_STEP'));
103
+ }
104
+ else {
105
+ thunkApi.dispatch(handleNextScreenStep('BANK_BANK_DETAILS_STEP'));
106
+ }
107
+ }
108
+ return [2, { data: data, formData: params }];
109
+ }
110
+ });
111
+ }); });
112
+ export var createBankAccount = createAsyncThunk('createBankAccount', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
113
+ var _a, settings, bank, iban, beneficiaryName, bank_name, requestBody, data;
114
+ var _b, _c, _d, _e;
115
+ return __generator(this, function (_f) {
116
+ switch (_f.label) {
117
+ case 0:
118
+ _a = thunkApi.getState(), settings = _a.settings, bank = _a.bank;
119
+ iban = params.iban;
120
+ beneficiaryName = params.beneficiaryName;
121
+ bank_name = params.bankName;
122
+ requestBody = {
123
+ entity_id: (_c = (_b = bank.data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.entity) === null || _c === void 0 ? void 0 : _c.id,
124
+ bank_account: {
125
+ iban: iban,
126
+ beneficiary_name: beneficiaryName,
127
+ bank_name: bank_name
128
+ },
129
+ step_name: BANK_STEP_NAMES.BANK_INFO
130
+ };
131
+ return [4, API.entityService.createBankAccount(requestBody)];
132
+ case 1:
133
+ data = (_f.sent()).data;
134
+ if (!data.errors) {
99
135
  thunkApi.dispatch(handleNextScreenStep());
136
+ (_e = (_d = settings.data.appConfig).onStepCompleted) === null || _e === void 0 ? void 0 : _e.call(_d, settings.data.activeScreen.name, requestBody);
100
137
  }
101
- return [2, { data: data, formData: __assign({}, params) }];
138
+ return [2, { data: data, formData: params }];
102
139
  }
103
140
  });
104
141
  }); });
105
142
  export var updateLeadSuccess = createAsyncThunk('updateLeadSuccess', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
106
- var _a, settings, bank, payload, data;
107
- var _b, _c, _d, _e, _f;
108
- return __generator(this, function (_g) {
109
- switch (_g.label) {
143
+ var _a, settings, bank, response, payload;
144
+ var _b, _c, _d, _e, _f, _g;
145
+ return __generator(this, function (_h) {
146
+ switch (_h.label) {
110
147
  case 0:
111
148
  _a = thunkApi.getState(), settings = _a.settings, bank = _a.bank;
149
+ response = undefined;
150
+ if (!!!((_b = bank.data.otpData.responseBody) === null || _b === void 0 ? void 0 : _b.id)) return [3, 2];
112
151
  payload = {
113
152
  step_name: BANK_STEP_NAMES.BANK_SUCCESS,
114
- id: ((_b = bank.data.otpData.responseBody) === null || _b === void 0 ? void 0 : _b.id) || '',
153
+ id: ((_c = bank.data.otpData.responseBody) === null || _c === void 0 ? void 0 : _c.id) || '',
115
154
  encryption_contract: []
116
155
  };
117
156
  return [4, API.leadService.updateLead(payload)];
118
157
  case 1:
119
- data = (_g.sent()).data;
120
- (_d = (_c = settings.data.appConfig).onStepCompleted) === null || _d === void 0 ? void 0 : _d.call(_c, settings.data.activeScreen.name, params);
121
- (_f = (_e = settings.data.appConfig).onFlowCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, { data: data });
122
- return [2, { response: data, formData: params }];
158
+ response = _h.sent();
159
+ (_e = (_d = settings.data.appConfig).onStepCompleted) === null || _e === void 0 ? void 0 : _e.call(_d, settings.data.activeScreen.name, params);
160
+ (_g = (_f = settings.data.appConfig).onFlowCompleted) === null || _g === void 0 ? void 0 : _g.call(_f, { data: response === null || response === void 0 ? void 0 : response.data });
161
+ _h.label = 2;
162
+ case 2: return [2, { response: response === null || response === void 0 ? void 0 : response.data, formData: params }];
123
163
  }
124
164
  });
125
165
  }); });
@@ -136,7 +176,7 @@ var initialState = {
136
176
  bankData: {
137
177
  iban: '',
138
178
  beneficiaryName: '',
139
- bankName: ''
179
+ bankName: 'Global Bank'
140
180
  }
141
181
  }
142
182
  };
@@ -156,6 +196,9 @@ export var bankSlice = createSlice({
156
196
  },
157
197
  extraReducers: function (builder) {
158
198
  builder
199
+ .addCase(verifyLeadToken.pending, function (state) {
200
+ state.error = null;
201
+ })
159
202
  .addCase(verifyLeadToken.fulfilled, function (state, action) {
160
203
  var _a;
161
204
  state.error = null;
@@ -186,6 +229,7 @@ export var bankSlice = createSlice({
186
229
  return;
187
230
  }
188
231
  state.data.otpData = formData;
232
+ state.data.otpData.responseBody = data;
189
233
  })
190
234
  .addCase(verifyBankLeadOTP.rejected, function (state, action) {
191
235
  state.loading = false;
@@ -210,6 +254,27 @@ export var bankSlice = createSlice({
210
254
  .addCase(updateLeadSuccess.rejected, function (state, action) {
211
255
  state.loading = false;
212
256
  state.error = action.error.message;
257
+ })
258
+ .addCase(createBankAccount.pending, function (state) {
259
+ state.loading = true;
260
+ state.error = null;
261
+ })
262
+ .addCase(createBankAccount.fulfilled, function (state, action) {
263
+ var _a;
264
+ state.loading = false;
265
+ state.error = null;
266
+ var _b = action.payload, data = _b.data, formData = _b.formData;
267
+ var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
268
+ if (description) {
269
+ state.error = description;
270
+ return;
271
+ }
272
+ state.data.bankData = formData;
273
+ state.data.bankData.responseBody = data;
274
+ })
275
+ .addCase(createBankAccount.rejected, function (state, action) {
276
+ state.loading = false;
277
+ state.error = action.error.message;
213
278
  });
214
279
  }
215
280
  });
@@ -79,10 +79,9 @@ export var getCountries = createAsyncThunk('getCountries', function (_, thunkApi
79
79
  });
80
80
  }); });
81
81
  export var verifyLeadToken = createAsyncThunk('verifyLeadToken', function (token, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
82
- var payload, data, leadResponse, steps, hasBusinessCompleted;
83
- var _a;
84
- return __generator(this, function (_b) {
85
- switch (_b.label) {
82
+ var payload, data, leadResponse;
83
+ return __generator(this, function (_a) {
84
+ switch (_a.label) {
86
85
  case 0:
87
86
  payload = {
88
87
  service_name: 'tap_email',
@@ -90,31 +89,25 @@ export var verifyLeadToken = createAsyncThunk('verifyLeadToken', function (token
90
89
  };
91
90
  return [4, API.leadService.verifyLeadToken(payload)];
92
91
  case 1:
93
- data = (_b.sent()).data;
92
+ data = (_a.sent()).data;
94
93
  leadResponse = undefined;
95
94
  if (!(!(data === null || data === void 0 ? void 0 : data.errors) && !(data === null || data === void 0 ? void 0 : data.mw_error))) return [3, 3];
96
95
  return [4, API.leadService.retrieveLead(data === null || data === void 0 ? void 0 : data.id)];
97
96
  case 2:
98
- leadResponse = _b.sent();
99
- steps = (_a = leadResponse === null || leadResponse === void 0 ? void 0 : leadResponse.data) === null || _a === void 0 ? void 0 : _a.steps;
100
- hasBusinessCompleted = Object.keys(steps).find(function (key) { return key === BUSINESS_STEP_NAMES.BUSINESS_SUCCESS; });
101
- if (hasBusinessCompleted) {
102
- thunkApi.dispatch(handleCurrentActiveScreen('BUSINESS_SUCCESS_STEP'));
103
- return [2, { data: data, leadData: leadResponse === null || leadResponse === void 0 ? void 0 : leadResponse.data, token: token }];
104
- }
97
+ leadResponse = _a.sent();
105
98
  if (data.step_name === BUSINESS_STEP_NAMES.IDENTITY_AUTH) {
106
- thunkApi.dispatch(handleCurrentActiveScreen('BUSINESS_IDBOD_STEP'));
99
+ thunkApi.dispatch(handleNextScreenStep('BUSINESS_IDBOD_STEP'));
107
100
  }
108
101
  if (data.step_name === 'business_info') {
109
- thunkApi.dispatch(handleCurrentActiveScreen('BUSINESS_BUSINESS_TYPE_STEP'));
102
+ thunkApi.dispatch(handleNextScreenStep('BUSINESS_BUSINESS_TYPE_STEP'));
110
103
  }
111
- _b.label = 3;
104
+ _a.label = 3;
112
105
  case 3: return [2, { data: data, leadData: leadResponse === null || leadResponse === void 0 ? void 0 : leadResponse.data, token: token }];
113
106
  }
114
107
  });
115
108
  }); });
116
109
  export var verifyLeadOTP = createAsyncThunk('verifyLeadOTP', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
117
- var _a, business, settings, isNID, responseBody, payload, data;
110
+ var _a, business, settings, isNID, responseBody, payload, data, steps, hasBusinessCompleted;
118
111
  var _b, _c, _d;
119
112
  return __generator(this, function (_e) {
120
113
  switch (_e.label) {
@@ -134,11 +127,16 @@ export var verifyLeadOTP = createAsyncThunk('verifyLeadOTP', function (params, t
134
127
  data = (_e.sent()).data;
135
128
  if (!data.errors) {
136
129
  (_d = (_c = settings.data.appConfig).onStepCompleted) === null || _d === void 0 ? void 0 : _d.call(_c, settings.data.activeScreen.name, { otp: params.otp });
130
+ steps = (responseBody === null || responseBody === void 0 ? void 0 : responseBody.steps) || [];
131
+ hasBusinessCompleted = Object.keys(steps).find(function (key) { return key === BUSINESS_STEP_NAMES.BUSINESS_SUCCESS; });
137
132
  if (isNID) {
138
133
  thunkApi.dispatch(handleNextScreenStep());
139
134
  }
140
135
  else {
141
- if (data.step_name === BUSINESS_STEP_NAMES.IDENTITY_AUTH) {
136
+ if (hasBusinessCompleted) {
137
+ thunkApi.dispatch(handleCurrentActiveScreen('BUSINESS_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
138
+ }
139
+ else if (data.step_name === BUSINESS_STEP_NAMES.IDENTITY_AUTH) {
142
140
  thunkApi.dispatch(handleNextScreenStep('BUSINESS_IDBOD_STEP'));
143
141
  }
144
142
  else {