@adyen/adyen-web 5.31.1 → 5.31.3

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.
@@ -44,7 +44,7 @@ declare class DropinElement extends UIElement<DropinElementProps> {
44
44
  openFirstPaymentMethod?: boolean;
45
45
  onSubmit?: (data: any, component: any) => void;
46
46
  onReady?: () => void;
47
- onSelect?: (paymentMethod: any) => void;
47
+ onSelect?: (paymentMethod: UIElement<any>) => void;
48
48
  showRemovePaymentMethodButton?: boolean;
49
49
  onDisableStoredPaymentMethod?: (storedPaymentMethod: any, resolve: any, reject: any) => void;
50
50
  session?: import("../../core/CheckoutSession/CheckoutSession").default;
@@ -6,10 +6,10 @@ interface PaymentMethodItemProps {
6
6
  isSelected: boolean;
7
7
  isLoaded: boolean;
8
8
  isLoading: boolean;
9
- isDisabling: boolean;
9
+ isDisablingPaymentMethod: boolean;
10
10
  showRemovePaymentMethodButton: boolean;
11
11
  onDisableStoredPaymentMethod: (paymentMethod: any) => void;
12
- onSelect: () => void;
12
+ onSelect: (paymentMethod: UIElement) => void;
13
13
  standalone: boolean;
14
14
  className?: string;
15
15
  }
@@ -20,24 +20,22 @@ declare class PaymentMethodItem extends Component<PaymentMethodItemProps> {
20
20
  isLoaded: boolean;
21
21
  isLoading: boolean;
22
22
  showDisableStoredPaymentMethodConfirmation: boolean;
23
- onSelect: () => void;
24
23
  };
25
24
  state: {
26
25
  showDisableStoredPaymentMethodConfirmation: boolean;
27
26
  activeBrand: any;
28
27
  };
29
- onClick: () => void;
30
28
  componentDidMount(): void;
31
29
  componentWillUnmount(): void;
32
30
  toggleDisableConfirmation: () => void;
33
31
  onDisableStoredPaymentMethod: () => void;
34
- render({ paymentMethod, isSelected, isDisabling, isLoaded, isLoading, onSelect, standalone }: {
32
+ private handleOnListItemClick;
33
+ render({ paymentMethod, isSelected, isDisablingPaymentMethod, isLoaded, isLoading, standalone }: {
35
34
  paymentMethod: any;
36
35
  isSelected: any;
37
- isDisabling: any;
36
+ isDisablingPaymentMethod: any;
38
37
  isLoaded: any;
39
38
  isLoading: any;
40
- onSelect: any;
41
39
  standalone: any;
42
40
  }, { activeBrand }: {
43
41
  activeBrand: any;
@@ -3,30 +3,33 @@ import UIElement from '../../../UIElement';
3
3
  import { Order, OrderStatus } from '../../../../types';
4
4
  interface PaymentMethodListProps {
5
5
  paymentMethods: UIElement[];
6
- instantPaymentMethods: UIElement[];
7
- activePaymentMethod: UIElement;
8
- cachedPaymentMethods: object;
6
+ activePaymentMethod?: UIElement;
7
+ instantPaymentMethods?: UIElement[];
8
+ /**
9
+ * Map that keeps track of which Payment methods (UIElements) already got rendered in the UI
10
+ */
11
+ cachedPaymentMethods: Record<string, boolean>;
9
12
  order?: Order;
10
- orderStatus: OrderStatus;
13
+ orderStatus?: OrderStatus;
11
14
  openFirstStoredPaymentMethod?: boolean;
12
15
  openFirstPaymentMethod?: boolean;
13
16
  showRemovePaymentMethodButton?: boolean;
14
- onSelect: (paymentMethod: any) => void;
15
- onDisableStoredPaymentMethod: (storedPaymentMethod: any) => void;
17
+ onSelect?: (paymentMethod: UIElement) => void;
18
+ onDisableStoredPaymentMethod?: (storedPaymentMethod: any) => void;
16
19
  onOrderCancel?: (order: any) => void;
17
- isDisabling: boolean;
20
+ isDisablingPaymentMethod?: boolean;
18
21
  isLoading: boolean;
19
22
  }
20
23
  declare class PaymentMethodList extends Component<PaymentMethodListProps> {
21
24
  static defaultProps: PaymentMethodListProps;
22
25
  componentDidMount(): void;
23
- onSelect: (paymentMethod: any) => () => void;
24
- render({ paymentMethods, instantPaymentMethods, activePaymentMethod, cachedPaymentMethods, isLoading }: {
26
+ render({ paymentMethods, instantPaymentMethods, activePaymentMethod, cachedPaymentMethods, isLoading, isDisablingPaymentMethod }: {
25
27
  paymentMethods: any;
26
28
  instantPaymentMethods: any;
27
29
  activePaymentMethod: any;
28
30
  cachedPaymentMethods: any;
29
31
  isLoading: any;
32
+ isDisablingPaymentMethod: any;
30
33
  }): h.JSX.Element;
31
34
  }
32
35
  export default PaymentMethodList;
@@ -32,7 +32,7 @@ export interface DropinElementProps extends UIElementProps {
32
32
  openFirstPaymentMethod?: boolean;
33
33
  onSubmit?: (data: any, component: any) => void;
34
34
  onReady?: () => void;
35
- onSelect?: (paymentMethod: any) => void;
35
+ onSelect?: (paymentMethod: UIElement) => void;
36
36
  /**
37
37
  * Show/Hide the remove payment method button on stored payment methods
38
38
  * Requires {@link DropinElementProps.onDisableStoredPaymentMethod}
@@ -1,4 +1,4 @@
1
- export declare const countdownTime = 15;
1
+ export declare const countdownTime = 3;
2
2
  export declare const delay = 2000;
3
3
  declare const _default: {
4
4
  delay: number;
@@ -1,3 +1,6 @@
1
+ interface CheckoutErrorOptions {
2
+ cause: any;
3
+ }
1
4
  declare class AdyenCheckoutError extends Error {
2
5
  protected static errorTypes: {
3
6
  /** Network error. */
@@ -9,6 +12,7 @@ declare class AdyenCheckoutError extends Error {
9
12
  /** Generic error. */
10
13
  ERROR: string;
11
14
  };
12
- constructor(type: keyof typeof AdyenCheckoutError.errorTypes, message?: string);
15
+ cause: unknown;
16
+ constructor(type: keyof typeof AdyenCheckoutError.errorTypes, message?: string, options?: CheckoutErrorOptions);
13
17
  }
14
18
  export default AdyenCheckoutError;
package/package.json CHANGED
@@ -23,7 +23,7 @@
23
23
  "./dist/adyen.css": "./dist/adyen.css",
24
24
  "./package.json": "./package.json"
25
25
  },
26
- "version": "5.31.1",
26
+ "version": "5.31.3",
27
27
  "license": "MIT",
28
28
  "homepage": "https://docs.adyen.com/checkout",
29
29
  "repository": "github:Adyen/adyen-web",
@@ -45,7 +45,8 @@
45
45
  "type-check-generate": "tsc --emitDeclarationOnly",
46
46
  "lint": "eslint 'src/**/*.{js,ts,tsx}' --quiet",
47
47
  "lint:fix": "npm run lint -- --fix",
48
- "prepublishOnly": "npm run build"
48
+ "prepublishOnly": "npm run build",
49
+ "prepare": "cd ../.. && husky install packages/lib/.husky"
49
50
  },
50
51
  "devDependencies": {
51
52
  "@babel/cli": "^7.18.10",
@@ -75,7 +76,6 @@
75
76
  "dotenv": "^16.0.3",
76
77
  "enzyme": "^3.11.0",
77
78
  "enzyme-adapter-preact-pure": "^4.0.1",
78
- "esbuild": "^0.16.0",
79
79
  "eslint": "8.30.0",
80
80
  "eslint-plugin-import": "^2.26.0",
81
81
  "eslint-plugin-jsx-a11y": "^6.6.1",
@@ -84,14 +84,14 @@
84
84
  "eslint-plugin-tsdoc": "^0.2.17",
85
85
  "filesize": "^10.0.0",
86
86
  "gzip-size": "^6.0.0",
87
+ "husky": "^8.0.1",
87
88
  "jest": "^26.6.3",
88
89
  "jest-mock-extended": "^3.0.1",
90
+ "lint-staged": "^13.0.3",
89
91
  "node-sass": "^6.0.1",
90
92
  "postcss": "^8.4.7",
91
93
  "postcss-reporter": "^7.0.5",
92
- "prettier": "^1.19.1",
93
94
  "rollup": "^2.79.1",
94
- "rollup-plugin-esbuild": "^4.5.0",
95
95
  "rollup-plugin-postcss": "^4.0.2",
96
96
  "rollup-plugin-terser": "^7.0.2",
97
97
  "rollup-plugin-visualizer": "^5.8.3",
@@ -115,5 +115,10 @@
115
115
  "dist",
116
116
  "LICENSE",
117
117
  "README"
118
- ]
118
+ ],
119
+ "lint-staged": {
120
+ "*.{js,jsx,ts,tsx}": "eslint",
121
+ "*.{scss,css}": "stylelint",
122
+ "*.{js,jsx,ts,tsx,scss,css,html}": "prettier --write"
123
+ }
119
124
  }