@tap-payments/auth-jsconnect 2.0.3 → 2.0.6
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/@types/app.d.ts +5 -0
- package/build/@types/form.d.ts +4 -1
- package/build/api/auth.d.ts +20 -3
- package/build/api/axios.js +8 -9
- package/build/api/data.d.ts +1 -0
- package/build/api/data.js +9 -2
- package/build/api/entity.d.ts +13 -1
- package/build/api/entity.js +20 -2
- package/build/api/index.d.ts +7 -4
- package/build/api/lead.d.ts +3 -1
- package/build/api/lead.js +14 -2
- package/build/assets/locales/ar.json +4 -1
- package/build/assets/locales/en.json +4 -1
- package/build/components/AnimationFlow/AnimationFlow.d.ts +2 -1
- package/build/components/AnimationFlow/AnimationFlow.js +2 -2
- package/build/components/AnimationFlow/BottomSheet.d.ts +2 -1
- package/build/components/AnimationFlow/BottomSheet.js +16 -4
- package/build/components/FileInput/DragAndDrop.d.ts +7 -0
- package/build/components/FileInput/DragAndDrop.js +39 -0
- package/build/components/FileInput/UploadInput.d.ts +7 -0
- package/build/components/FileInput/UploadInput.js +38 -0
- package/build/components/FileInput/index.d.ts +3 -0
- package/build/components/FileInput/index.js +3 -0
- package/build/constants/api.d.ts +3 -1
- package/build/constants/api.js +7 -3
- package/build/constants/app.d.ts +5 -0
- package/build/constants/app.js +55 -9
- package/build/constants/assets.d.ts +1 -0
- package/build/constants/assets.js +1 -0
- package/build/constants/validation.d.ts +2 -0
- package/build/constants/validation.js +2 -0
- package/build/features/app/bank/bankStore.d.ts +1 -0
- package/build/features/app/bank/bankStore.js +61 -20
- package/build/features/app/business/businessStore.d.ts +3 -5
- package/build/features/app/business/businessStore.js +149 -50
- package/build/features/app/connect/connectStore.d.ts +5 -10
- package/build/features/app/connect/connectStore.js +135 -41
- package/build/features/app/individual/individualStore.d.ts +3 -2
- package/build/features/app/individual/individualStore.js +52 -39
- package/build/features/app/password/passwordStore.d.ts +32 -1
- package/build/features/app/password/passwordStore.js +199 -16
- package/build/features/app/tax/taxStore.js +21 -14
- package/build/features/bank/Bank.js +3 -4
- package/build/features/bank/screens/BankDetails/BankDetails.js +2 -1
- package/build/features/bank/screens/BankDetails/BankStatement.d.ts +3 -0
- package/build/features/bank/screens/BankDetails/BankStatement.js +38 -0
- package/build/features/bank/screens/BankDetails/validation.d.ts +3 -0
- package/build/features/bank/screens/BankDetails/validation.js +1 -0
- package/build/features/bank/screens/ResetPasswordSuccess/ResetPasswordSuccess.d.ts +5 -0
- package/build/features/bank/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +9 -0
- package/build/features/bank/screens/ResetPasswordSuccess/index.d.ts +3 -0
- package/build/features/bank/screens/ResetPasswordSuccess/index.js +2 -0
- package/build/features/bank/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +23 -15
- package/build/features/business/Business.js +3 -4
- package/build/features/business/screens/Activities/Activities.js +2 -1
- package/build/features/business/screens/Activities/LicenseName.d.ts +5 -0
- package/build/features/business/screens/Activities/LicenseName.js +30 -0
- package/build/features/business/screens/IDBOD/IDBOD.js +1 -1
- package/build/features/business/screens/OTP/OTPInput.js +3 -9
- package/build/features/business/screens/ResetPasswordSuccess/ResetPasswordSuccess.d.ts +5 -0
- package/build/features/business/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +9 -0
- package/build/features/business/screens/ResetPasswordSuccess/index.d.ts +3 -0
- package/build/features/business/screens/ResetPasswordSuccess/index.js +2 -0
- package/build/features/business/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +24 -17
- package/build/features/connect/Connect.js +1 -1
- package/build/features/connect/screens/Merchant/BrandList.js +1 -5
- package/build/features/connect/screens/Merchant/Merchant.js +10 -8
- package/build/features/connect/screens/Merchant/validation.js +4 -2
- package/build/features/connect/screens/Mobile/Mobile.js +2 -2
- package/build/features/connect/screens/Mobile/MobileNumber.js +1 -1
- package/build/features/connect/screens/NID/IDNumber.js +1 -1
- package/build/features/connect/screens/NID/NID.js +2 -2
- package/build/features/connect/screens/OTP/OTPInput.js +3 -13
- package/build/features/featuresScreens.js +20 -5
- package/build/features/individual/Individual.js +3 -4
- package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +7 -1
- package/build/features/individual/screens/AdditionalIndividualInfo/Occupation.d.ts +10 -0
- package/build/features/individual/screens/AdditionalIndividualInfo/Occupation.js +89 -0
- package/build/features/individual/screens/AdditionalIndividualInfo/validation.d.ts +3 -0
- package/build/features/individual/screens/AdditionalIndividualInfo/validation.js +1 -0
- package/build/features/individual/screens/ResetPasswordSuccess/ResetPasswordSuccess.d.ts +5 -0
- package/build/features/individual/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +9 -0
- package/build/features/individual/screens/ResetPasswordSuccess/index.d.ts +3 -0
- package/build/features/individual/screens/ResetPasswordSuccess/index.js +2 -0
- package/build/features/individual/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +23 -15
- package/build/features/password/Password.js +11 -6
- package/build/features/password/screens/CreatePassword/CreatePassword.js +9 -2
- package/build/features/password/screens/OTP/OTP.d.ts +8 -0
- package/build/features/password/screens/OTP/OTP.js +78 -0
- package/build/features/password/screens/OTP/OTPInput.d.ts +5 -0
- package/build/features/password/screens/OTP/OTPInput.js +46 -0
- package/build/features/password/screens/OTP/index.d.ts +3 -0
- package/build/features/password/screens/OTP/index.js +2 -0
- package/build/features/password/screens/OTP/validation.d.ts +8 -0
- package/build/features/password/screens/OTP/validation.js +4 -0
- package/build/features/password/screens/ResetPasswordSuccess/ResetPasswordSuccess.d.ts +5 -0
- package/build/features/password/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +9 -0
- package/build/features/password/screens/ResetPasswordSuccess/index.d.ts +3 -0
- package/build/features/password/screens/ResetPasswordSuccess/index.js +2 -0
- package/build/features/password/screens/Success/Success.js +8 -2
- package/build/features/password/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +24 -16
- package/build/features/password/screens/Verify/OTPInput.d.ts +2 -2
- package/build/features/password/screens/Verify/OTPInput.js +1 -1
- package/build/features/shared/Button/Button.js +1 -1
- package/build/features/shared/Button/FlowsButtons.d.ts +8 -2
- package/build/features/shared/Button/FlowsButtons.js +90 -6
- package/build/features/shared/Button/SuccessButton.js +31 -13
- package/build/features/shared/UploadFile/UploadFile.d.ts +21 -0
- package/build/features/shared/UploadFile/UploadFile.js +77 -0
- package/build/features/shared/UploadFile/index.d.ts +2 -0
- package/build/features/shared/UploadFile/index.js +2 -0
- package/build/features/tax/Tax.js +3 -4
- package/build/features/tax/screens/ResetPasswordSuccess/ResetPasswordSuccess.d.ts +5 -0
- package/build/features/tax/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +9 -0
- package/build/features/tax/screens/ResetPasswordSuccess/index.d.ts +3 -0
- package/build/features/tax/screens/ResetPasswordSuccess/index.js +2 -0
- package/build/features/tax/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +23 -15
- package/build/hooks/useAppTheme.js +3 -2
- package/build/index.css +4 -0
- package/build/theme/theme.d.ts +1 -1
- package/build/theme/theme.js +1 -2
- package/build/utils/string.d.ts +1 -0
- package/build/utils/string.js +6 -1
- package/package.json +2 -1
|
@@ -50,9 +50,9 @@ import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
|
|
|
50
50
|
import API from '../../../api';
|
|
51
51
|
import { FlowsTypes } from '../../../@types';
|
|
52
52
|
import { hasKey } from '../../../utils';
|
|
53
|
-
import { handleNextScreenStep } from '../../../app/settings';
|
|
53
|
+
import { handleNextScreenStep, handleCurrentActiveScreen } from '../../../app/settings';
|
|
54
54
|
import { TAX_STEP_NAMES } from '../../../constants';
|
|
55
|
-
export var verifyLeadToken = createAsyncThunk('
|
|
55
|
+
export var verifyLeadToken = createAsyncThunk('taxVerifyLeadToken', function (token, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
56
56
|
var payload, data, leadResponse, _a, steps, entity, hasTaxCompleted;
|
|
57
57
|
return __generator(this, function (_b) {
|
|
58
58
|
switch (_b.label) {
|
|
@@ -65,24 +65,28 @@ export var verifyLeadToken = createAsyncThunk('verifyLeadToken', function (token
|
|
|
65
65
|
case 1:
|
|
66
66
|
data = (_b.sent()).data;
|
|
67
67
|
leadResponse = undefined;
|
|
68
|
-
if (!(!(data === null || data === void 0 ? void 0 : data.errors) && !(data === null || data === void 0 ? void 0 : data.mw_error))) return [3,
|
|
68
|
+
if (!(!(data === null || data === void 0 ? void 0 : data.errors) && !(data === null || data === void 0 ? void 0 : data.mw_error))) return [3, 6];
|
|
69
69
|
return [4, API.leadService.retrieveLead(data === null || data === void 0 ? void 0 : data.id)];
|
|
70
70
|
case 2:
|
|
71
71
|
leadResponse = _b.sent();
|
|
72
72
|
_a = leadResponse.data, steps = _a.steps, entity = _a.entity;
|
|
73
73
|
hasTaxCompleted = hasKey(steps, TAX_STEP_NAMES.TAX_SUCCESS);
|
|
74
|
-
if (!
|
|
75
|
-
|
|
74
|
+
if (!(data.step_name === TAX_STEP_NAMES.PHONE_AUTH)) return [3, 3];
|
|
75
|
+
thunkApi.dispatch(handleCurrentActiveScreen('TAX_VERIFY_STEP'));
|
|
76
|
+
return [3, 6];
|
|
76
77
|
case 3:
|
|
78
|
+
if (!hasTaxCompleted) return [3, 5];
|
|
79
|
+
return [4, thunkApi.dispatch(retrieveEntityInfo(entity === null || entity === void 0 ? void 0 : entity.id))];
|
|
80
|
+
case 4:
|
|
77
81
|
_b.sent();
|
|
78
82
|
thunkApi.dispatch(handleNextScreenStep('TAX_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
|
|
79
|
-
return [3,
|
|
80
|
-
case
|
|
83
|
+
return [3, 6];
|
|
84
|
+
case 5:
|
|
81
85
|
if (data.step_name === TAX_STEP_NAMES.TAX_INFO) {
|
|
82
86
|
thunkApi.dispatch(handleNextScreenStep('TAX_TAX_DETAILS_STEP'));
|
|
83
87
|
}
|
|
84
|
-
_b.label =
|
|
85
|
-
case
|
|
88
|
+
_b.label = 6;
|
|
89
|
+
case 6: return [2, { data: data, leadData: leadResponse === null || leadResponse === void 0 ? void 0 : leadResponse.data, token: token }];
|
|
86
90
|
}
|
|
87
91
|
});
|
|
88
92
|
}); });
|
|
@@ -159,7 +163,8 @@ export var updateTaxInfo = createAsyncThunk('updateTaxInfo', function (params, t
|
|
|
159
163
|
requestBody = {
|
|
160
164
|
id: (_c = (_b = tax.data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.entity) === null || _c === void 0 ? void 0 : _c.id,
|
|
161
165
|
vat_id: params.vatId,
|
|
162
|
-
step_name: TAX_STEP_NAMES.TAX_INFO
|
|
166
|
+
step_name: TAX_STEP_NAMES.TAX_INFO,
|
|
167
|
+
is_vat_acknowledged: params.confirmPolicy
|
|
163
168
|
};
|
|
164
169
|
return [4, API.entityService.updateEntityInfo(requestBody)];
|
|
165
170
|
case 1:
|
|
@@ -172,7 +177,7 @@ export var updateTaxInfo = createAsyncThunk('updateTaxInfo', function (params, t
|
|
|
172
177
|
}
|
|
173
178
|
});
|
|
174
179
|
}); });
|
|
175
|
-
export var updateLeadSuccess = createAsyncThunk('
|
|
180
|
+
export var updateLeadSuccess = createAsyncThunk('taxUpdateLeadSuccess', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
176
181
|
var _a, settings, tax, id, payload, data;
|
|
177
182
|
var _b, _c, _d, _e, _f;
|
|
178
183
|
return __generator(this, function (_g) {
|
|
@@ -191,13 +196,15 @@ export var updateLeadSuccess = createAsyncThunk('updateLeadSuccess', function (p
|
|
|
191
196
|
return [4, API.leadService.updateLead(payload)];
|
|
192
197
|
case 1:
|
|
193
198
|
data = (_g.sent()).data;
|
|
199
|
+
if (!!data.errors) return [3, 3];
|
|
194
200
|
return [4, thunkApi.dispatch(retrieveEntityInfo((_b = data.entity) === null || _b === void 0 ? void 0 : _b.id))];
|
|
195
201
|
case 2:
|
|
196
202
|
_g.sent();
|
|
197
203
|
(_d = (_c = settings.data.appConfig).onStepCompleted) === null || _d === void 0 ? void 0 : _d.call(_c, settings.data.activeScreen.name, params);
|
|
198
204
|
(_f = (_e = settings.data.appConfig).onFlowCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, { data: data });
|
|
199
205
|
thunkApi.dispatch(handleNextScreenStep());
|
|
200
|
-
|
|
206
|
+
_g.label = 3;
|
|
207
|
+
case 3: return [2, { response: data, formData: params }];
|
|
201
208
|
}
|
|
202
209
|
});
|
|
203
210
|
}); });
|
|
@@ -344,8 +351,8 @@ export var taxSlice = createSlice({
|
|
|
344
351
|
state.error = description;
|
|
345
352
|
return;
|
|
346
353
|
}
|
|
347
|
-
var flows = response.flows, steps = response.steps;
|
|
348
|
-
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { flows: flows, steps: steps });
|
|
354
|
+
var flows = response.flows, steps = response.steps, bank_account = response.bank_account;
|
|
355
|
+
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { flows: flows, steps: steps, bank_account: bank_account });
|
|
349
356
|
})
|
|
350
357
|
.addCase(updateLeadSuccess.pending, function (state) {
|
|
351
358
|
state.loading = true;
|
|
@@ -36,18 +36,17 @@ var Bank = memo(function (props) {
|
|
|
36
36
|
var verifyToken = function () {
|
|
37
37
|
var token = getParameterByName('token');
|
|
38
38
|
var lang = getParameterByName('lang');
|
|
39
|
+
if (lang)
|
|
40
|
+
dispatch(handleLanguage(lang));
|
|
39
41
|
if (!token)
|
|
40
42
|
throw new Error('Auth token is not found!');
|
|
41
|
-
if (!lang)
|
|
42
|
-
throw new Error('Language is not found!');
|
|
43
|
-
dispatch(handleLanguage(lang));
|
|
44
43
|
dispatch(verifyLeadToken(token));
|
|
45
44
|
};
|
|
46
45
|
useEffect(function () {
|
|
47
46
|
if (!settingLoading)
|
|
48
47
|
verifyToken();
|
|
49
48
|
}, [settingLoading]);
|
|
50
|
-
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading || customLoading }, { children: _jsx(AnimationFlow, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading || customLoading, error: error, open: open, breakpoint: 'sm', footer: _jsx(CustomFooter, {}) }, { children: _jsx(FeatureContainer, { children: bankFeatureScreens.map(function (_a, index) {
|
|
49
|
+
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading || customLoading }, { children: _jsx(AnimationFlow, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading || customLoading, error: error, open: open, breakpoint: 'sm', footer: _jsx(CustomFooter, {}), screenId: activeScreen.name }, { children: _jsx(FeatureContainer, { children: bankFeatureScreens.map(function (_a, index) {
|
|
51
50
|
var Element = _a.element, name = _a.name;
|
|
52
51
|
var isActive = activeScreen.name === name;
|
|
53
52
|
return (_jsx(Collapse, __assign({ in: isActive, timeout: { enter: 1000, exit: 800 } }, { children: _jsx(Element, {}) }), index));
|
|
@@ -27,6 +27,7 @@ import { bankSelector, createBankAccount } from '../../../app/bank/bankStore';
|
|
|
27
27
|
import Form from '../../../../components/Form';
|
|
28
28
|
import { handleCurrentActiveScreen } from '../../../../app/settings';
|
|
29
29
|
import ConfirmPolicy from './ConfirmPolicy';
|
|
30
|
+
import BankStatement from './BankStatement';
|
|
30
31
|
var FormStyled = styled(Form)(function () { return ({
|
|
31
32
|
display: 'flex',
|
|
32
33
|
flexDirection: 'column',
|
|
@@ -56,6 +57,6 @@ var BankDetails = function () {
|
|
|
56
57
|
dispatch(handleCurrentActiveScreen('BANK_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
|
|
57
58
|
};
|
|
58
59
|
var disabled = ibanChecking || !methods.formState.isValid;
|
|
59
|
-
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(Beneficiary, {}), _jsx(IBAN, { fetchingIban: function (value) { return setIbanChecking(value); }, ibanChecking: ibanChecking }), _jsx(BankName, {}), _jsx(ConfirmPolicy, {}), _jsx(ButtonStyled, __assign({ onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, loading: loading, error: t(error || '') }, { children: t('confirm') }))] })) })) }));
|
|
60
|
+
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(Beneficiary, {}), _jsx(IBAN, { fetchingIban: function (value) { return setIbanChecking(value); }, ibanChecking: ibanChecking }), _jsx(BankName, {}), _jsx(BankStatement, {}), _jsx(ConfirmPolicy, {}), _jsx(ButtonStyled, __assign({ onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, loading: loading, error: t(error || '') }, { children: t('confirm') }))] })) })) }));
|
|
60
61
|
};
|
|
61
62
|
export default BankDetails;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { styled } from '@mui/material/styles';
|
|
4
|
+
import { ScreenContainer } from '../../../../features/shared/Containers';
|
|
5
|
+
import { useTranslation } from 'react-i18next';
|
|
6
|
+
import { useController, useFormContext } from 'react-hook-form';
|
|
7
|
+
import UploadFile from '../../../../features/shared/UploadFile';
|
|
8
|
+
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
9
|
+
import { bankSelector, uploadBankStatement } from '../../../../features/app/bank/bankStore';
|
|
10
|
+
var FeatureStyled = styled(ScreenContainer)(function (_a) {
|
|
11
|
+
var theme = _a.theme;
|
|
12
|
+
return ({
|
|
13
|
+
marginBlockStart: theme.spacing(3)
|
|
14
|
+
});
|
|
15
|
+
});
|
|
16
|
+
var BankStatement = function () {
|
|
17
|
+
var _a, _b;
|
|
18
|
+
var dispatch = useAppDispatch();
|
|
19
|
+
var data = useAppSelector(bankSelector).data;
|
|
20
|
+
var t = useTranslation().t;
|
|
21
|
+
var control = useFormContext().control;
|
|
22
|
+
var bankStatementControl = useController({ name: 'bankStatementId', control: control });
|
|
23
|
+
var error = (_a = bankStatementControl.fieldState.error) === null || _a === void 0 ? void 0 : _a.message;
|
|
24
|
+
var uploading = data.bankData.uploading;
|
|
25
|
+
var handleBankStatementChange = function (file) {
|
|
26
|
+
dispatch(uploadBankStatement(file));
|
|
27
|
+
};
|
|
28
|
+
var handleReset = function () {
|
|
29
|
+
bankStatementControl.field.onChange('');
|
|
30
|
+
};
|
|
31
|
+
React.useEffect(function () {
|
|
32
|
+
var _a, _b;
|
|
33
|
+
if ((_a = data.bankData.responseBody) === null || _a === void 0 ? void 0 : _a.fileId)
|
|
34
|
+
bankStatementControl.field.onChange((_b = data.bankData.responseBody) === null || _b === void 0 ? void 0 : _b.fileId);
|
|
35
|
+
}, [(_b = data.bankData.responseBody) === null || _b === void 0 ? void 0 : _b.fileId]);
|
|
36
|
+
return (_jsx(FeatureStyled, { children: _jsx(UploadFile, { label: t('title_bank_statement'), dragTitle: t('drag_and_drop'), uploadTitle: t('title_upload_file'), onFileUploaded: handleBankStatementChange, loading: uploading, onReset: handleReset, error: error && t(error) }) }));
|
|
37
|
+
};
|
|
38
|
+
export default BankStatement;
|
|
@@ -3,15 +3,18 @@ export declare const BankValidation: yup.ObjectSchema<import("yup/lib/object").A
|
|
|
3
3
|
iban: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
4
4
|
bankName: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
5
5
|
beneficiaryName: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
6
|
+
bankStatementId: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
6
7
|
confirmPolicy: yup.BooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject, true>;
|
|
7
8
|
}>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
8
9
|
iban: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
9
10
|
bankName: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
10
11
|
beneficiaryName: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
12
|
+
bankStatementId: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
11
13
|
confirmPolicy: yup.BooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject, true>;
|
|
12
14
|
}>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
13
15
|
iban: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
14
16
|
bankName: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
15
17
|
beneficiaryName: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
18
|
+
bankStatementId: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
16
19
|
confirmPolicy: yup.BooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject, true>;
|
|
17
20
|
}>>>;
|
|
@@ -12,5 +12,6 @@ export var BankValidation = yup.object().shape({
|
|
|
12
12
|
.string()
|
|
13
13
|
.matches(REGEX_BENEFICIARY_NAME, 'beneficiary_name_invalid')
|
|
14
14
|
.required('beneficiary_name_required'),
|
|
15
|
+
bankStatementId: yup.string().optional(),
|
|
15
16
|
confirmPolicy: yup.boolean().required('alert_bank_confirm').isTrue('alert_bank_confirm')
|
|
16
17
|
});
|
|
@@ -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 SuccessScreen from '../../../shared/SuccessScreen';
|
|
5
|
+
var ResetPasswordSuccess = function (_a) {
|
|
6
|
+
var t = useTranslation().t;
|
|
7
|
+
return (_jsx(SuccessScreen, { title: t("reset_password_success_title"), description: t("reset_password_success_description"), showEmailProviders: true }));
|
|
8
|
+
};
|
|
9
|
+
export default React.memo(ResetPasswordSuccess);
|
|
@@ -10,18 +10,19 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
12
|
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
import
|
|
13
|
+
import { memo, useEffect, useState } from 'react';
|
|
14
14
|
import { useTranslation } from 'react-i18next';
|
|
15
15
|
import { styled } from '@mui/material/styles';
|
|
16
16
|
import { FlowsButtons } from '../../../shared/Button';
|
|
17
|
-
import { ICONS_NAMES } from '../../../../constants';
|
|
17
|
+
import { ICONS_NAMES, PASSWORD_OPERATION_TYPE } from '../../../../constants';
|
|
18
18
|
import { useAppSelector, useLanguage } from '../../../../hooks';
|
|
19
|
-
import {
|
|
19
|
+
import { getResetFlowUrl, showLastFour } from '../../../../utils';
|
|
20
20
|
import { bankSelector } from '../../../app/bank/bankStore';
|
|
21
21
|
import Box from '@mui/material/Box';
|
|
22
22
|
import Text from '../../../../components/Text';
|
|
23
23
|
import Container from '../../../shared/Containers/ScreenContainer';
|
|
24
24
|
import AcceptancePayouts from '../../../shared/AcceptancePayouts';
|
|
25
|
+
import { settingsSelector } from '../../../../app/settings';
|
|
25
26
|
var TitleStyled = styled(Text)(function (_a) {
|
|
26
27
|
var _b;
|
|
27
28
|
var theme = _a.theme;
|
|
@@ -46,39 +47,45 @@ var SuccessWithFlowButtons = function () {
|
|
|
46
47
|
var _a, _b, _c;
|
|
47
48
|
var t = useTranslation().t;
|
|
48
49
|
var isAr = useLanguage().isAr;
|
|
49
|
-
var _d = React.useState(false), isAcceptance = _d[0], setIsAcceptance = _d[1];
|
|
50
|
-
var _e = React.useState(false), isPayout = _e[0], setIsPayout = _e[1];
|
|
51
50
|
var data = useAppSelector(bankSelector).data;
|
|
52
|
-
var
|
|
53
|
-
var
|
|
51
|
+
var _d = data.verify.responseBody || {}, flows = _d.flows, nameObj = _d.name, entity = _d.entity, brand = _d.brand, bank = _d.bank_account, merchant = _d.merchant, identification_id = _d.identification_id;
|
|
52
|
+
var _e = useState([]), buttons = _e[0], setButtons = _e[1];
|
|
54
53
|
var username = ((nameObj === null || nameObj === void 0 ? void 0 : nameObj.first) || '') + ' ' + ((nameObj === null || nameObj === void 0 ? void 0 : nameObj.last) || '');
|
|
55
54
|
var licenseNumber = ((_a = entity === null || entity === void 0 ? void 0 : entity.license) === null || _a === void 0 ? void 0 : _a.number) || '';
|
|
56
55
|
var bankName = (bank === null || bank === void 0 ? void 0 : bank.name) || t('bank');
|
|
57
56
|
var iban = showLastFour((bank === null || bank === void 0 ? void 0 : bank.iban) || '');
|
|
58
57
|
var taxID = (entity === null || entity === void 0 ? void 0 : entity.tax_number) || '';
|
|
59
58
|
var brandName = (isAr ? (_b = brand === null || brand === void 0 ? void 0 : brand.name) === null || _b === void 0 ? void 0 : _b.ar : (_c = brand === null || brand === void 0 ? void 0 : brand.name) === null || _c === void 0 ? void 0 : _c.en) || '';
|
|
59
|
+
var isAcceptance = merchant === null || merchant === void 0 ? void 0 : merchant.is_acceptance_allowed;
|
|
60
|
+
var isPayout = merchant === null || merchant === void 0 ? void 0 : merchant.is_payout_allowed;
|
|
61
|
+
var maskedId = !!identification_id ? " ".concat(t('masking_symbols')).concat(identification_id) : '';
|
|
62
|
+
var settings = useAppSelector(settingsSelector);
|
|
63
|
+
var _f = data.verify.responseBody || { contact: {}, id: '' }, contact = _f.contact, id = _f.id;
|
|
64
|
+
var email = (contact || { email: '' }).email;
|
|
65
|
+
var url = getResetFlowUrl('/password', settings.data.language, PASSWORD_OPERATION_TYPE.RESET_PASSWORD, id);
|
|
60
66
|
var reMapFlowData = function (flows) {
|
|
61
67
|
if (flows === void 0) { flows = []; }
|
|
62
68
|
var images = ICONS_NAMES;
|
|
63
|
-
var mappedFlows = flows
|
|
69
|
+
var mappedFlows = flows
|
|
70
|
+
.filter(function (item) { return item.name; })
|
|
71
|
+
.map(function (_a) {
|
|
64
72
|
var name = _a.name, url = _a.url, status = _a.status;
|
|
65
73
|
var type = status === 'initiated' ? 'pending' : 'completed';
|
|
66
74
|
var title = t("".concat(name, "_flow_").concat(type), {
|
|
67
|
-
individual_name: username.toLowerCase(),
|
|
75
|
+
individual_name: username.toLowerCase() + maskedId,
|
|
68
76
|
business_type: brandName,
|
|
69
77
|
license_number: t('masking_symbols') + showLastFour(licenseNumber),
|
|
70
78
|
bank_name: bankName,
|
|
71
79
|
iban: t('masking_symbols') + iban,
|
|
72
80
|
tax_id: t('masking_symbols') + showLastFour(taxID)
|
|
73
81
|
});
|
|
74
|
-
if ("business_flow_completed" === "".concat(name, "_flow_").concat(type))
|
|
75
|
-
setIsAcceptance(true);
|
|
76
82
|
var isCompleted = status === 'completed' && name !== 'password';
|
|
77
83
|
var isIndividual = name === 'individual';
|
|
78
84
|
var src = isCompleted ? "".concat(name, "_green_icon") : "".concat(name, "_filled_icon");
|
|
79
85
|
var hoverSrc = "".concat(name, "_white_icon");
|
|
80
86
|
return {
|
|
81
87
|
name: name,
|
|
88
|
+
status: status,
|
|
82
89
|
title: title,
|
|
83
90
|
href: url,
|
|
84
91
|
src: images[src],
|
|
@@ -88,14 +95,15 @@ var SuccessWithFlowButtons = function () {
|
|
|
88
95
|
};
|
|
89
96
|
});
|
|
90
97
|
setButtons(mappedFlows);
|
|
91
|
-
var isAllCompleted = allAreTruthy(flows, 'completed', 'status', 'password');
|
|
92
|
-
if (isAllCompleted)
|
|
93
|
-
setIsPayout(true);
|
|
94
98
|
};
|
|
95
99
|
useEffect(function () {
|
|
96
100
|
if ((flows === null || flows === void 0 ? void 0 : flows.length) > 0)
|
|
97
101
|
reMapFlowData(flows);
|
|
98
102
|
}, [flows, isAr]);
|
|
99
|
-
return (_jsxs(ContainerStyled, { children: [_jsxs(TitleStyled, { children: [t('account_details'), " "] }), _jsx(AcceptancePayouts, { showAcceptance: isAcceptance, showPayout: isPayout }), _jsx(ButtonGroupStyled, { children: _jsx(FlowsButtons, { buttons: buttons,
|
|
103
|
+
return (_jsxs(ContainerStyled, { children: [_jsxs(TitleStyled, { children: [t('account_details'), " "] }), _jsx(AcceptancePayouts, { showAcceptance: isAcceptance, showPayout: isPayout }), _jsx(ButtonGroupStyled, { children: _jsx(FlowsButtons, { buttons: buttons, data: {
|
|
104
|
+
flowName: data.flowName,
|
|
105
|
+
email: email,
|
|
106
|
+
emailUrl: url
|
|
107
|
+
} }) })] }));
|
|
100
108
|
};
|
|
101
109
|
export default memo(SuccessWithFlowButtons);
|
|
@@ -36,18 +36,17 @@ var Business = memo(function (props) {
|
|
|
36
36
|
var verifyToken = function () {
|
|
37
37
|
var token = getParameterByName('token');
|
|
38
38
|
var lang = getParameterByName('lang');
|
|
39
|
+
if (lang)
|
|
40
|
+
dispatch(handleLanguage(lang));
|
|
39
41
|
if (!token)
|
|
40
42
|
throw new Error('Auth token is not found!');
|
|
41
|
-
if (!lang)
|
|
42
|
-
throw new Error('Language is not found!');
|
|
43
|
-
dispatch(handleLanguage(lang));
|
|
44
43
|
dispatch(verifyLeadToken(token));
|
|
45
44
|
};
|
|
46
45
|
useEffect(function () {
|
|
47
46
|
if (!settingLoading)
|
|
48
47
|
verifyToken();
|
|
49
48
|
}, [settingLoading]);
|
|
50
|
-
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading || customLoading }, { children: _jsx(AnimationFlow, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading || customLoading, error: error, open: open, breakpoint: 'sm', footer: _jsx(CustomFooter, {}) }, { children: _jsx(FeatureContainer, { children: businessFeatureScreens.map(function (_a, index) {
|
|
49
|
+
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading || customLoading }, { children: _jsx(AnimationFlow, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading || customLoading, error: error, open: open, breakpoint: 'sm', footer: _jsx(CustomFooter, {}), screenId: activeScreen.name }, { children: _jsx(FeatureContainer, { children: businessFeatureScreens.map(function (_a, index) {
|
|
51
50
|
var Element = _a.element, name = _a.name;
|
|
52
51
|
var isActive = activeScreen.name === name;
|
|
53
52
|
return (_jsx(Collapse, __assign({ in: isActive, timeout: { enter: 1000, exit: 800 } }, { children: _jsx(Element, {}) }), index));
|
|
@@ -26,6 +26,7 @@ import Collapse from '../../../../components/Collapse';
|
|
|
26
26
|
import OperationStartDate from './OperationStartDate';
|
|
27
27
|
import { businessSelector, clearError, updateActivitiesInfo } from '../../../app/business/businessStore';
|
|
28
28
|
import { ActivitiesValidationSchema } from './validation';
|
|
29
|
+
import LicenseName from './LicenseName';
|
|
29
30
|
var FormStyled = styled(Form)(function () { return ({
|
|
30
31
|
display: 'flex',
|
|
31
32
|
flexDirection: 'column'
|
|
@@ -72,6 +73,6 @@ var Activities = function () {
|
|
|
72
73
|
anchorEl ? setAnchorEl(false) : setAnchorEl(true);
|
|
73
74
|
};
|
|
74
75
|
var disabled = !methods.formState.isValid || !!error;
|
|
75
|
-
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsxs(Collapse, __assign({ in: !collapse }, { children: [_jsx(ActivitiesList, { onListOpen: function () { return handleMenuClick(); }, onListClose: function () { return handleMenuClick(); } }), _jsx(Collapse, __assign({ in: !anchorEl }, { children: _jsx(SalesChannels, {}) }))] })), _jsx(Collapse, __assign({ in: !anchorEl }, { children: _jsx(OperationStartDate, { onDateClicked: handleCollapseOpenClose }) })), _jsx(Collapse, __assign({ in: !collapse && !anchorEl }, { children: _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, isAr: isAr, disabled: disabled, loading: loading, error: t(error || '') }, { children: t('next') })) }))] })) })) }));
|
|
76
|
+
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(Collapse, __assign({ in: !collapse && !anchorEl }, { children: _jsx(LicenseName, {}) })), _jsxs(Collapse, __assign({ in: !collapse }, { children: [_jsx(ActivitiesList, { onListOpen: function () { return handleMenuClick(); }, onListClose: function () { return handleMenuClick(); } }), _jsx(Collapse, __assign({ in: !anchorEl }, { children: _jsx(SalesChannels, {}) }))] })), _jsx(Collapse, __assign({ in: !anchorEl }, { children: _jsx(OperationStartDate, { onDateClicked: handleCollapseOpenClose }) })), _jsx(Collapse, __assign({ in: !collapse && !anchorEl }, { children: _jsx(Button, __assign({ disableBack: true, onBackClicked: function () { return onBack(); }, isAr: isAr, disabled: disabled, loading: loading, error: t(error || '') }, { children: t('next') })) }))] })) })) }));
|
|
76
77
|
};
|
|
77
78
|
export default Activities;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import * as React from 'react';
|
|
14
|
+
import { useTranslation } from 'react-i18next';
|
|
15
|
+
import { ScreenContainer } from '../../../shared/Containers';
|
|
16
|
+
import Input from '../../../shared/Input';
|
|
17
|
+
import Collapse from '../../../../components/Collapse';
|
|
18
|
+
import { useAppSelector, useLanguage } from '../../../../hooks';
|
|
19
|
+
import { businessSelector } from '../../../app/business/businessStore';
|
|
20
|
+
import CheckIcon from '../../../shared/CheckIcon';
|
|
21
|
+
var LicenseName = function (_a) {
|
|
22
|
+
var _b, _c, _d;
|
|
23
|
+
var t = useTranslation().t;
|
|
24
|
+
var isAr = useLanguage().isAr;
|
|
25
|
+
var data = useAppSelector(businessSelector).data;
|
|
26
|
+
var entity = (((_b = data.verify) === null || _b === void 0 ? void 0 : _b.responseBody) || {}).entity;
|
|
27
|
+
var name = isAr ? (_c = entity === null || entity === void 0 ? void 0 : entity.legal_name) === null || _c === void 0 ? void 0 : _c.ar : (_d = entity === null || entity === void 0 ? void 0 : entity.legal_name) === null || _d === void 0 ? void 0 : _d.en;
|
|
28
|
+
return (_jsx(Collapse, __assign({ in: !!name }, { children: _jsx(ScreenContainer, { children: _jsx(Input, { label: t('license_name_label'), readOnly: true, value: name, sx: { '& .MuiInputBase-input': { cursor: 'auto' } }, endAdornment: _jsx(CheckIcon, {}) }) }) })));
|
|
29
|
+
};
|
|
30
|
+
export default React.memo(LicenseName);
|
|
@@ -44,7 +44,7 @@ var IDBOD = function (_a) {
|
|
|
44
44
|
dispatch(clearError());
|
|
45
45
|
}, [methods.formState.isValid]);
|
|
46
46
|
var onSubmit = function (data) {
|
|
47
|
-
dispatch(updateLeadIdentity(
|
|
47
|
+
dispatch(updateLeadIdentity(data));
|
|
48
48
|
};
|
|
49
49
|
var handleCollapseOpenClose = function (flag) {
|
|
50
50
|
setCollapse(flag);
|
|
@@ -17,8 +17,8 @@ import Box from '@mui/material/Box/Box';
|
|
|
17
17
|
import { styled } from '@mui/material/styles';
|
|
18
18
|
import OTPField from '../../../shared/OTP';
|
|
19
19
|
import { DEFAULT_TIMER_VALUE } from '../../../../constants';
|
|
20
|
-
import {
|
|
21
|
-
import { useAppDispatch
|
|
20
|
+
import { resendOTPLeadIdentity } from '../../../app/business/businessStore';
|
|
21
|
+
import { useAppDispatch } from '../../../../hooks';
|
|
22
22
|
var BoxStyled = styled(Box)(function (_a) {
|
|
23
23
|
var theme = _a.theme;
|
|
24
24
|
return ({
|
|
@@ -32,19 +32,13 @@ var OTPInput = function (_a) {
|
|
|
32
32
|
var t = useTranslation().t;
|
|
33
33
|
var dispatch = useAppDispatch();
|
|
34
34
|
var otpControl = useController({ name: 'otp', control: control });
|
|
35
|
-
var data = useAppSelector(businessSelector).data;
|
|
36
|
-
var nidData = data.nidData;
|
|
37
35
|
var handleOnOTPChange = function (otp) {
|
|
38
36
|
otpControl.field.onChange(otp);
|
|
39
37
|
};
|
|
40
38
|
var handleOnResendOTP = function () {
|
|
41
39
|
if (otpControl.field.value)
|
|
42
40
|
setValue('otp', '', { shouldValidate: true });
|
|
43
|
-
|
|
44
|
-
nid: nidData.nid,
|
|
45
|
-
dob: nidData.dob
|
|
46
|
-
};
|
|
47
|
-
dispatch(updateLeadIdentity(__assign(__assign({}, params), { isResend: true })));
|
|
41
|
+
dispatch(resendOTPLeadIdentity());
|
|
48
42
|
};
|
|
49
43
|
var otpValue = otpControl.field.value;
|
|
50
44
|
return (_jsx(BoxStyled, __assign({ dir: 'ltr' }, { children: _jsx(OTPField, { timeEndLabel: t('ide_otp_resend_label'), timerInSeconds: DEFAULT_TIMER_VALUE, onResetClick: handleOnResendOTP, value: otpValue, onChange: function (number) { return handleOnOTPChange(number.toString()); } }) })));
|
|
@@ -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 SuccessScreen from '../../../shared/SuccessScreen';
|
|
5
|
+
var ResetPasswordSuccess = function (_a) {
|
|
6
|
+
var t = useTranslation().t;
|
|
7
|
+
return (_jsx(SuccessScreen, { title: t("reset_password_success_title"), description: t("reset_password_success_description"), showEmailProviders: true }));
|
|
8
|
+
};
|
|
9
|
+
export default React.memo(ResetPasswordSuccess);
|
|
@@ -10,18 +10,19 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
12
|
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
import
|
|
13
|
+
import { memo, useEffect, useState } from 'react';
|
|
14
14
|
import { useTranslation } from 'react-i18next';
|
|
15
15
|
import { styled } from '@mui/material/styles';
|
|
16
16
|
import { FlowsButtons } from '../../../shared/Button';
|
|
17
|
-
import { ICONS_NAMES } from '../../../../constants';
|
|
18
|
-
import {
|
|
17
|
+
import { ICONS_NAMES, PASSWORD_OPERATION_TYPE } from '../../../../constants';
|
|
18
|
+
import { useAppSelector, useLanguage } from '../../../../hooks';
|
|
19
19
|
import { businessSelector } from '../../../app/business/businessStore';
|
|
20
|
-
import {
|
|
20
|
+
import { getResetFlowUrl, showLastFour } from '../../../../utils';
|
|
21
21
|
import Box from '@mui/material/Box';
|
|
22
22
|
import Text from '../../../../components/Text';
|
|
23
23
|
import Container from '../../../shared/Containers/ScreenContainer';
|
|
24
24
|
import AcceptancePayouts from '../../../shared/AcceptancePayouts';
|
|
25
|
+
import { settingsSelector } from '../../../../app/settings';
|
|
25
26
|
var TitleStyled = styled(Text)(function (_a) {
|
|
26
27
|
var _b;
|
|
27
28
|
var theme = _a.theme;
|
|
@@ -46,40 +47,45 @@ var SuccessWithFlowButtons = function () {
|
|
|
46
47
|
var _a, _b, _c;
|
|
47
48
|
var t = useTranslation().t;
|
|
48
49
|
var isAr = useLanguage().isAr;
|
|
49
|
-
var dispatch = useAppDispatch();
|
|
50
|
-
var _d = React.useState(false), isAcceptance = _d[0], setIsAcceptance = _d[1];
|
|
51
|
-
var _e = React.useState(false), isPayout = _e[0], setIsPayout = _e[1];
|
|
52
50
|
var data = useAppSelector(businessSelector).data;
|
|
53
|
-
var
|
|
54
|
-
var
|
|
51
|
+
var _d = data.verify.responseBody || {}, flows = _d.flows, nameObj = _d.name, entity = _d.entity, brand = _d.brand, bank = _d.bank_account, merchant = _d.merchant, identification_id = _d.identification_id;
|
|
52
|
+
var _e = useState([]), buttons = _e[0], setButtons = _e[1];
|
|
55
53
|
var username = ((nameObj === null || nameObj === void 0 ? void 0 : nameObj.first) || '') + ' ' + ((nameObj === null || nameObj === void 0 ? void 0 : nameObj.last) || '');
|
|
56
54
|
var licenseNumber = ((_a = entity === null || entity === void 0 ? void 0 : entity.license) === null || _a === void 0 ? void 0 : _a.number) || '';
|
|
57
55
|
var bankName = (bank === null || bank === void 0 ? void 0 : bank.bank_name) || t('bank');
|
|
58
56
|
var iban = showLastFour((bank === null || bank === void 0 ? void 0 : bank.iban) || '');
|
|
59
57
|
var taxID = (entity === null || entity === void 0 ? void 0 : entity.tax_number) || '';
|
|
60
58
|
var brandName = (isAr ? (_b = brand === null || brand === void 0 ? void 0 : brand.name) === null || _b === void 0 ? void 0 : _b.ar : (_c = brand === null || brand === void 0 ? void 0 : brand.name) === null || _c === void 0 ? void 0 : _c.en) || '';
|
|
59
|
+
var isAcceptance = merchant === null || merchant === void 0 ? void 0 : merchant.is_acceptance_allowed;
|
|
60
|
+
var isPayout = merchant === null || merchant === void 0 ? void 0 : merchant.is_payout_allowed;
|
|
61
|
+
var maskedId = !!identification_id ? " ".concat(t('masking_symbols')).concat(identification_id) : '';
|
|
62
|
+
var settings = useAppSelector(settingsSelector);
|
|
63
|
+
var _f = data.verify.responseBody || { contact: {}, id: '' }, contact = _f.contact, id = _f.id;
|
|
64
|
+
var email = (contact || { email: '' }).email;
|
|
65
|
+
var url = getResetFlowUrl('/password', settings.data.language, PASSWORD_OPERATION_TYPE.RESET_PASSWORD, id);
|
|
61
66
|
var reMapFlowData = function (flows) {
|
|
62
67
|
if (flows === void 0) { flows = []; }
|
|
63
68
|
var images = ICONS_NAMES;
|
|
64
|
-
var mappedFlows = flows
|
|
69
|
+
var mappedFlows = flows
|
|
70
|
+
.filter(function (item) { return item.name; })
|
|
71
|
+
.map(function (_a) {
|
|
65
72
|
var name = _a.name, url = _a.url, status = _a.status;
|
|
66
73
|
var type = status === 'initiated' ? 'pending' : 'completed';
|
|
67
74
|
var title = t("".concat(name, "_flow_").concat(type), {
|
|
68
|
-
individual_name: username.toLowerCase(),
|
|
75
|
+
individual_name: username.toLowerCase() + maskedId,
|
|
69
76
|
business_type: brandName,
|
|
70
77
|
license_number: t('masking_symbols') + showLastFour(licenseNumber),
|
|
71
78
|
bank_name: bankName,
|
|
72
79
|
iban: t('masking_symbols') + iban,
|
|
73
80
|
tax_id: t('masking_symbols') + showLastFour(taxID)
|
|
74
81
|
});
|
|
75
|
-
if ("business_flow_completed" === "".concat(name, "_flow_").concat(type))
|
|
76
|
-
setIsAcceptance(true);
|
|
77
82
|
var isCompleted = status === 'completed' && name !== 'password';
|
|
78
83
|
var isIndividual = name === 'individual';
|
|
79
84
|
var src = isCompleted ? "".concat(name, "_green_icon") : "".concat(name, "_filled_icon");
|
|
80
85
|
var hoverSrc = "".concat(name, "_white_icon");
|
|
81
86
|
return {
|
|
82
87
|
name: name,
|
|
88
|
+
status: status,
|
|
83
89
|
title: title,
|
|
84
90
|
href: url,
|
|
85
91
|
src: images[src],
|
|
@@ -89,14 +95,15 @@ var SuccessWithFlowButtons = function () {
|
|
|
89
95
|
};
|
|
90
96
|
});
|
|
91
97
|
setButtons(mappedFlows);
|
|
92
|
-
var isAllCompleted = allAreTruthy(flows, 'completed', 'status', 'password');
|
|
93
|
-
if (isAllCompleted)
|
|
94
|
-
setIsPayout(true);
|
|
95
98
|
};
|
|
96
99
|
useEffect(function () {
|
|
97
100
|
if ((flows === null || flows === void 0 ? void 0 : flows.length) > 0)
|
|
98
101
|
reMapFlowData(flows);
|
|
99
102
|
}, [flows, isAr]);
|
|
100
|
-
return (_jsxs(ContainerStyled, { children: [_jsxs(TitleStyled, { children: [t('account_details'), " "] }), _jsx(AcceptancePayouts, { showAcceptance: isAcceptance, showPayout: isPayout }), _jsx(ButtonGroupStyled, { children: _jsx(FlowsButtons, { buttons: buttons,
|
|
103
|
+
return (_jsxs(ContainerStyled, { children: [_jsxs(TitleStyled, { children: [t('account_details'), " "] }), _jsx(AcceptancePayouts, { showAcceptance: isAcceptance, showPayout: isPayout }), _jsx(ButtonGroupStyled, { children: _jsx(FlowsButtons, { buttons: buttons, data: {
|
|
104
|
+
flowName: data.flowName,
|
|
105
|
+
email: email,
|
|
106
|
+
emailUrl: url
|
|
107
|
+
} }) })] }));
|
|
101
108
|
};
|
|
102
109
|
export default memo(SuccessWithFlowButtons);
|
|
@@ -32,7 +32,7 @@ var Connect = memo(function (props) {
|
|
|
32
32
|
useErrorListener(connectError || error);
|
|
33
33
|
useStepStartedListener();
|
|
34
34
|
var activeScreen = data.activeScreen, isTapOrigin = data.isTapOrigin, open = data.open;
|
|
35
|
-
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading }, { children: _jsx(AnimationFlow, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading, error: error, open: open, footer: _jsx(CustomFooter, {}) }, { children: _jsx(FeatureContainer, { children: connectFeatureScreens.map(function (_a, index) {
|
|
35
|
+
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading }, { children: _jsx(AnimationFlow, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading, error: error, open: open, footer: _jsx(CustomFooter, {}), screenId: activeScreen.name }, { children: _jsx(FeatureContainer, { children: connectFeatureScreens.map(function (_a, index) {
|
|
36
36
|
var Element = _a.element, name = _a.name;
|
|
37
37
|
var isActive = activeScreen.name === name;
|
|
38
38
|
return (_jsx(Collapse, __assign({ in: isActive, timeout: { enter: 1000, exit: 800 } }, { children: _jsx(Element, {}) }), index));
|
|
@@ -51,10 +51,8 @@ var BrandList = function (_a) {
|
|
|
51
51
|
var _b = React.useState(null), anchorEl = _b[0], setAnchorEl = _b[1];
|
|
52
52
|
var t = useTranslation().t;
|
|
53
53
|
var isAr = useLanguage().isAr;
|
|
54
|
-
var
|
|
55
|
-
var linksControl = useController({ control: control, name: 'links' });
|
|
54
|
+
var control = useFormContext().control;
|
|
56
55
|
var selectedBrandControl = useController({ control: control, name: 'selectedBrandItem' });
|
|
57
|
-
var links = linksControl.field.value;
|
|
58
56
|
var selectedBrand = selectedBrandControl.field.value;
|
|
59
57
|
var onOpenBrandList = function (event) {
|
|
60
58
|
var _a;
|
|
@@ -79,8 +77,6 @@ var BrandList = function (_a) {
|
|
|
79
77
|
var onSelectItem = function (brand) {
|
|
80
78
|
selectedBrandControl.field.onChange(brand);
|
|
81
79
|
onCloseBrandList();
|
|
82
|
-
var website = brand.website;
|
|
83
|
-
setValue('links', __assign(__assign({}, links), { website: website }), { shouldValidate: true });
|
|
84
80
|
};
|
|
85
81
|
return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, { children: [_jsx(InputStyled, { label: t('select_brand_label'), readOnly: true, onClick: !!anchorEl ? onCloseBrandList : onOpenBrandList, endAdornment: _jsx(ExpandIcon, { anchorEl: !!anchorEl }), placeholder: t('choose_brand'), value: t(getBrandName(selectedBrand)) }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleList, { searchKeyPath: 'id', list: list, onSelectItem: onSelectItem, renderItem: function (item) {
|
|
86
82
|
return (_jsxs(_Fragment, { children: [_jsx(BrandContainer, { children: _jsx(BrandNameText, __assign({ isSelected: getBrandId(item) === getBrandId(selectedBrand) }, { children: isOtherLicense(item) ? t(getBrandName(item)) : getBrandName(item) })) }), getBrandId(item) === getBrandId(selectedBrand) && _jsx(CheckIcon, {})] }));
|