@adyen/adyen-web 5.40.0 → 5.41.0

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.
Files changed (34) hide show
  1. package/dist/adyen.js +1 -1
  2. package/dist/adyen.js.map +1 -1
  3. package/dist/cjs/index.js +1 -1
  4. package/dist/es/index.js +1 -1
  5. package/dist/es.modern/index.js +1 -1
  6. package/dist/types/components/Ach/Ach.d.ts +4 -3
  7. package/dist/types/components/AmazonPay/types.d.ts +2 -1
  8. package/dist/types/components/BaseElement.d.ts +2 -0
  9. package/dist/types/components/BcmcMobile/BcmcMobile.d.ts +4 -3
  10. package/dist/types/components/Card/Bancontact.d.ts +4 -3
  11. package/dist/types/components/Card/Card.d.ts +8 -4
  12. package/dist/types/components/Card/components/CardInput/types.d.ts +3 -0
  13. package/dist/types/components/Dragonpay/Dragonpay.d.ts +4 -3
  14. package/dist/types/components/Dropin/Dropin.d.ts +7 -7
  15. package/dist/types/components/DuitNow/DuitNow.d.ts +4 -3
  16. package/dist/types/components/PayNow/PayNow.d.ts +4 -3
  17. package/dist/types/components/PromptPay/PromptPay.d.ts +4 -3
  18. package/dist/types/components/Swish/Swish.d.ts +4 -3
  19. package/dist/types/components/WeChat/WeChat.d.ts +4 -3
  20. package/dist/types/components/internal/DisclaimerMessage/DisclaimerMessage.d.ts +1 -12
  21. package/dist/types/components/internal/SecuredFields/SFP/types.d.ts +2 -0
  22. package/dist/types/components/internal/SecuredFields/lib/types.d.ts +4 -3
  23. package/dist/types/components/internal/SecuredFields/utils.d.ts +2 -1
  24. package/dist/types/components/types.d.ts +5 -3
  25. package/dist/types/core/Context/CoreContext.d.ts +2 -0
  26. package/dist/types/core/Context/CoreProvider.d.ts +2 -0
  27. package/dist/types/core/Context/Resources.d.ts +6 -0
  28. package/dist/types/core/Context/useCoreContext.d.ts +1 -0
  29. package/dist/types/core/Context/useImage.d.ts +3 -0
  30. package/dist/types/core/Environment/Environment.d.ts +3 -2
  31. package/dist/types/core/Environment/index.d.ts +1 -1
  32. package/dist/types/core/types.d.ts +1 -0
  33. package/dist/types/utils/constants/currency-minor-units.d.ts +38 -0
  34. package/package.json +1 -1
@@ -37,9 +37,10 @@ export declare class AchElement extends UIElement<AchElementProps> {
37
37
  _parentInstance?: import("../../core/core").default;
38
38
  order?: import("../../types").Order;
39
39
  modules?: {
40
- srPanel: import("../../core/Errors/SRPanel").SRPanel;
41
- analytics: import("../../core/Analytics/Analytics").default;
42
- risk: import("../../core/RiskModule").default;
40
+ srPanel?: import("../../core/Errors/SRPanel").SRPanel;
41
+ analytics?: import("../../core/Analytics/Analytics").default;
42
+ resources?: import("../../core/Context/Resources").Resources;
43
+ risk?: import("../../core/RiskModule").default;
43
44
  };
44
45
  isDropin?: boolean;
45
46
  };
@@ -2,6 +2,7 @@ import Language from '../../language/Language';
2
2
  import { SUPPORTED_LOCALES_EU, SUPPORTED_LOCALES_US } from './config';
3
3
  import { BrowserInfo, PaymentAmount } from '../../types';
4
4
  import UIElement from '../UIElement';
