@tap-payments/auth-jsconnect 2.1.58-test → 2.1.60-test
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/constants/app.js +24 -0
- package/build/features/app/bank/bankStore.d.ts +5 -1
- package/build/features/app/bank/bankStore.js +62 -57
- package/build/features/app/brand/brandStore.js +2 -0
- package/build/features/app/entity/entityStore.d.ts +5 -1
- package/build/features/app/entity/entityStore.js +75 -70
- package/build/features/app/individual/individualStore.d.ts +5 -1
- package/build/features/app/individual/individualStore.js +88 -83
- package/build/features/app/tax/taxStore.d.ts +5 -1
- package/build/features/app/tax/taxStore.js +51 -46
- package/build/features/bank/Bank.js +31 -24
- package/build/features/bank/screens/PrepareDataLoading/PrepareDataLoading.d.ts +4 -0
- package/build/features/bank/screens/PrepareDataLoading/PrepareDataLoading.js +7 -0
- package/build/features/bank/screens/PrepareDataLoading/index.d.ts +2 -0
- package/build/features/bank/screens/PrepareDataLoading/index.js +2 -0
- package/build/features/bank/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +6 -99
- package/build/features/brand/Brand.js +12 -21
- package/build/features/business/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +6 -98
- package/build/features/connectExpress/screens/Mobile/Mobile.js +1 -1
- package/build/features/connectExpress/screens/Mobile/MobileNumber.js +6 -9
- package/build/features/entity/Entity.js +31 -24
- package/build/features/entity/screens/PrepareDataLoading/PrepareDataLoading.d.ts +4 -0
- package/build/features/entity/screens/PrepareDataLoading/PrepareDataLoading.js +7 -0
- package/build/features/entity/screens/PrepareDataLoading/index.d.ts +2 -0
- package/build/features/entity/screens/PrepareDataLoading/index.js +2 -0
- package/build/features/entity/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +6 -99
- package/build/features/featuresScreens.js +20 -0
- package/build/features/individual/Individual.js +31 -24
- package/build/features/individual/screens/PrepareDataLoading/PrepareDataLoading.d.ts +4 -0
- package/build/features/individual/screens/PrepareDataLoading/PrepareDataLoading.js +7 -0
- package/build/features/individual/screens/PrepareDataLoading/index.d.ts +2 -0
- package/build/features/individual/screens/PrepareDataLoading/index.js +2 -0
- package/build/features/individual/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +6 -99
- package/build/features/password/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +6 -99
- package/build/features/shared/Button/FlowsButtons.js +1 -1
- package/build/features/tax/Tax.js +31 -24
- package/build/features/tax/screens/PrepareDataLoading/PrepareDataLoading.d.ts +4 -0
- package/build/features/tax/screens/PrepareDataLoading/PrepareDataLoading.js +7 -0
- package/build/features/tax/screens/PrepareDataLoading/index.d.ts +2 -0
- package/build/features/tax/screens/PrepareDataLoading/index.js +2 -0
- package/build/features/tax/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +6 -99
- package/build/hooks/index.d.ts +1 -0
- package/build/hooks/index.js +1 -0
- package/build/hooks/useVerifyToken.d.ts +15 -0
- package/build/hooks/useVerifyToken.js +25 -0
- package/package.json +1 -1
|
@@ -9,107 +9,14 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
9
|
};
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
|
-
import {
|
|
13
|
-
import { memo
|
|
14
|
-
import {
|
|
15
|
-
import { styled } from '@mui/material/styles';
|
|
16
|
-
import { FlowsButtons } from '../../../shared/Button';
|
|
17
|
-
import { ICONS_NAMES, PASSWORD_OPERATION_TYPE } from '../../../../constants';
|
|
18
|
-
import { useAppSelector, useLanguage } from '../../../../hooks';
|
|
19
|
-
import { getResetFlowUrl, showLastFour, concatenateObjectValues, shortenString, shortenBrand } from '../../../../utils';
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import { memo } from 'react';
|
|
14
|
+
import { useAppSelector } from '../../../../hooks';
|
|
20
15
|
import { taxSelector } from '../../../app/tax/taxStore';
|
|
21
|
-
import
|
|
22
|
-
import Text from '../../../../components/Text';
|
|
23
|
-
import Container from '../../../shared/Containers/ScreenContainer';
|
|
24
|
-
import AcceptancePayouts from '../../../shared/AcceptancePayouts';
|
|
25
|
-
import { settingsSelector } from '../../../../app/settings';
|
|
26
|
-
var TitleStyled = styled(Text)(function (_a) {
|
|
27
|
-
var _b;
|
|
28
|
-
var theme = _a.theme;
|
|
29
|
-
return (__assign(__assign({}, theme.typography.body1), (_b = { fontWeight: theme.typography.fontWeightBold, color: theme.palette.text.primary, lineHeight: 1.75, paddingBottom: theme.spacing(3) }, _b[theme.breakpoints.down('sm')] = {}, _b)));
|
|
30
|
-
});
|
|
31
|
-
var ContainerStyled = styled(Container)(function (_a) {
|
|
32
|
-
var theme = _a.theme;
|
|
33
|
-
return ({
|
|
34
|
-
justifyContent: 'space-between',
|
|
35
|
-
minHeight: theme.spacing(30),
|
|
36
|
-
alignItems: 'center'
|
|
37
|
-
});
|
|
38
|
-
});
|
|
39
|
-
var ButtonGroupStyled = styled(Box)(function (_a) {
|
|
40
|
-
var theme = _a.theme;
|
|
41
|
-
return ({
|
|
42
|
-
width: '100%',
|
|
43
|
-
paddingTop: theme.spacing(3)
|
|
44
|
-
});
|
|
45
|
-
});
|
|
16
|
+
import SuccessFlowButtons from '../../../shared/SuccessFlowButtons';
|
|
46
17
|
var SuccessWithFlowButtons = function () {
|
|
47
|
-
var _a, _b, _c, _d, _e, _f;
|
|
48
|
-
var t = useTranslation().t;
|
|
49
|
-
var isAr = useLanguage().isAr;
|
|
50
18
|
var data = useAppSelector(taxSelector).data;
|
|
51
|
-
var
|
|
52
|
-
|
|
53
|
-
var _j = nameObj || {}, en = _j.en, ar = _j.ar;
|
|
54
|
-
var username = isAr ? concatenateObjectValues(ar || en, ['first', 'last']) : concatenateObjectValues(en, ['first', 'last']);
|
|
55
|
-
var licenseNumber = ((_a = entity === null || entity === void 0 ? void 0 : entity.license) === null || _a === void 0 ? void 0 : _a.number) || '';
|
|
56
|
-
var bankName = shortenString(bank === null || bank === void 0 ? void 0 : bank.bank_name, 20) || t('bank');
|
|
57
|
-
var iban = showLastFour((bank === null || bank === void 0 ? void 0 : bank.iban) || '');
|
|
58
|
-
var taxID = vatID || '';
|
|
59
|
-
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) || '';
|
|
60
|
-
var entityLegalName = shortenString(isAr ? (_d = entity === null || entity === void 0 ? void 0 : entity.legal_name) === null || _d === void 0 ? void 0 : _d.ar : (_e = entity === null || entity === void 0 ? void 0 : entity.legal_name) === null || _e === void 0 ? void 0 : _e.en, 20) || '';
|
|
61
|
-
var isAcceptance = merchant === null || merchant === void 0 ? void 0 : merchant.is_acceptance_allowed;
|
|
62
|
-
var isPayout = merchant === null || merchant === void 0 ? void 0 : merchant.is_payout_allowed;
|
|
63
|
-
var identification = user.identification;
|
|
64
|
-
var maskedId = (identification === null || identification === void 0 ? void 0 : identification.id) ? " ".concat(t('masking_symbols')).concat((_f = identification === null || identification === void 0 ? void 0 : identification.id) === null || _f === void 0 ? void 0 : _f.slice(-2)) : '';
|
|
65
|
-
var settings = useAppSelector(settingsSelector);
|
|
66
|
-
var _k = data.verify.responseBody || { contact: {}, board_id: '' }, board_id = _k.board_id, board_info_id = _k.board_info_id;
|
|
67
|
-
var contact = business === null || business === void 0 ? void 0 : business.primary_contact;
|
|
68
|
-
var email = (contact || { email: '' }).email;
|
|
69
|
-
var url = getResetFlowUrl('/password', settings.data.language, PASSWORD_OPERATION_TYPE.RESET_PASSWORD, board_id, board_info_id);
|
|
70
|
-
var reMapFlowData = function (flows) {
|
|
71
|
-
if (flows === void 0) { flows = []; }
|
|
72
|
-
var images = ICONS_NAMES;
|
|
73
|
-
var mappedFlows = flows
|
|
74
|
-
.filter(function (item) { return item === null || item === void 0 ? void 0 : item.name; })
|
|
75
|
-
.map(function (_a) {
|
|
76
|
-
var name = _a.name, url = _a.url, status = _a.status;
|
|
77
|
-
var type = status === 'initiated' || status === 'in_progress' ? 'pending' : 'completed';
|
|
78
|
-
var title = t("".concat(name, "_flow_").concat(type), {
|
|
79
|
-
individual_name: username.toLowerCase() + maskedId,
|
|
80
|
-
business_type: entityLegalName,
|
|
81
|
-
brand: brandName,
|
|
82
|
-
license_number: licenseNumber ? t('masking_symbols') + showLastFour(licenseNumber) : '',
|
|
83
|
-
bank_name: bankName,
|
|
84
|
-
iban: iban ? t('masking_symbols') + iban : '',
|
|
85
|
-
tax_id: taxID ? t('masking_symbols') + showLastFour(taxID) : ''
|
|
86
|
-
});
|
|
87
|
-
var isCompleted = status === 'completed' && name !== 'password';
|
|
88
|
-
var isIndividual = name === 'individual';
|
|
89
|
-
var src = isCompleted ? "".concat(name, "_green_icon") : "".concat(name, "_filled_icon");
|
|
90
|
-
var hoverSrc = "".concat(name, "_white_icon");
|
|
91
|
-
return {
|
|
92
|
-
name: name,
|
|
93
|
-
status: status,
|
|
94
|
-
title: title,
|
|
95
|
-
href: url,
|
|
96
|
-
src: images[src],
|
|
97
|
-
hoverSrc: images[hoverSrc],
|
|
98
|
-
isCompleted: isCompleted,
|
|
99
|
-
sx: isIndividual ? { textTransform: 'capitalize' } : {}
|
|
100
|
-
};
|
|
101
|
-
});
|
|
102
|
-
setButtons(mappedFlows);
|
|
103
|
-
};
|
|
104
|
-
useEffect(function () {
|
|
105
|
-
if ((flows === null || flows === void 0 ? void 0 : flows.length) > 0)
|
|
106
|
-
reMapFlowData(flows);
|
|
107
|
-
}, [flows, isAr]);
|
|
108
|
-
return (_jsxs(ContainerStyled, { children: [_jsxs(TitleStyled, { children: [t('account_details'), " "] }), _jsx(AcceptancePayouts, { showAcceptance: isAcceptance, showPayout: isPayout }), _jsx(ButtonGroupStyled, { children: _jsx(FlowsButtons, { buttons: buttons, data: {
|
|
109
|
-
flowName: data.flowName,
|
|
110
|
-
email: email,
|
|
111
|
-
emailUrl: url,
|
|
112
|
-
brandName: shortenBrand(brandName)
|
|
113
|
-
} }) })] }));
|
|
19
|
+
var _a = data.verify.responseBody || {}, flows = _a.flows, entity = _a.entity, brand = _a.brand, bank = _a.bank_account, merchant = _a.merchant, user = _a.user, business = _a.business, board_id = _a.board_id, board_info_id = _a.board_info_id, name = _a.name;
|
|
20
|
+
return (_jsx(SuccessFlowButtons, { flowName: data.flowName, bank: bank, brand: brand, entity: entity, merchant: merchant, user: __assign({ names: { en: name } }, user), business: business, boardId: board_id, boardInfoId: board_info_id, flows: flows || [] }));
|
|
114
21
|
};
|
|
115
22
|
export default memo(SuccessWithFlowButtons);
|
package/build/hooks/index.d.ts
CHANGED
package/build/hooks/index.js
CHANGED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ScreenStepNavigation } from '../@types';
|
|
2
|
+
interface VerifyLeadTokenProps {
|
|
3
|
+
token: string;
|
|
4
|
+
isInternally?: boolean;
|
|
5
|
+
}
|
|
6
|
+
interface IVerifyToken {
|
|
7
|
+
verify: (props: VerifyLeadTokenProps) => any;
|
|
8
|
+
internalToken?: string;
|
|
9
|
+
open: boolean;
|
|
10
|
+
settingLoading: boolean;
|
|
11
|
+
navigation: ScreenStepNavigation[];
|
|
12
|
+
loadingScreenName: string;
|
|
13
|
+
}
|
|
14
|
+
export declare const useVerifyToken: ({ verify, internalToken, navigation, open, settingLoading, loadingScreenName }: IVerifyToken) => void;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { handleCurrentActiveScreen, handleLanguage } from '../app/settings';
|
|
2
|
+
import { getParameterByName } from '../utils';
|
|
3
|
+
import { useAppDispatch } from './useAppDispatch';
|
|
4
|
+
import { useEffect } from 'react';
|
|
5
|
+
export var useVerifyToken = function (_a) {
|
|
6
|
+
var verify = _a.verify, internalToken = _a.internalToken, navigation = _a.navigation, open = _a.open, settingLoading = _a.settingLoading, loadingScreenName = _a.loadingScreenName;
|
|
7
|
+
var dispatch = useAppDispatch();
|
|
8
|
+
var verifyTokenFun = function () {
|
|
9
|
+
var token = getParameterByName('token') || internalToken;
|
|
10
|
+
var lang = getParameterByName('lang');
|
|
11
|
+
if (lang)
|
|
12
|
+
dispatch(handleLanguage(lang));
|
|
13
|
+
if (!token)
|
|
14
|
+
throw new Error('Auth token is not found!');
|
|
15
|
+
dispatch(verify({ token: token, isInternally: !!internalToken }));
|
|
16
|
+
};
|
|
17
|
+
useEffect(function () {
|
|
18
|
+
if (!settingLoading && open)
|
|
19
|
+
verifyTokenFun();
|
|
20
|
+
}, [settingLoading, open]);
|
|
21
|
+
useEffect(function () {
|
|
22
|
+
if (internalToken && open)
|
|
23
|
+
dispatch(handleCurrentActiveScreen(loadingScreenName));
|
|
24
|
+
}, [navigation]);
|
|
25
|
+
};
|