@tap-payments/os-micro-frontend-shared 0.1.435 → 0.1.437
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/components/PaymentSourceFilter/AuthenticationMode.d.ts +7 -0
- package/build/components/PaymentSourceFilter/AuthenticationMode.js +59 -0
- package/build/components/PaymentSourceFilter/index.d.ts +1 -0
- package/build/components/PaymentSourceFilter/index.js +1 -0
- package/build/components/TableCells/CustomCells/AuthenticationStatusCell/constant.js +2 -2
- package/build/components/TableCells/CustomCells/SourceCell/components/AuthenticationMode/AuthenticationMode.d.ts +2 -2
- package/build/components/TableCells/CustomCells/SourceCell/components/AuthenticationMode/AuthenticationMode.js +2 -3
- package/build/components/TableCells/CustomCells/SourceCell/components/AuthenticationMode/index.d.ts +0 -1
- package/build/components/TableCells/CustomCells/SourceCell/components/AuthenticationMode/index.js +0 -1
- package/build/components/TableHeader/TableView/ViewsDropdown.js +2 -0
- package/build/constants/authentication.d.ts +5 -0
- package/build/constants/authentication.js +9 -0
- package/build/constants/table/cell/chargeTableCellWidth.d.ts +5 -0
- package/build/constants/table/cell/chargeTableCellWidth.js +5 -0
- package/build/types/charge.d.ts +19 -0
- package/package.json +1 -1
- package/build/components/TableCells/CustomCells/SourceCell/components/AuthenticationMode/constant.d.ts +0 -5
- package/build/components/TableCells/CustomCells/SourceCell/components/AuthenticationMode/constant.js +0 -9
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { AuthenticationModeType } from '../../constants/index.js';
|
|
2
|
+
import { Filters } from './type';
|
|
3
|
+
export declare const AUTHENTICATION_MODES: {
|
|
4
|
+
label: string;
|
|
5
|
+
value: AuthenticationModeType;
|
|
6
|
+
}[];
|
|
7
|
+
export declare const AuthenticationMode: ({ filters, setFilters }: Filters) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { useCallback, useMemo, useState } from 'react';
|
|
14
|
+
import { AuthenticationModeBadge } from '../TableCells';
|
|
15
|
+
import Menu from '../Menu';
|
|
16
|
+
import { AUTHENTICATION_LABEL, AuthenticationModeType, rightArrow } from '../../constants/index.js';
|
|
17
|
+
import MenuItem from '../MenuItem';
|
|
18
|
+
import { MenuItemStyled } from './style';
|
|
19
|
+
export const AUTHENTICATION_MODES = [
|
|
20
|
+
{ label: AUTHENTICATION_LABEL[AuthenticationModeType.Challenge], value: AuthenticationModeType.Challenge },
|
|
21
|
+
{ label: AUTHENTICATION_LABEL[AuthenticationModeType.Frictionless], value: AuthenticationModeType.Frictionless },
|
|
22
|
+
];
|
|
23
|
+
export const AuthenticationMode = ({ filters, setFilters }) => {
|
|
24
|
+
var _a;
|
|
25
|
+
const [authenticationModeEl, setAuthenticationModeEl] = useState(null);
|
|
26
|
+
const open = Boolean(authenticationModeEl);
|
|
27
|
+
const filterAuthMode = (_a = filters === null || filters === void 0 ? void 0 : filters.auth_mode) !== null && _a !== void 0 ? _a : [];
|
|
28
|
+
const onOpen = (e) => {
|
|
29
|
+
if (!open)
|
|
30
|
+
setAuthenticationModeEl(e.currentTarget);
|
|
31
|
+
};
|
|
32
|
+
const onClose = () => {
|
|
33
|
+
if (open)
|
|
34
|
+
setAuthenticationModeEl(null);
|
|
35
|
+
};
|
|
36
|
+
const authModeAll = useMemo(() => AUTHENTICATION_MODES.map((mode) => mode.value), []);
|
|
37
|
+
const isSelected = useMemo(() => AUTHENTICATION_MODES.length === filterAuthMode.length && filterAuthMode.length > 0, [filterAuthMode.length, authModeAll === null || authModeAll === void 0 ? void 0 : authModeAll.length]);
|
|
38
|
+
const isIndeterminate = useMemo(() => !isSelected && filterAuthMode.length > 0, [filterAuthMode.length, isSelected]);
|
|
39
|
+
const onClick = () => {
|
|
40
|
+
if (isSelected) {
|
|
41
|
+
const { auth_mode } = filters, resetFilters = __rest(filters, ["auth_mode"]);
|
|
42
|
+
setFilters(resetFilters);
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
setFilters(Object.assign(Object.assign({}, filters), { auth_mode: authModeAll }));
|
|
46
|
+
};
|
|
47
|
+
const isSelectedAuthMode = useCallback((selectedAuthMode) => { var _a; return (_a = filterAuthMode.includes(selectedAuthMode)) !== null && _a !== void 0 ? _a : false; }, [filterAuthMode.length]);
|
|
48
|
+
const onClickAuthMode = (e, selectedAuthMode) => {
|
|
49
|
+
var _a;
|
|
50
|
+
e.stopPropagation();
|
|
51
|
+
if (isSelectedAuthMode(selectedAuthMode)) {
|
|
52
|
+
setFilters(Object.assign(Object.assign({}, filters), { auth_mode: (_a = filterAuthMode === null || filterAuthMode === void 0 ? void 0 : filterAuthMode.filter((authMode) => authMode !== selectedAuthMode)) !== null && _a !== void 0 ? _a : [] }));
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
setFilters(Object.assign(Object.assign({}, filters), { auth_mode: [...(filterAuthMode !== null && filterAuthMode !== void 0 ? filterAuthMode : []), selectedAuthMode] }));
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
return (_jsxs(MenuItemStyled, Object.assign({ isSelected: isSelected, isIndeterminate: isIndeterminate, onMouseEnter: onOpen, onMouseLeave: onClose, onClick: onClick }, { children: [_jsx("span", Object.assign({ className: "label" }, { children: "Authentication Mode" })), _jsx("img", { src: rightArrow, alt: "arrow", style: { height: 12 } }), _jsx(Menu, Object.assign({ open: open, anchorEl: authenticationModeEl, placement: "right-start" }, { children: AUTHENTICATION_MODES.map((mode) => (_jsxs(MenuItem, Object.assign({ isSelected: isSelectedAuthMode(mode.value), onClick: (e) => onClickAuthMode(e, mode.value) }, { children: [_jsx(AuthenticationModeBadge, { mode: mode.value }), mode.label] }), mode.value))) }))] })));
|
|
59
|
+
};
|
|
@@ -2,4 +2,5 @@ export { default as PaymentSourceFilter } from './PaymentSourceFilter';
|
|
|
2
2
|
export { default as PaymentMethods } from './PaymentMethods';
|
|
3
3
|
export { default as PaymentSchemes } from './PaymentSchemes';
|
|
4
4
|
export { default as PaymentInitiated } from './PaymentInitiated';
|
|
5
|
+
export { AuthenticationMode } from './AuthenticationMode';
|
|
5
6
|
export * from './type';
|
|
@@ -2,4 +2,5 @@ export { default as PaymentSourceFilter } from './PaymentSourceFilter';
|
|
|
2
2
|
export { default as PaymentMethods } from './PaymentMethods';
|
|
3
3
|
export { default as PaymentSchemes } from './PaymentSchemes';
|
|
4
4
|
export { default as PaymentInitiated } from './PaymentInitiated';
|
|
5
|
+
export { AuthenticationMode } from './AuthenticationMode';
|
|
5
6
|
export * from './type';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { authenticationAttemptedIcon, authenticationFailedIcon, authenticationPendingIcon, authenticationUnavailableIcon, authenticationExemptedWithTransactionIcon, authenticationExemptedWithoutTransactionIcon, authenticationWithTransactionIcon,
|
|
1
|
+
import { authenticationAttemptedIcon, authenticationFailedIcon, authenticationPendingIcon, authenticationUnavailableIcon, authenticationExemptedWithTransactionIcon, authenticationExemptedWithoutTransactionIcon, authenticationWithTransactionIcon, authenticatedSuccessIcon, authenticationDeclinedIcon, authenticationUndeterminedIcon, authenticationNoAuthIcon, } from '../../../../constants/index.js';
|
|
2
2
|
import { statusIcons } from '../../../TableCells/CustomCells/StatusCell/constant';
|
|
3
3
|
export const authenticationStatusIcons = {
|
|
4
4
|
FAILED: authenticationFailedIcon,
|
|
@@ -14,7 +14,7 @@ export const authenticationStatusIcons = {
|
|
|
14
14
|
SUCCESS: authenticatedSuccessIcon,
|
|
15
15
|
AUTHENTICATED: authenticationWithTransactionIcon,
|
|
16
16
|
AUTHENTICATED_WITH_TRANSACTION: authenticationWithTransactionIcon,
|
|
17
|
-
AUTHENTICATED_WITHOUT_TRANSACTION:
|
|
17
|
+
AUTHENTICATED_WITHOUT_TRANSACTION: authenticationWithTransactionIcon,
|
|
18
18
|
AUTHENTICATED_AUTHORIZE_FAILED: authenticationFailedIcon,
|
|
19
19
|
};
|
|
20
20
|
export const chargeStatusIcons = statusIcons;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AuthenticationModeType } from '../../../../../../constants/index.js';
|
|
2
2
|
interface AuthenticationModeBadgeProps {
|
|
3
|
-
mode:
|
|
3
|
+
mode: AuthenticationModeType;
|
|
4
4
|
}
|
|
5
5
|
export declare const AuthenticationModeBadge: ({ mode }: AuthenticationModeBadgeProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
6
6
|
export {};
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import Box from '@mui/material/Box';
|
|
3
3
|
import Tooltip from '../../../../../Tooltip';
|
|
4
|
-
import { ChallengeIcon, FrictionlessIcon } from '../../../../../../constants/index.js';
|
|
5
|
-
import { AuthenticationMode, AUTHENTICATION_LABEL } from './constant';
|
|
4
|
+
import { ChallengeIcon, FrictionlessIcon, AuthenticationModeType, AUTHENTICATION_LABEL } from '../../../../../../constants/index.js';
|
|
6
5
|
export const AuthenticationModeBadge = ({ mode }) => {
|
|
7
6
|
if (!mode)
|
|
8
7
|
return null;
|
|
9
|
-
return (_jsx(Tooltip, Object.assign({ title: AUTHENTICATION_LABEL[mode] }, { children: _jsx(Box, { component: "img", src: mode ===
|
|
8
|
+
return (_jsx(Tooltip, Object.assign({ title: AUTHENTICATION_LABEL[mode] }, { children: _jsx(Box, { component: "img", src: mode === AuthenticationModeType.Challenge ? ChallengeIcon : FrictionlessIcon }) })));
|
|
10
9
|
};
|
|
@@ -74,6 +74,7 @@ function ViewsDropdown({ open, selectedViewInfo, setSelectedViewInfo, anchorEl,
|
|
|
74
74
|
setDraftColumns(null);
|
|
75
75
|
clearOriginalState();
|
|
76
76
|
forceClose();
|
|
77
|
+
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
77
78
|
}
|
|
78
79
|
function applyAndClose() {
|
|
79
80
|
const isDefaultView = selectedViewInfo.id === (defaultTemplate === null || defaultTemplate === void 0 ? void 0 : defaultTemplate.id) || selectedViewInfo.id === 'default' || (defaultTemplate === null || defaultTemplate === void 0 ? void 0 : defaultTemplate.default) === true;
|
|
@@ -88,6 +89,7 @@ function ViewsDropdown({ open, selectedViewInfo, setSelectedViewInfo, anchorEl,
|
|
|
88
89
|
setDraftColumns(null);
|
|
89
90
|
clearOriginalState();
|
|
90
91
|
forceClose();
|
|
92
|
+
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
91
93
|
}
|
|
92
94
|
function toggleColumn(columnName) {
|
|
93
95
|
if (!draftColumns)
|
|
@@ -1,2 +1,7 @@
|
|
|
1
1
|
export declare const unAuthenticatedStatuses: string[];
|
|
2
2
|
export declare const allAuthenticationStatuses: string[];
|
|
3
|
+
export declare enum AuthenticationModeType {
|
|
4
|
+
Challenge = "C",
|
|
5
|
+
Frictionless = "F"
|
|
6
|
+
}
|
|
7
|
+
export declare const AUTHENTICATION_LABEL: Record<AuthenticationModeType, string>;
|
|
@@ -12,3 +12,12 @@ export const unAuthenticatedStatuses = [
|
|
|
12
12
|
'INITIATED',
|
|
13
13
|
];
|
|
14
14
|
export const allAuthenticationStatuses = [...authenticationStatuses, ...unAuthenticatedStatuses];
|
|
15
|
+
export var AuthenticationModeType;
|
|
16
|
+
(function (AuthenticationModeType) {
|
|
17
|
+
AuthenticationModeType["Challenge"] = "C";
|
|
18
|
+
AuthenticationModeType["Frictionless"] = "F";
|
|
19
|
+
})(AuthenticationModeType || (AuthenticationModeType = {}));
|
|
20
|
+
export const AUTHENTICATION_LABEL = {
|
|
21
|
+
[AuthenticationModeType.Challenge]: 'Challenge',
|
|
22
|
+
[AuthenticationModeType.Frictionless]: 'Frictionless',
|
|
23
|
+
};
|
|
@@ -29,6 +29,11 @@ export declare const chargeTableCellWidth: {
|
|
|
29
29
|
readonly text: "180px";
|
|
30
30
|
readonly sheet: "250px";
|
|
31
31
|
};
|
|
32
|
+
readonly auth_code_reference: {
|
|
33
|
+
readonly default: "155px";
|
|
34
|
+
readonly text: "180px";
|
|
35
|
+
readonly sheet: "250px";
|
|
36
|
+
};
|
|
32
37
|
readonly order: {
|
|
33
38
|
readonly default: "80px";
|
|
34
39
|
readonly text: "80px";
|
package/build/types/charge.d.ts
CHANGED
|
@@ -117,6 +117,7 @@ export interface Charge {
|
|
|
117
117
|
status: AuthenticationStatus;
|
|
118
118
|
threeDSecure?: {
|
|
119
119
|
status: AuthenticationStatus;
|
|
120
|
+
provider: string;
|
|
120
121
|
};
|
|
121
122
|
};
|
|
122
123
|
payment: {
|
|
@@ -332,6 +333,24 @@ export interface Charge {
|
|
|
332
333
|
retailer: {
|
|
333
334
|
id: string;
|
|
334
335
|
};
|
|
336
|
+
payment_provider?: {
|
|
337
|
+
technology?: {
|
|
338
|
+
id: string;
|
|
339
|
+
brand?: {
|
|
340
|
+
name?: {
|
|
341
|
+
en: string;
|
|
342
|
+
};
|
|
343
|
+
};
|
|
344
|
+
};
|
|
345
|
+
institution?: {
|
|
346
|
+
id: string;
|
|
347
|
+
brand?: {
|
|
348
|
+
name?: {
|
|
349
|
+
en: string;
|
|
350
|
+
};
|
|
351
|
+
};
|
|
352
|
+
};
|
|
353
|
+
};
|
|
335
354
|
};
|
|
336
355
|
refunds: {
|
|
337
356
|
summary: {
|
package/package.json
CHANGED
package/build/components/TableCells/CustomCells/SourceCell/components/AuthenticationMode/constant.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export var AuthenticationMode;
|
|
2
|
-
(function (AuthenticationMode) {
|
|
3
|
-
AuthenticationMode["Challenge"] = "C";
|
|
4
|
-
AuthenticationMode["Frictionless"] = "F";
|
|
5
|
-
})(AuthenticationMode || (AuthenticationMode = {}));
|
|
6
|
-
export const AUTHENTICATION_LABEL = {
|
|
7
|
-
[AuthenticationMode.Challenge]: 'Challenge',
|
|
8
|
-
[AuthenticationMode.Frictionless]: 'Frictionless',
|
|
9
|
-
};
|