@tap-payments/os-micro-frontend-shared 0.1.376 → 0.1.378

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.
@@ -31,18 +31,7 @@ function BalanceCell(_a) {
31
31
  }, [remainingAmount, currency]);
32
32
  if (percentage === 0)
33
33
  return null;
34
- return (_jsx(TableCell, Object.assign({}, props, { children: _jsx("div", Object.assign({ style: {
35
- display: 'flex',
36
- alignItems: 'center',
37
- justifyContent: 'flex-start',
38
- gap: '8px',
39
- } }, { children: _jsx(Tooltip, Object.assign({ title: generatedTooltip }, { children: _jsxs(BalanceCellContainer, Object.assign({ whileHover: ['animate', 'fadeIn'], animate: "start", sx: {
40
- zIndex: 22,
41
- }, variants: {
42
- animate: {
43
- boxShadow: theme.shadows[4],
44
- },
45
- } }, { children: [_jsxs(PercentageContainer, Object.assign({ percentage: percentage }, { children: [percentage, "% ", _jsx(PiePercentage, { percentage: formatPercentage(percentage) })] })), _jsx(motion.div, Object.assign({ style: {
34
+ return (_jsx(TableCell, Object.assign({}, props, { children: _jsx(Tooltip, Object.assign({ title: generatedTooltip, placement: "top" }, { children: _jsx("div", Object.assign({ style: { height: 24 } }, { children: _jsxs(BalanceCellContainer, Object.assign({ whileHover: ['animate', 'fadeIn'], animate: "start", sx: { zIndex: 22 }, variants: { animate: Object.assign({}, (!!days && { boxShadow: theme.shadows[4] })) } }, { children: [_jsxs(PercentageContainer, Object.assign({ percentage: percentage }, { children: [percentage, "% ", _jsx(PiePercentage, { percentage: formatPercentage(percentage) })] })), !!days && (_jsx(motion.div, Object.assign({ style: {
46
35
  display: 'none',
47
36
  alignItems: 'center',
48
37
  justifyContent: 'center',
@@ -66,6 +55,6 @@ function BalanceCell(_a) {
66
55
  },
67
56
  opacity: 1,
68
57
  },
69
- } }, { children: days && _jsxs("span", { children: [days, " days left"] }) }))] })) })) })) })));
58
+ } }, { children: _jsxs("span", { children: [days, " days left"] }) })))] })) })) })) })));
70
59
  }
71
60
  export default BalanceCell;
@@ -4,7 +4,7 @@ import { useTheme } from '@mui/material';
4
4
  import { motion } from 'framer-motion';
5
5
  import { Resizable } from 're-resizable';
6
6
  import { APP_WINDOW_Z_INDEX, FOOTER_HEIGHT, HEADER_HEIGHT } from '../../constants/index.js';
7
- import { contentStyle, ContentWrapper, initalStyle, resizableMainStyle, AppContainerWrapper, AppContainerContainer } from './style';
7
+ import { contentStyle, ContentWrapper, initialStyle, resizableMainStyle, AppContainerWrapper, AppContainerContainer } from './style';
8
8
  function WindowWrapper({ children, id, onResize, isMaximized, isMinimized, dragControls, onClick, options: { width, height, minHeight, minWidth, maxHeight, maxWidth, order, openOrder = 1 }, sandboxMode = false, sx, }) {
9
9
  const theme = useTheme();
10
10
  const [isDrag, setIsDrag] = useState(true);
@@ -28,7 +28,7 @@ function WindowWrapper({ children, id, onResize, isMaximized, isMinimized, dragC
28
28
  height: isMaximized ? '100vh' : '100%',
29
29
  });
30
30
  }, [isMaximized, width]);