5
+ import { UIElementProps } from '../types';
5
6
  declare global {
6
7
  interface Window {
7
8
  amazon: object;
@@ -31,7 +32,7 @@ export interface AmazonPayConfiguration {
31
32
  region?: Region;
32
33
  storeId?: string;
33
34
  }
34
- export interface AmazonPayElementProps {
35
+ export interface AmazonPayElementProps extends UIElementProps {
35
36
  addressDetails?: AddressDetails;
36
37
  amazonPayToken?: string;
37
38
  amazonCheckoutSessionId?: string;
@@ -3,6 +3,7 @@ import EventEmitter from './EventEmitter';
3
3
  import Core from '../core';
4
4
  import { BaseElementProps, PaymentData } from './types';
5
5
  import { RiskData } from '../core/RiskModule/RiskModule';
6
+ import { Resources } from '../core/Context/Resources';
6
7
  declare class BaseElement<P extends BaseElementProps> {
7
8
  readonly _id: string;
8
9
  props: P;
@@ -12,6 +13,7 @@ declare class BaseElement<P extends BaseElementProps> {
12
13
  _component: any;
13
14
  eventEmitter: EventEmitter;
14
15
  protected readonly _parentInstance: Core;
16
+ protected resources: Resources;
15
17
  protected constructor(props: P);
16
18
  /**
17
19
  * Executed during creation of any payment element.
@@ -39,9 +39,10 @@ declare class BCMCMobileElement extends QRLoaderContainer {
39
39
  _parentInstance?: import("../../core/core").default;
40
40
  order?: import("../../types").Order;
41
41
  modules?: {
42
- srPanel: import("../../core/Errors/SRPanel").SRPanel;
43
- analytics: import("../../core/Analytics/Analytics").default;
44
- risk: import("../../core/RiskModule").default;
42
+ srPanel?: import("../../core/Errors/SRPanel").SRPanel;
43
+ analytics?: import("../../core/Analytics/Analytics").default;
44
+ resources?: import("../../core/Context/Resources").Resources;
45
+ risk?: import("../../core/RiskModule").default;
45
46
  };
46
47
  isDropin?: boolean;
47
48
  };
@@ -91,9 +91,10 @@ declare class BancontactElement extends CardElement {
91
91
  _parentInstance?: import("../../core/core").default;
92
92
  order?: import("../../types").Order;
93
93
  modules?: {
94
- srPanel: import("../../core/Errors/SRPanel").SRPanel;
95
- analytics: import("../../core/Analytics/Analytics").default;
96
- risk: import("../../core/RiskModule").default;
94
+ srPanel?: import("../../core/Errors/SRPanel").SRPanel;
95
+ analytics?: import("../../core/Analytics/Analytics").default;
96
+ resources?: import("../../core/Context/Resources").Resources;
97
+ risk?: import("../../core/RiskModule").default;
97
98
  };
98
99
  isDropin?: boolean;
99
100
  };
@@ -88,7 +88,10 @@ export declare class CardElement extends UIElement<CardElementProps> {
88
88
  amount?: import("../../types").PaymentAmount;
89
89
  secondaryAmount?: import("../../types").PaymentAmountExtended;
90
90
  showPayButton?: boolean;
91
- setStatusAutomatically?: boolean;
91
+ setStatusAutomatically?: boolean; /**
92
+ * Click to Pay configuration
93
+ * - If email is set explicitly in the configuration, then it can override the one used in the session creation
94
+ */
92
95
  payButton?: (options: import("../types").PayButtonFunctionProps) => h.JSX.Element;
93
96
  loadingContext?: string;
94
97
  createFromAction?: (action: import("../../types").PaymentAction, props: object) => UIElement<any>;
@@ -98,9 +101,10 @@ export declare class CardElement extends UIElement<CardElementProps> {
98
101
  _parentInstance?: import("../../core/core").default;
99
102
  order?: import("../../types").Order;
100
103
  modules?: {
101
- srPanel: import("../../core/Errors/SRPanel").SRPanel;
102
- analytics: import("../../core/Analytics/Analytics").default;
103
- risk: import("../../core/RiskModule").default;
104
+ srPanel?: import("../../core/Errors/SRPanel").SRPanel;
105
+ analytics?: import("../../core/Analytics/Analytics").default;
106
+ resources?: import("../../core/Context/Resources").Resources;
107
+ risk?: import("../../core/RiskModule").default;
104
108
  };
105
109
  isDropin?: boolean;
106
110
  };
@@ -7,6 +7,7 @@ import { CVCPolicyType, DatePolicyType } from '../../../internal/SecuredFields/l
7
7
  import Specifications from '../../../internal/Address/Specifications';
8
8
  import { AddressSchema } from '../../../internal/Address/types';
9
9
  import { CbObjOnError, StylesObject } from '../../../internal/SecuredFields/lib/types';
10
+ import { Resources } from '../../../../core/Context/Resources';
10
11
  import { SRPanel } from '../../../../core/Errors/SRPanel';
11
12
  import Analytics from '../../../../core/Analytics';
12
13
  import RiskElement from '../../../../core/RiskModule';
@@ -85,6 +86,7 @@ export interface CardInputProps {
85
86
  srPanel: SRPanel;
86
87
  analytics: Analytics;
87
88
  risk: RiskElement;
89
+ resources: Resources;
88
90
  };
89
91
  onAdditionalSFConfig?: () => {};
90
92
  onAdditionalSFRemoved?: () => {};
@@ -102,6 +104,7 @@ export interface CardInputProps {
102
104
  payButton?: (obj: any) => {};
103
105
  placeholders?: Placeholders;
104
106
  positionHolderNameOnTop?: boolean;
107
+ resources: Resources;
105
108
  setComponentRef?: (ref: any) => void;
106
109
  showBrandsUnderCardNumber: boolean;
107
110
  showBrandIcon?: boolean;
@@ -46,9 +46,10 @@ export declare class DragonpayElement extends UIElement<DragonpayElementProps> {
46
46
  _parentInstance?: import("../../core/core").default;
47
47
  order?: import("../../types").Order;
48
48
  modules?: {
49
- srPanel: import("../../core/Errors/SRPanel").SRPanel;
50
- analytics: import("../../core/Analytics/Analytics").default;
51
- risk: import("../../core/RiskModule").default;
49
+ srPanel?: import("../../core/Errors/SRPanel").SRPanel;
50
+ analytics?: import("../../core/Analytics/Analytics").default;
51
+ resources?: import("../../core/Context/Resources").Resources;
52
+ risk?: import("../../core/RiskModule").default;
52
53
  };
53
54
  isDropin?: boolean;
54
55
  };
@@ -52,12 +52,11 @@ declare class DropinElement extends UIElement<DropinElementProps> {
52
52
  onValid?: (state: any, element: UIElement<any>) => void;
53
53
  beforeSubmit?: (state: any, element: UIElement<any>, actions: any) => Promise<void>;
54
54
  onComplete?: (state: any, element: UIElement<any>) => void;
55
- /**
56
- * Calls the onSubmit event with the state of the activePaymentMethod
57
- */
58
55
  onActionHandled?: (rtnObj: import("../types").ActionHandledReturnObject) => void;
59
56
  onAdditionalDetails?: (state: any, element: UIElement<any>) => void;
60
- onError?: (error: any, element?: UIElement<any>) => void;
57
+ onError?: (error: any, element?: UIElement<any>) => void; /**
58
+ * Creates the Drop-in elements
59
+ */
61
60
  onPaymentCompleted?: (result: any, element: UIElement<any>) => void;
62
61
  beforeRedirect?: (resolve: any, reject: any, redirectData: any, element: UIElement<any>) => void;
63
62
  isInstantPayment?: boolean;
@@ -76,9 +75,10 @@ declare class DropinElement extends UIElement<DropinElementProps> {
76
75
  i18n?: import("../../language").default;
77
76
  _parentInstance?: import("../../core/core").default;
78
77
  modules?: {
79
- srPanel: import("../../core/Errors/SRPanel").SRPanel;
80
- analytics: import("../../core/Analytics/Analytics").default;
81
- risk: import("../../core/RiskModule").default;
78
+ srPanel?: import("../../core/Errors/SRPanel").SRPanel;
79
+ analytics?: import("../../core/Analytics/Analytics").default;
80
+ resources?: import("../../core/Context/Resources").Resources;
81
+ risk?: import("../../core/RiskModule").default;
82
82
  };
83
83
  isDropin?: boolean;
84
84
  };
@@ -39,9 +39,10 @@ declare class DuitNowElement extends QRLoaderContainer {
39
39
  _parentInstance?: import("../../core/core").default;
40
40
  order?: import("../../types").Order;
41
41
  modules?: {
42
- srPanel: import("../../core/Errors/SRPanel").SRPanel;
43
- analytics: import("../../core/Analytics/Analytics").default;
44
- risk: import("../../core/RiskModule").default;
42
+ srPanel?: import("../../core/Errors/SRPanel").SRPanel;
43
+ analytics?: import("../../core/Analytics/Analytics").default;
44
+ resources?: import("../../core/Context/Resources").Resources;
45
+ risk?: import("../../core/RiskModule").default;
45
46
  };
46
47
  isDropin?: boolean;
47
48
  };
@@ -39,9 +39,10 @@ declare class PayNowElement extends QRLoaderContainer {
39
39
  _parentInstance?: import("../../core/core").default;
40
40
  order?: import("../../types").Order;
41
41
  modules?: {
42
- srPanel: import("../../core/Errors/SRPanel").SRPanel;
43
- analytics: import("../../core/Analytics/Analytics").default;
44
- risk: import("../../core/RiskModule").default;
42
+ srPanel?: import("../../core/Errors/SRPanel").SRPanel;
43
+ analytics?: import("../../core/Analytics/Analytics").default;
44
+ resources?: import("../../core/Context/Resources").Resources;
45
+ risk?: import("../../core/RiskModule").default;
45
46
  };
46
47
  isDropin?: boolean;
47
48
  };
@@ -39,9 +39,10 @@ declare class PromptPayElement extends QRLoaderContainer {
39
39
  _parentInstance?: import("../../core/core").default;
40
40
  order?: import("../../types").Order;
41
41
  modules?: {
42
- srPanel: import("../../core/Errors/SRPanel").SRPanel;
43
- analytics: import("../../core/Analytics/Analytics").default;
44
- risk: import("../../core/RiskModule").default;
42
+ srPanel?: import("../../core/Errors/SRPanel").SRPanel;
43
+ analytics?: import("../../core/Analytics/Analytics").default;
44
+ resources?: import("../../core/Context/Resources").Resources;
45
+ risk?: import("../../core/RiskModule").default;
45
46
  };
46
47
  isDropin?: boolean;
47
48
  };
@@ -39,9 +39,10 @@ declare class SwishElement extends QRLoaderContainer {
39
39
  _parentInstance?: import("../../core/core").default;
40
40
  order?: import("../../types").Order;
41
41
  modules?: {
42
- srPanel: import("../../core/Errors/SRPanel").SRPanel;
43
- analytics: import("../../core/Analytics/Analytics").default;
44
- risk: import("../../core/RiskModule").default;
42
+ srPanel?: import("../../core/Errors/SRPanel").SRPanel;
43
+ analytics?: import("../../core/Analytics/Analytics").default;
44
+ resources?: import("../../core/Context/Resources").Resources;
45
+ risk?: import("../../core/RiskModule").default;
45
46
  };
46
47
  isDropin?: boolean;
47
48
  };
@@ -39,9 +39,10 @@ declare class WeChatPayElement extends QRLoaderContainer {
39
39
  _parentInstance?: import("../../core/core").default;
40
40
  order?: import("../../types").Order;
41
41
  modules?: {
42
- srPanel: import("../../core/Errors/SRPanel").SRPanel;
43
- analytics: import("../../core/Analytics/Analytics").default;
44
- risk: import("../../core/RiskModule").default;
42
+ srPanel?: import("../../core/Errors/SRPanel").SRPanel;
43
+ analytics?: import("../../core/Analytics/Analytics").default;
44
+ resources?: import("../../core/Context/Resources").Resources;
45
+ risk?: import("../../core/RiskModule").default;
45
46
  };
46
47
  isDropin?: boolean;
47
48
  };
@@ -5,27 +5,16 @@ export interface DisclaimerMsgObject {
5
5
  linkText: string;
6
6
  link: string;
7
7
  }
8
- interface DisclaimerMessageProps {
9
- disclaimer: DisclaimerMsgObject;
10
- }
11
8
  interface InternalDisclaimerMsgObject {
12
9
  message: string;
13
10
  urls: Array<string>;
14
11
  }
15
12
  /**
16
- * 1. Expects a config object with this shape:
17
- * disclaimerMessage: {
18
- * message: 'By continuing you accept the %{linkText} of MyStore',
19
- * linkText: 'terms and conditions',
20
- * link: 'https://www.adyen.com'
21
- * }
22
- *
23
- * 2. Internal structure which contains a message and a list of urls.
24
13
  * props: {
25
14
  * message: 'By continuing you agree with the %#terms and conditions%#',
26
15
  * urls: ['https://www.adyen.com']
27
16
  * }
28
17
  * String inside the '%#' token pair will be rendered as an anchor element.
29
18
  */
30
- export default function DisclaimerMessage(props: DisclaimerMessageProps | InternalDisclaimerMsgObject): h.JSX.Element;
19
+ export default function DisclaimerMessage({ message, urls }: InternalDisclaimerMsgObject): h.JSX.Element;
31
20
  export {};
@@ -2,6 +2,7 @@ import { CVCPolicyType, DatePolicyType, StylesObject } from '../lib/types';
2
2
  import { AddressData } from '../../../../types';
3
3
  import { CardBrandsConfiguration } from '../../../Card/types';
4
4
  import { Language } from '../../../../language/Language';
5
+ import { Resources } from '../../../../core/Context/Resources';
5
6
  import { TouchStartEventObj } from '../../../Card/components/CardInput/components/types';
6
7
  /**
7
8
  * Should be the only props that can be sent to SFP (from CardInput, SecuredFieldsInput, AchInput, GiftcardComponent)
@@ -40,6 +41,7 @@ export interface SFPProps {
40
41
  trimTrailingSeparator?: boolean;
41
42
  type: string;
42
43
  render: () => {};
44
+ resources: Resources;
43
45
  maskSecurityCode: boolean;
44
46
  disableIOSArrowKeys: (obj: TouchStartEventObj) => void | null;
45
47
  }
@@ -52,12 +52,13 @@ interface StyleDefinitions {
52
52
  }
53
53
  export interface CardObject {
54
54
  cardType: string;
55
- startingRules: number[];
56
- permittedLengths: number[];
57
- pattern: RegExp;
55
+ startingRules?: number[];
56
+ permittedLengths?: number[];
57
+ pattern?: RegExp;
58
58
  securityCode?: string;
59
59
  displayName?: string;
60
60
  cvcPolicy?: CVCPolicyType;
61
+ expiryDatePolicy?: DatePolicyType;
61
62
  }
62
63
  export interface CbObjOnBrand {
63
64
  type: string;
@@ -1,5 +1,6 @@
1
1
  import Language from '../../../language/Language';
2
2
  import { SFPlaceholdersObject } from './lib/securedField/AbstractSecuredField';
3
+ import { Resources } from '../../../core/Context/Resources';
3
4
  /**
4
5
  * Lookup translated values for the placeholders for the SecuredFields
5
6
  * and return an object with these mapped to the data-cse value of the SecuredField
@@ -8,7 +9,7 @@ export declare const resolvePlaceholders: (i18n?: Language) => SFPlaceholdersObj
8
9
  /**
9
10
  * Used by SecuredFieldsProviderHandlers
10
11
  */
11
- export declare const getCardImageUrl: (brand: any, loadingContext: any) => any;
12
+ export declare const getCardImageUrl: (brand: any, resources: Resources) => any;
12
13
  /**
13
14
  * 'Destructures' properties from object - returns a new object only containing those properties that were asked for (including if those properties
14
15
  * have values that are falsy: null, undefined, false, '').
@@ -6,6 +6,7 @@ import RiskElement from '../core/RiskModule';
6
6
  import { PayButtonProps } from './internal/PayButton/PayButton';
7
7
  import Session from '../core/CheckoutSession';
8
8
  import { SRPanel } from '../core/Errors/SRPanel';
9
+ import { Resources } from '../core/Context/Resources';
9
10
  export interface PaymentMethodData {
10
11
  paymentMethod: {
11
12
  [key: string]: any;
@@ -51,9 +52,10 @@ export interface BaseElementProps {
51
52
  _parentInstance?: Core;
52
53
  order?: Order;
53
54
  modules?: {
54
- srPanel: SRPanel;
55
- analytics: Analytics;
56
- risk: RiskElement;
55
+ srPanel?: SRPanel;
56
+ analytics?: Analytics;
57
+ resources?: Resources;
58
+ risk?: RiskElement;
57
59
  };
58
60
  isDropin?: boolean;
59
61
  }
@@ -1,7 +1,9 @@
1
1
  import { CommonPropsTypes } from './CoreProvider';
2
2
  import Language from '../../language/Language';
3
+ import { Resources } from './Resources';
3
4
  export declare const CoreContext: import("preact").Context<{
4
5
  i18n: Language;
5
6
  loadingContext: string;
6
7
  commonProps: CommonPropsTypes;
8
+ resources: Resources;
7
9
  }>;
@@ -1,7 +1,9 @@
1
1
  import { Component, h } from 'preact';
2
+ import { Resources } from './Resources';
2
3
  interface CoreProviderProps {
3
4
  loadingContext: string;
4
5
  i18n: any;
6
+ resources: Resources;
5
7
  children?: any;
6
8
  commonProps?: CommonPropsTypes;
7
9
  }
@@ -0,0 +1,6 @@
1
+ import { ImageOptions } from '../../utils/get-image';
2
+ export declare class Resources {
3
+ private readonly resourceContext;
4
+ constructor(cdnContext?: string);
5
+ getImage(props: ImageOptions): Function;
6
+ }
@@ -2,5 +2,6 @@ declare function useCoreContext(): {
2
2
  i18n: import("../../language").default;
3
3
  loadingContext: string;
4
4
  commonProps: import("./CoreProvider").CommonPropsTypes;
5
+ resources: import("./Resources").Resources;
5
6
  };
6
7
  export default useCoreContext;
@@ -0,0 +1,3 @@
1
+ import { ImageOptions } from '../../utils/get-image';
2
+ declare function useImage(): (props: ImageOptions) => Function;
3
+ export default useImage;
@@ -1,3 +1,4 @@
1
1
  export declare const FALLBACK_CONTEXT = "https://checkoutshopper-live.adyen.com/checkoutshopper/";
2
- declare const resolveEnvironment: (env?: string) => string;
3
- export default resolveEnvironment;
2
+ export declare const resolveEnvironment: (env?: string) => string;
3
+ export declare const FALLBACK_CDN_CONTEXT = "https://checkoutshopper-live.adyen.com/checkoutshopper/";
4
+ export declare const resolveCDNEnvironment: (env?: string) => any;
@@ -1 +1 @@
1
- export { default } from './Environment';
1
+ export { resolveCDNEnvironment, resolveEnvironment } from './Environment';
@@ -53,6 +53,7 @@ export interface CoreOptions {
53
53
  * Never display these payment methods
54
54
  */
55
55
  removePaymentMethods?: string[];
56
+ resourceEnvironment?: string;
56
57
  analytics?: AnalyticsOptions;
57
58
  risk?: RiskModuleOptions;
58
59
  order?: Order;
@@ -0,0 +1,38 @@
1
+ /** Work around solution until chromium bug is fixed https://bugs.chromium.org/p/chromium/issues/detail?id=1381996
2
+ * We need to hardcode minimumFractionDigits for the following currencies
3
+ */
4
+ export declare const currencyMinorUnitsConfig: {
5
+ RSD: {
6
+ minimumFractionDigits: number;
7
+ };
8
+ AFN: {
9
+ minimumFractionDigits: number;
10
+ };
11
+ ALL: {
12
+ minimumFractionDigits: number;
13
+ };
14
+ IRR: {
15
+ minimumFractionDigits: number;
16
+ };
17
+ LAK: {
18
+ minimumFractionDigits: number;
19
+ };
20
+ LBP: {
21
+ minimumFractionDigits: number;
22
+ };
23
+ MMK: {
24
+ minimumFractionDigits: number;
25
+ };
26
+ SOS: {
27
+ minimumFractionDigits: number;
28
+ };
29
+ SYP: {
30
+ minimumFractionDigits: number;
31
+ };
32
+ YER: {
33
+ minimumFractionDigits: number;
34
+ };
35
+ IQD: {
36
+ minimumFractionDigits: number;
37
+ };
38
+ };
package/package.json CHANGED
@@ -24,7 +24,7 @@
24
24
  "./dist/es/adyen.css": "./dist/es/adyen.css",
25
25
  "./package.json": "./package.json"
26
26
  },
27
- "version": "5.40.0",
27
+ "version": "5.41.0",
28
28
  "license": "MIT",
29
29
  "homepage": "https://docs.adyen.com/checkout",
30
30
  "repository": "github:Adyen/adyen-web",