31
- return (_jsx(AppContainerWrapper, Object.assign({ id: "app-container-wrapper", "data-testid": "AppContainerWrapper", sx: sx }, { children: _jsx(AppContainerContainer, Object.assign({ "data-testid": "AppContainerContainer" }, { children: _jsx(motion.div, Object.assign({ id: "app-content", "data-add-id": id, "data-testid": "AppContent", ref: constraintsRef, initial: initalStyle }, { children: _jsx(ContentWrapper, Object.assign({ id: "content-wrapper", drag: !isMaximized && isDrag, dragMomentum: false, dragConstraints: false, onDragStart: onClick, onDragEnter: onClick, onClick: onClick, dragControls: dragControls, dragListener: false, style: Object.assign(Object.assign(Object.assign({}, (order && {
31
+ return (_jsx(AppContainerWrapper, Object.assign({ id: "app-container-wrapper", "data-testid": "AppContainerWrapper", sx: sx }, { children: _jsx(AppContainerContainer, Object.assign({ "data-testid": "AppContainerContainer" }, { children: _jsx(motion.div, Object.assign({ id: "app-content", "data-add-id": id, "data-testid": "AppContent", ref: constraintsRef, initial: initialStyle }, { children: _jsx(ContentWrapper, Object.assign({ id: "content-wrapper", drag: !isMaximized && isDrag, dragMomentum: false, dragConstraints: false, onDragStart: onClick, onDragEnter: onClick, onClick: onClick, dragControls: dragControls, dragListener: false, style: Object.assign(Object.assign(Object.assign({}, (order && {
32
32
  zIndex: Number(order) + APP_WINDOW_Z_INDEX,
33
33
  })), contentStyle), { height }), initial: Object.assign({ marginInline: 'auto', scale: 0, left: 0 }, (!isMaximized && {
34
34
  left: 48 * (openOrder - 1),
@@ -1,7 +1,7 @@
1
1
  import { CSSProperties } from 'react';
2
2
  export declare const resizableMainStyle: CSSProperties;
3
3
  export declare const contentStyle: CSSProperties;
4
- export declare const initalStyle: any;
4
+ export declare const initialStyle: Record<string, unknown>;
5
5
  export declare const ContentWrapper: import("@emotion/styled").StyledComponent<{
6
6
  hidden?: boolean | undefined;
7
7
  color?: string | undefined;
@@ -19,8 +19,7 @@ export const contentStyle = {
19
19
  overflow: 'visible',
20
20
  borderRadius: '12px',
21
21
  };
22
- // eslint-disable-next-line
23
- export const initalStyle = {
22
+ export const initialStyle = {
24
23
  width: 'inherit',
25
24
  height: 'inherit',
26
25
  gridRowStart: 1,
@@ -493,5 +493,6 @@ export const MF_APPS_MAPPER = new Set([
493
493
  APP_CODES.reports.code,
494
494
  APP_CODES.leads.code,
495
495
  APP_CODES.wallet.code,
496
+ APP_CODES.acceptance.code,
496
497
  APP_CODES.authentication.code,
497
498
  ]);
@@ -112,6 +112,7 @@ export type MFWidgetBaseProps = {
112
112
  defaultEntity: Entity;
113
113
  apps: UserApp[];
114
114
  users: SegmentUser[];
115
+ operator: Segment['operator'];
115
116
  organizationId: string;
116
117
  isBusinessSegment: boolean;
117
118
  isAnyMerchantHasMarketplace: boolean;
@@ -2,6 +2,7 @@ import { AuthenticationStatus } from './authentication';
2
2
  import { Country } from './appConfig';
3
3
  import { Currency } from './currency';
4
4
  import { Discount, Item, Vat } from './invoice';
5
+ import { HttpMethodFilters } from './api';
5
6
  export interface ChargeDialog {
6
7
  id: string;
7
8
  order: number;
@@ -114,6 +115,9 @@ export interface Charge {
114
115
  transaction_status?: 'Y' | 'A' | 'N' | 'R';
115
116
  id: string;
116
117
  status: AuthenticationStatus;
118
+ threeDSecure?: {
119
+ status: AuthenticationStatus;
120
+ };
117
121
  };
118
122
  payment: {
119
123
  type: string;
@@ -275,6 +279,13 @@ export interface Charge {
275
279
  currency_rate: number;
276
280
  fee: number;
277
281
  amount: number;
282
+ base: {
283
+ amount: number;
284
+ currency: string;
285
+ rate: number;
286
+ fee: number;
287
+ vat: number;
288
+ };
278
289
  };
279
290
  fees: {
280
291
  amount: number;
@@ -317,6 +328,10 @@ export interface Charge {
317
328
  id: string;
318
329
  legacy_id: string;
319
330
  country: string;
331
+ name: string;
332
+ retailer: {
333
+ id: string;
334
+ };
320
335
  };
321
336
  refunds: {
322
337
  summary: {
@@ -393,4 +408,114 @@ export interface Charge {
393
408
  total_payments_count?: number;
394
409
  };
395
410
  request_body?: Record<string, unknown>;
411
+ risk?: {
412
+ id: string;
413
+ status: 'ACCEPTED' | 'REJECTED' | 'WARNING';
414
+ rules: Array<{
415
+ id: string;
416
+ name: string;
417
+ type: string;
418
+ rule_group: string;
419
+ risk: string;
420
+ value: string;
421
+ decision: string;
422
+ }>;
423
+ };
424
+ }
425
+ export type ChargeFilterStatus = 'captured' | 'unCaptured' | 'all' | 'initiated' | (string & {}) | undefined;
426
+ export interface ChargeFilters extends HttpMethodFilters {
427
+ status?: ChargeFilterStatus;
428
+ periodType?: string;
429
+ destinationIds?: string[];
430
+ }
431
+ export interface RefundChargeRequest {
432
+ charge_id: string;
433
+ amount: number;
434
+ currency: string;
435
+ reason: string;
436
+ user: {
437
+ id: string;
438
+ name: string;
439
+ channel: string;
440
+ };
441
+ }
442
+ export interface ChargeRequestBody {
443
+ id?: string;
444
+ source: {
445
+ id: string;
446
+ };
447
+ amount: number;
448
+ currency: string;
449
+ product: 'TAP OS';
450
+ statement_descriptor?: string;
451
+ customer?: {
452
+ id?: string;
453
+ first_name: string;
454
+ middle_name?: string;
455
+ last_name: string;
456
+ email?: string;
457
+ phone?: {
458
+ country_code: string;
459
+ number: string;
460
+ };
461
+ };
462
+ hashstring?: string;
463
+ post?: {
464
+ url: string;
465
+ };
466
+ redirect?: {
467
+ url: string;
468
+ };
469
+ customer_initiated?: boolean;
470
+ threeDSecure?: boolean;
471
+ merchant?: {
472
+ id: string;
473
+ };
474
+ auto?: {
475
+ type: 'VOID' | 'CAPTURE';
476
+ time: number;
477
+ };
478
+ card_threeDSecure?: boolean;
479
+ order: {
480
+ amount: number;
481
+ merchant?: {
482
+ id: string;
483
+ };
484
+ currency: string;
485
+ customer?: {
486
+ id?: string;
487
+ first_name: string;
488
+ middle_name?: string;
489
+ last_name: string;
490
+ email?: string;
491
+ phone?: {
492
+ country_code: string;
493
+ number: string;
494
+ };
495
+ };
496
+ items: Array<{
497
+ name: string;
498
+ amount: number;
499
+ currency: string;
500
+ quantity: number;
501
+ description: string;
502
+ requires_shipping: boolean;
503
+ }>;
504
+ };
505
+ receipt: {
506
+ email?: boolean;
507
+ sms?: boolean;
508
+ };
509
+ }
510
+ export interface ChargeResponse {
511
+ object: string;
512
+ charges: Charge[];
513
+ has_more: boolean;
514
+ total_count: number;
515
+ count: number;
516
+ live_mode: boolean;
517
+ receipt: {
518
+ id: string;
519
+ };
520
+ status?: string;
396
521
  }
@@ -0,0 +1,27 @@
1
+ export interface Flag {
2
+ id: string;
3
+ status: 'OPEN' | 'CLEARED';
4
+ created: number;
5
+ object: string;
6
+ live_mode: boolean;
7
+ api_version: string;
8
+ amount: number;
9
+ ishold: boolean;
10
+ }
11
+ export interface FlagResponse {
12
+ object: string;
13
+ has_more: boolean;
14
+ live_mode: boolean;
15
+ api_version: string;
16
+ count: number;
17
+ total_count: number;
18
+ }
19
+ export type FlagFilterStatus = 'open' | 'cleared' | 'all' | undefined;
20
+ export interface FlagsFilters {
21
+ status: FlagFilterStatus;
22
+ dateFrom: number;
23
+ dateTo: number;
24
+ transaction?: string[];
25
+ startAfter?: string;
26
+ filteredIds?: string[];
27
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -33,3 +33,4 @@ export * from './utilities';
33
33
  export * from './reports';
34
34
  export * from './document';
35
35
  export * from './toast';
36
+ export * from './flag';
@@ -33,3 +33,4 @@ export * from './utilities';
33
33
  export * from './reports';
34
34
  export * from './document';
35
35
  export * from './toast';
36
+ export * from './flag';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tap-payments/os-micro-frontend-shared",
3
3
  "description": "Shared components and utilities for Tap Payments micro frontends",
4
- "version": "0.1.376",
4
+ "version": "0.1.378",
5
5
  "testVersion": 0,
6
6
  "type": "module",
7
7
  "main": "build/index.js",