@adyen/adyen-web 5.32.0 → 5.34.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 (112) hide show
  1. package/README.md +5 -1
  2. package/dist/adyen.css +5 -5
  3. package/dist/adyen.css.map +1 -1
  4. package/dist/adyen.js +1 -1
  5. package/dist/adyen.js.map +1 -1
  6. package/dist/cjs/adyen.css +5 -5
  7. package/dist/cjs/adyen.css.map +1 -1
  8. package/dist/cjs/index.js +1 -1
  9. package/dist/es/adyen.css +5 -5
  10. package/dist/es/adyen.css.map +1 -1
  11. package/dist/es/index.js +1 -1
  12. package/dist/es.modern/adyen.css +5 -5
  13. package/dist/es.modern/adyen.css.map +1 -1
  14. package/dist/es.modern/index.js +1 -1
  15. package/dist/types/components/Ach/Ach.d.ts +1 -0
  16. package/dist/types/components/Ach/components/AchInput/types.d.ts +2 -1
  17. package/dist/types/components/AmazonPay/types.d.ts +9 -9
  18. package/dist/types/components/ApplePay/types.d.ts +2 -2
  19. package/dist/types/components/Atome/config.d.ts +1 -1
  20. package/dist/types/components/BcmcMobile/BcmcMobile.d.ts +1 -1
  21. package/dist/types/components/Card/Bancontact.d.ts +6 -4
  22. package/dist/types/components/Card/Card.d.ts +6 -8
  23. package/dist/types/components/Card/ClickToPayHolder.d.ts +1 -1
  24. package/dist/types/components/Card/ClickToPayWrapper.d.ts +1 -1
  25. package/dist/types/components/Card/components/CardInput/components/AvailableBrands/AvailableBrands.d.ts +1 -1
  26. package/dist/types/components/Card/components/CardInput/components/CardFieldsWrapper.d.ts +2 -2
  27. package/dist/types/components/Card/components/CardInput/components/types.d.ts +2 -2
  28. package/dist/types/components/Card/components/CardInput/types.d.ts +3 -4
  29. package/dist/types/components/Card/components/ClickToPay/ClickToPayComponent.d.ts +1 -1
  30. package/dist/types/components/Card/components/ClickToPay/components/CtPBrand/CtPBrand.d.ts +1 -1
  31. package/dist/types/components/Card/components/ClickToPay/components/CtPCards/CtPCards.d.ts +1 -1
  32. package/dist/types/components/Card/components/ClickToPay/components/CtPCards/CtPCardsList/CtPCardsList.d.ts +1 -1
  33. package/dist/types/components/Card/components/ClickToPay/components/CtPCards/CtPSingleCard/CtPSingleCard.d.ts +1 -1
  34. package/dist/types/components/Card/components/ClickToPay/components/CtPInfo/CtPInfoModal/CtPInfoModal.d.ts +1 -1
  35. package/dist/types/components/Card/components/ClickToPay/components/CtPLogin/CtPLoginInput.d.ts +11 -7
  36. package/dist/types/components/Card/components/ClickToPay/components/CtPOneTimePassword/CtPOneTimePassword.d.ts +1 -1
  37. package/dist/types/components/Card/components/ClickToPay/components/CtPOneTimePassword/CtPOneTimePasswordInput/CtPOneTimePasswordInput.d.ts +11 -7
  38. package/dist/types/components/Card/components/ClickToPay/context/ClickToPayContext.d.ts +2 -0
  39. package/dist/types/components/Card/components/ClickToPay/context/ClickToPayProvider.d.ts +4 -2
  40. package/dist/types/components/Card/components/ClickToPay/services/ClickToPayService.d.ts +1 -1
  41. package/dist/types/components/Card/components/ClickToPay/{utils.d.ts → services/create-clicktopay-service.d.ts} +2 -2
  42. package/dist/types/components/Card/components/ClickToPay/services/sdks/AbstractSrcInitiator.d.ts +3 -4
  43. package/dist/types/components/Card/components/ClickToPay/services/sdks/MastercardSdk.d.ts +2 -3
  44. package/dist/types/components/Card/components/ClickToPay/services/sdks/SrciError.d.ts +2 -2
  45. package/dist/types/components/Card/components/ClickToPay/services/sdks/VisaSdk.d.ts +2 -3
  46. package/dist/types/components/Card/components/ClickToPay/services/sdks/types.d.ts +18 -12
  47. package/dist/types/components/Card/components/ClickToPay/services/types.d.ts +10 -10
  48. package/dist/types/components/Card/components/ClickToPay/services/utils.d.ts +1 -1
  49. package/dist/types/components/Card/types.d.ts +17 -11
  50. package/dist/types/components/Dragonpay/Dragonpay.d.ts +1 -0
  51. package/dist/types/components/Dropin/Dropin.d.ts +1 -0
  52. package/dist/types/components/Dropin/types.d.ts +1 -1
  53. package/dist/types/components/DuitNow/DuitNow.d.ts +1 -1
  54. package/dist/types/components/Econtext/components/EcontextInput/EcontextInput.d.ts +1 -1
  55. package/dist/types/components/Giftcard/components/types.d.ts +2 -2
  56. package/dist/types/components/Klarna/types.d.ts +2 -2
  57. package/dist/types/components/Oxxo/types.d.ts +1 -1
  58. package/dist/types/components/PayNow/PayNow.d.ts +1 -1
  59. package/dist/types/components/PayPal/Paypal.d.ts +1 -1
  60. package/dist/types/components/PayPal/config.d.ts +1 -1
  61. package/dist/types/components/PayPal/types.d.ts +7 -4
  62. package/dist/types/components/Pix/Pix.d.ts +1 -0
  63. package/dist/types/components/Pix/PixInput/types.d.ts +1 -1
  64. package/dist/types/components/PromptPay/PromptPay.d.ts +1 -1
  65. package/dist/types/components/Swish/Swish.d.ts +1 -1
  66. package/dist/types/components/ThreeDS2/ThreeDS2Challenge.d.ts +2 -0
  67. package/dist/types/components/ThreeDS2/ThreeDS2DeviceFingerprint.d.ts +2 -0
  68. package/dist/types/components/ThreeDS2/components/Challenge/PrepareChallenge3DS2.d.ts +4 -1
  69. package/dist/types/components/ThreeDS2/components/Challenge/types.d.ts +2 -0
  70. package/dist/types/components/ThreeDS2/components/DeviceFingerprint/DoFingerprint3DS2.d.ts +2 -1
  71. package/dist/types/components/ThreeDS2/components/DeviceFingerprint/PrepareFingerprint3DS2.d.ts +5 -1
  72. package/dist/types/components/ThreeDS2/components/DeviceFingerprint/types.d.ts +2 -0
  73. package/dist/types/components/ThreeDS2/types.d.ts +4 -4
  74. package/dist/types/components/UIElement.d.ts +1 -0
  75. package/dist/types/components/UPI/components/UPIComponent/UPIComponent.d.ts +8 -6
  76. package/dist/types/components/UPI/components/VpaInput/VpaInput.d.ts +11 -7
  77. package/dist/types/components/UPI/types.d.ts +1 -1
  78. package/dist/types/components/WeChat/WeChat.d.ts +1 -1
  79. package/dist/types/components/helpers/QRLoaderContainer.d.ts +1 -1
  80. package/dist/types/components/internal/Address/types.d.ts +6 -3
  81. package/dist/types/components/internal/Await/Await.d.ts +1 -1
  82. package/dist/types/components/internal/Await/types.d.ts +2 -1
  83. package/dist/types/components/internal/Button/types.d.ts +1 -1
  84. package/dist/types/components/internal/CompanyDetails/types.d.ts +1 -0
  85. package/dist/types/components/internal/IbanInput/utils.d.ts +1 -1
  86. package/dist/types/components/internal/Modal/Modal.d.ts +2 -2
  87. package/dist/types/components/internal/Modal/useModal.d.ts +2 -2
  88. package/dist/types/components/internal/Modal/useTrapFocus.d.ts +1 -1
  89. package/dist/types/components/internal/OpenInvoice/types.d.ts +3 -2
  90. package/dist/types/components/internal/PersonalDetails/types.d.ts +4 -1
  91. package/dist/types/components/internal/QRLoader/QRLoader.d.ts +2 -2
  92. package/dist/types/components/internal/QRLoader/types.d.ts +3 -2
  93. package/dist/types/components/internal/SecuredFields/lib/CSF/utils/processErrors.d.ts +1 -1
  94. package/dist/types/components/internal/SecuredFields/lib/securedField/AbstractSecuredField.d.ts +1 -1
  95. package/dist/types/components/internal/SecuredFields/lib/types.d.ts +5 -5
  96. package/dist/types/components/types.d.ts +12 -2
  97. package/dist/types/core/Analytics/Analytics.d.ts +2 -1
  98. package/dist/types/core/Analytics/EventsQueue.d.ts +1 -1
  99. package/dist/types/core/RiskModule/RiskModule.d.ts +1 -1
  100. package/dist/types/core/Services/analytics/post-telemetry.d.ts +3 -1
  101. package/dist/types/core/Services/analytics/types.d.ts +2 -2
  102. package/dist/types/core/Services/data-set.d.ts +1 -1
  103. package/dist/types/core/Services/http.d.ts +1 -1
  104. package/dist/types/core/types.d.ts +1 -1
  105. package/dist/types/language/Language.d.ts +3 -3
  106. package/dist/types/language/types.d.ts +2 -2
  107. package/dist/types/language/utils.d.ts +4 -3
  108. package/dist/types/types/index.d.ts +13 -13
  109. package/dist/types/utils/Formatters/types.d.ts +1 -1
  110. package/dist/types/utils/Validator/types.d.ts +9 -9
  111. package/dist/types/utils/useForm/types.d.ts +2 -2
  112. package/package.json +14 -14
@@ -1,3 +1,4 @@
1
+ import { ActionHandledReturnObject } from '../../types';
1
2
  interface StatusObjectProps {
2
3
  payload: string;
3
4
  resultCode: string;
@@ -16,7 +17,6 @@ export interface AwaitComponentProps {
16
17
  throttleInterval: number;
17
18
  paymentData: string;
18
19
  url?: string;
19
- shouldRedirectOnMobile?: boolean;
20
20
  classNameModifiers?: string[];
21
21
  clientKey: string;
22
22
  onError: (error: any) => void;
@@ -25,5 +25,6 @@ export interface AwaitComponentProps {
25
25
  messageText: string;
26
26
  awaitText: string;
27
27
  ref: any;
28
+ onActionHandled: (rtnObj: ActionHandledReturnObject) => void;
28
29
  }
29
30
  export {};
@@ -1,4 +1,4 @@
1
- export declare type ButtonVariant = 'primary' | 'secondary' | 'ghost' | 'action';
1
+ export type ButtonVariant = 'primary' | 'secondary' | 'ghost' | 'action';
2
2
  export interface ButtonProps {
3
3
  status?: string;
4
4
  /**
@@ -14,6 +14,7 @@ export interface CompanyDetailsProps {
14
14
  readonly?: boolean;
15
15
  ref?: any;
16
16
  validationRules?: ValidatorRules;
17
+ setComponentRef?: (ref: any) => void;
17
18
  }
18
19
  export interface ReadOnlyCompanyDetailsProps {
19
20
  name?: string;
@@ -1,4 +1,4 @@
1
- export declare type ElectronicFormat = string;
1
+ export type ElectronicFormat = string;
2
2
  /**
3
3
  * @param countryCode -
4
4
  * @returns Example of IBAN Number
@@ -1,13 +1,13 @@
1
1
  import { ComponentChildren, h } from 'preact';
2
2
  import './Modal.scss';
3
- declare type ModalRenderFnProps = {
3
+ type ModalRenderFnProps = {
4
4
  /**
5
5
  * Function used to properly trigger the Modal close mechanism. It takes into account the element that the Modal needs
6
6
  * to set focus when it is dismissed.
7
7
  */
8
8
  onCloseModal(): void;
9
9
  };
10
- declare type ModalProps = {
10
+ type ModalProps = {
11
11
  children: ({ onCloseModal }: ModalRenderFnProps) => ComponentChildren;
12
12
  classNameModifiers?: string[];
13
13
  onClose(): void;
@@ -1,4 +1,4 @@
1
- declare type UseModalProps = {
1
+ type UseModalProps = {
2
2
  modalElement?: HTMLElement;
3
3
  isOpen: boolean;
4
4
  isDismissible: boolean;
@@ -6,7 +6,7 @@ declare type UseModalProps = {
6
6
  focusAfterClose: HTMLElement;
7
7
  onClose(): void;
8
8
  };
9
- declare type UseModalHook = {
9
+ type UseModalHook = {
10
10
  /**
11
11
  * Function that focus on the 'focusAfterClose' element, and then closes the modal
12
12
  */
@@ -1,4 +1,4 @@
1
- declare type UseTrapFocusProps = {
1
+ type UseTrapFocusProps = {
2
2
  rootElement?: HTMLElement;
3
3
  /**
4
4
  * Element that must be focused when the hook is executed. If no element is passed, the first focusable child
@@ -1,8 +1,8 @@
1
1
  import { AddressData, FieldsetVisibility, PersonalDetailsSchema } from '../../../types';
2
2
  import { CompanyDetailsSchema } from '../CompanyDetails/types';
3
3
  import { AddressSpecifications } from '../Address/types';
4
- import { UIElementProps } from "../../types";
5
- import UIElement from "../../UIElement";
4
+ import { UIElementProps } from '../../types';
5
+ import UIElement from '../../UIElement';
6
6
  export interface OpenInvoiceVisibility {
7
7
  companyDetails?: FieldsetVisibility;
8
8
  personalDetails?: FieldsetVisibility;
@@ -33,6 +33,7 @@ export interface OpenInvoiceProps extends UIElementProps {
33
33
  personalDetailsRequiredFields?: string[];
34
34
  billingAddressRequiredFields?: string[];
35
35
  billingAddressSpecification?: AddressSpecifications;
36
+ setComponentRef?: (ref: any) => void;
36
37
  }
37
38
  export interface OpenInvoiceStateData {
38
39
  companyDetails?: CompanyDetailsSchema;
@@ -1,6 +1,6 @@
1
1
  import { FieldsetVisibility, PersonalDetailsSchema } from '../../../types';
2
2
  import { ValidatorRules } from '../../../utils/Validator/types';
3
- declare type PersonalDetailsPlaceholders = Omit<PersonalDetailsSchema, 'gender'>;
3
+ type PersonalDetailsPlaceholders = Omit<PersonalDetailsSchema, 'gender'>;
4
4
  export interface PersonalDetailsProps {
5
5
  label?: string;
6
6
  namePrefix?: string;
@@ -12,6 +12,9 @@ export interface PersonalDetailsProps {
12
12
  readonly?: boolean;
13
13
  ref?: any;
14
14
  validationRules?: ValidatorRules;
15
+ setComponentRef?: (ref: any) => void;
16
+ payButton?: (obj: any) => {};
17
+ showPayButton?: boolean;
15
18
  }
16
19
  export interface PersonalDetailsStateError {
17
20
  firstName?: boolean;
@@ -16,7 +16,7 @@ declare class QRLoader extends Component<QRLoaderProps, QRLoaderState> {
16
16
  };
17
17
  statusInterval: () => void;
18
18
  componentDidMount(): void;
19
- redirectToApp: (url: any, fallback?: () => void) => void;
19
+ redirectToApp: (url: any) => void;
20
20
  componentDidUpdate(prevProps: any, prevState: any): void;
21
21
  componentWillUnmount(): void;
22
22
  private onTick;
@@ -24,7 +24,7 @@ declare class QRLoader extends Component<QRLoaderProps, QRLoaderState> {
24
24
  private onComplete;
25
25
  private onError;
26
26
  private checkStatus;
27
- render({ amount, url, brandLogo, countdownTime, type }: QRLoaderProps, { expired, completed, loading }: {
27
+ render({ amount, url, brandLogo, countdownTime, type, onActionHandled }: QRLoaderProps, { expired, completed, loading }: {
28
28
  expired: any;
29
29
  completed: any;
30
30
  loading: any;
@@ -1,13 +1,13 @@
1
1
  import { PaymentAmount } from '../../../types';
2
2
  import Language from '../../../language/Language';
3
+ import { ActionHandledReturnObject } from '../../types';
3
4
  export interface QRLoaderProps {
4
5
  delay?: number;
5
6
  countdownTime?: number;
6
7
  onError?: (error: any) => void;
7
- onComplete?: (data: any) => void;
8
+ onComplete?: (data: any, component: any) => void;
8
9
  throttleTime?: number;
9
10
  throttledInterval?: number;
10
- shouldRedirectOnMobile?: boolean;
11
11
  url?: string;
12
12
  type?: string;
13
13
  paymentData?: string;
@@ -22,6 +22,7 @@ export interface QRLoaderProps {
22
22
  introduction?: string;
23
23
  instructions?: string;
24
24
  copyBtn?: boolean;
25
+ onActionHandled?: (rtnObj: ActionHandledReturnObject) => void;
25
26
  }
26
27
  export interface QRLoaderState {
27
28
  buttonStatus: string;
@@ -1,5 +1,5 @@
1
1
  import { CbObjOnError, SFFeedbackObj } from '../../types';
2
2
  import SecuredField from '../../securedField/SecuredField';
3
- declare type RtnType_callbackFn = (obj: CbObjOnError) => void;
3
+ type RtnType_callbackFn = (obj: CbObjOnError) => void;
4
4
  export declare const processErrors: (pFeedbackObj: SFFeedbackObj, securedField: SecuredField, type: string, rootNode: HTMLElement, callbackFn: RtnType_callbackFn) => CbObjOnError;
5
5
  export {};
@@ -62,7 +62,7 @@ export interface SFPlaceholdersObject {
62
62
  [ENCRYPTED_BANK_ACCNT_NUMBER_FIELD]?: string;
63
63
  [ENCRYPTED_BANK_LOCATION_FIELD]?: string;
64
64
  }
65
- export declare type AriaConfig = {
65
+ export type AriaConfig = {
66
66
  lang?: string;
67
67
  } & {
68
68
  [key: string]: AriaConfigObject;
@@ -182,9 +182,9 @@ export interface SendBrandObject {
182
182
  export interface SendExpiryDateObject {
183
183
  expiryDatePolicy: DatePolicyType;
184
184
  }
185
- export declare type RtnType_noParamVoidFn = () => void;
186
- export declare type RtnType_postMessageListener = (event: Event) => void;
187
- export declare type RtnType_callbackFn = (feedbackObj: SFFeedbackObj) => void;
188
- export declare type CVCPolicyType = 'required' | 'optional' | 'hidden';
189
- export declare type DatePolicyType = 'required' | 'optional' | 'hidden';
185
+ export type RtnType_noParamVoidFn = () => void;
186
+ export type RtnType_postMessageListener = (event: Event) => void;
187
+ export type RtnType_callbackFn = (feedbackObj: SFFeedbackObj) => void;
188
+ export type CVCPolicyType = 'required' | 'optional' | 'hidden';
189
+ export type DatePolicyType = 'required' | 'optional' | 'hidden';
190
190
  export {};
@@ -71,8 +71,13 @@ export interface IUIElement {
71
71
  showValidation(): void;
72
72
  setState(newState: object): void;
73
73
  }
74
- export declare type UIElementStatus = 'ready' | 'loading' | 'error' | 'success';
75
- export declare type PayButtonFunctionProps = Omit<PayButtonProps, 'amount'>;
74
+ export type UIElementStatus = 'ready' | 'loading' | 'error' | 'success';
75
+ export type ActionDescriptionType = 'qr-code-loaded' | 'polling-started' | 'fingerprint-iframe-loaded' | 'challenge-iframe-loaded';
76
+ export type PayButtonFunctionProps = Omit<PayButtonProps, 'amount'>;
77
+ export interface ActionHandledReturnObject {
78
+ componentType: string;
79
+ actionDescription: ActionDescriptionType;
80
+ }
76
81
  export interface UIElementProps extends BaseElementProps {
77
82
  session?: Session;
78
83
  onChange?: (state: any, element: UIElement) => void;
@@ -80,6 +85,7 @@ export interface UIElementProps extends BaseElementProps {
80
85
  beforeSubmit?: (state: any, element: UIElement, actions: any) => Promise<void>;
81
86
  onSubmit?: (state: any, element: UIElement) => void;
82
87
  onComplete?: (state: any, element: UIElement) => void;
88
+ onActionHandled?: (rtnObj: ActionHandledReturnObject) => void;
83
89
  onAdditionalDetails?: (state: any, element: UIElement) => void;
84
90
  onError?: (error: any, element?: UIElement) => void;
85
91
  onPaymentCompleted?: (result: any, element: UIElement) => void;
@@ -101,3 +107,7 @@ export interface UIElementProps extends BaseElementProps {
101
107
  */
102
108
  setStatusAutomatically?: boolean;
103
109
  }
110
+ export interface ComponentMethodsRef {
111
+ showValidation?: () => void;
112
+ setStatus?(status: UIElementStatus): void;
113
+ }
@@ -1,4 +1,5 @@
1
1
  import { CoreOptions } from '../types';
2
+ export type AnalyticsProps = Pick<CoreOptions, 'loadingContext' | 'locale' | 'clientKey' | 'analytics' | 'amount'>;
2
3
  declare class Analytics {
3
4
  private static defaultProps;
4
5
  checkoutAttemptId: string;
@@ -7,7 +8,7 @@ declare class Analytics {
7
8
  private readonly logTelemetry;
8
9
  private readonly queue;
9
10
  readonly collectId: any;
10
- constructor({ loadingContext, locale, clientKey, analytics }: CoreOptions);
11
+ constructor({ loadingContext, locale, clientKey, analytics, amount }: AnalyticsProps);
11
12
  send(event: any): void;
12
13
  }
13
14
  export default Analytics;
@@ -1,4 +1,4 @@
1
- declare type EventItem = (checkoutAttemptId: string) => Promise<any>;
1
+ type EventItem = (checkoutAttemptId: string) => Promise<any>;
2
2
  declare class EventsQueue {
3
3
  events: EventItem[];
4
4
  add(event: any): void;
@@ -11,7 +11,7 @@ interface RiskModuleProps extends BaseElementProps {
11
11
  risk: RiskModuleOptions;
12
12
  loadingContext: string;
13
13
  }
14
- export declare type RiskData = string | boolean;
14
+ export type RiskData = string | boolean;
15
15
  export default class RiskElement extends BaseElement<RiskModuleProps> {
16
16
  static type: string;
17
17
  static defaultProps: {
@@ -1,6 +1,8 @@
1
+ import { AnalyticsProps } from '../../Analytics/Analytics';
2
+ type Config = Pick<AnalyticsProps, 'loadingContext' | 'locale' | 'clientKey' | 'amount'>;
1
3
  /**
2
4
  * Log event to Adyen
3
5
  * @param config -
4
6
  */
5
- declare const logTelemetry: (config: any) => (event: any) => Promise<any>;
7
+ declare const logTelemetry: (config: Config) => (event: any) => Promise<any>;
6
8
  export default logTelemetry;
@@ -1,9 +1,9 @@
1
1
  import { Experiment } from '../../Analytics/types';
2
- declare type CheckoutAttemptIdSession = {
2
+ type CheckoutAttemptIdSession = {
3
3
  id: string;
4
4
  timestamp: number;
5
5
  };
6
- declare type CollectIdProps = {
6
+ type CollectIdProps = {
7
7
  clientKey: string;
8
8
  loadingContext: string;
9
9
  experiments: Experiment[];
@@ -1,4 +1,4 @@
1
- export declare type DataSet = DataSetItem[];
1
+ export type DataSet = DataSetItem[];
2
2
  export interface DataSetItem {
3
3
  id: string;
4
4
  name: string;
@@ -8,7 +8,7 @@ interface HttpOptions {
8
8
  path: string;
9
9
  errorLevel?: ErrorLevel;
10
10
  }
11
- declare type ErrorLevel = 'silent' | 'info' | 'warn' | 'error' | 'fatal';
11
+ type ErrorLevel = 'silent' | 'info' | 'warn' | 'error' | 'fatal';
12
12
  export declare function http<T>(options: HttpOptions, data?: any): Promise<T>;
13
13
  export declare function httpGet<T = any>(options: HttpOptions, data?: any): Promise<T>;
14
14
  export declare function httpPost<T = any>(options: HttpOptions, data?: any): Promise<T>;
@@ -58,7 +58,7 @@ export interface CoreOptions {
58
58
  order?: Order;
59
59
  [key: string]: any;
60
60
  }
61
- export declare type PaymentMethodsConfiguration = {
61
+ export type PaymentMethodsConfiguration = {
62
62
  [key in keyof PaymentMethods]?: Partial<PaymentMethodOptions<key>>;
63
63
  } | {
64
64
  [key in PaymentActionsType]?: any;
@@ -1,11 +1,11 @@
1
1
  export declare class Language {
2
- constructor(locale?: string, customTranslations?: object);
2
+ private readonly supportedLocales;
3
3
  readonly locale: string;
4
4
  readonly languageCode: string;
5
- private readonly supportedLocales;
6
- translations: object;
5
+ translations: Record<string, string>;
7
6
  readonly customTranslations: any;
8
7
  loaded: Promise<any>;
8
+ constructor(locale?: string, customTranslations?: object);
9
9
  /**
10
10
  * Returns a translated string from a key in the current {@link Language.locale}
11
11
  * @param key - Translation key
@@ -1,6 +1,6 @@
1
1
  import locales from './locales';
2
- export declare type Locales = keyof typeof locales;
3
- export declare type CustomTranslations = {
2
+ export type Locales = keyof typeof locales;
3
+ export type CustomTranslations = {
4
4
  [key: string]: {
5
5
  [message: string]: string;
6
6
  };
@@ -33,11 +33,12 @@ export declare function parseLocale(locale: string, supportedLocales?: string[])
33
33
  */
34
34
  export declare function formatCustomTranslations(customTranslations: object, supportedLocales: string[]): object;
35
35
  /**
36
- * Returns an array with all the locales
36
+ * Returns an Object which contains all the key/values of the translation labels
37
+ *
37
38
  * @param locale - The locale the user wants to use
38
- * @param customTranslations -
39
+ * @param customTranslations - Custom translations provided by the merchant
39
40
  */
40
- export declare const loadTranslations: (locale: string, customTranslations?: object) => Promise<any>;
41
+ export declare const loadTranslations: (locale: string, customTranslations?: object) => Promise<Record<string, string>>;
41
42
  /**
42
43
  * Injects JSX elements in a middle of a translation and returns a JSX array
43
44
  * The input string should use %# as the token to know where to insert the component
@@ -2,7 +2,7 @@ import paymentMethods from '../components';
2
2
  import { ADDRESS_SCHEMA } from '../components/internal/Address/constants';
3
3
  import actionTypes from '../core/ProcessResponse/PaymentAction/actionTypes';
4
4
  import { InstallmentOptions } from '../components/Card/components/CardInput/components/types';
5
- export declare type PaymentActionsType = keyof typeof actionTypes;
5
+ export type PaymentActionsType = keyof typeof actionTypes;
6
6
  /**
7
7
  * {@link https://docs.adyen.com/api-explorer/#/PaymentSetupAndVerificationService/v51/payments__resParam_action API Explorer /payments action}
8
8
  */
@@ -155,8 +155,8 @@ export interface PaymentAmountExtended extends PaymentAmount {
155
155
  */
156
156
  currencyDisplay?: string;
157
157
  }
158
- export declare type AddressField = typeof ADDRESS_SCHEMA[number];
159
- export declare type AddressData = {
158
+ export type AddressField = typeof ADDRESS_SCHEMA[number];
159
+ export type AddressData = {
160
160
  [key in AddressField]?: string;
161
161
  };
162
162
  export interface PersonalDetailsSchema {
@@ -207,24 +207,24 @@ export interface BrowserInfo {
207
207
  /**
208
208
  * Available components
209
209
  */
210
- export declare type PaymentMethods = typeof paymentMethods;
210
+ export type PaymentMethods = typeof paymentMethods;
211
211
  /**
212
212
  * Options for a component
213
213
  */
214
- export declare type PaymentMethodOptions<P extends keyof PaymentMethods> = InstanceType<PaymentMethods[P]>['props'];
214
+ export type PaymentMethodOptions<P extends keyof PaymentMethods> = InstanceType<PaymentMethods[P]>['props'];
215
215
  /**
216
216
  * Visibility options for a fieldset
217
217
  */
218
- export declare type FieldsetVisibility = 'editable' | 'hidden' | 'readOnly';
219
- export declare type CheckoutSession = {
218
+ export type FieldsetVisibility = 'editable' | 'hidden' | 'readOnly';
219
+ export type CheckoutSession = {
220
220
  id: string;
221
221
  sessionData: string;
222
222
  };
223
- export declare type SessionConfiguration = {
223
+ export type SessionConfiguration = {
224
224
  installmentOptions: InstallmentOptions;
225
225
  enableStoreDetails: boolean;
226
226
  };
227
- export declare type CheckoutSessionSetupResponse = {
227
+ export type CheckoutSessionSetupResponse = {
228
228
  id: string;
229
229
  sessionData: string;
230
230
  amount: PaymentAmount;
@@ -233,24 +233,24 @@ export declare type CheckoutSessionSetupResponse = {
233
233
  returnUrl: string;
234
234
  configuration: SessionConfiguration;
235
235
  };
236
- export declare type CheckoutSessionPaymentResponse = {
236
+ export type CheckoutSessionPaymentResponse = {
237
237
  sessionData: string;
238
238
  status?: string;
239
239
  resultCode: string;
240
240
  action?: PaymentAction;
241
241
  };
242
- export declare type CheckoutSessionDetailsResponse = {
242
+ export type CheckoutSessionDetailsResponse = {
243
243
  sessionData: string;
244
244
  status?: string;
245
245
  resultCode: string;
246
246
  action?: PaymentAction;
247
247
  };
248
- export declare type CheckoutSessionBalanceResponse = {
248
+ export type CheckoutSessionBalanceResponse = {
249
249
  sessionData: string;
250
250
  balance?: PaymentAmount;
251
251
  transactionLimit?: PaymentAmount;
252
252
  };
253
- export declare type CheckoutSessionOrdersResponse = {
253
+ export type CheckoutSessionOrdersResponse = {
254
254
  sessionData: string;
255
255
  orderData: string;
256
256
  pspReference: string;
@@ -1,4 +1,4 @@
1
- export declare type FormatterFn = (value: string, context?: {
1
+ export type FormatterFn = (value: string, context?: {
2
2
  state: {
3
3
  data: {
4
4
  country?: string;
@@ -1,20 +1,20 @@
1
1
  import { ValidationRuleResult } from './ValidationRuleResult';
2
2
  import { Formatter } from '../useForm/types';
3
- declare type ValidatorMode = 'blur' | 'input';
4
- export declare type ErrorMessageObject = {
3
+ type ValidatorMode = 'blur' | 'input';
4
+ export type ErrorMessageObject = {
5
5
  translationKey: string;
6
6
  translationObject: any;
7
7
  };
8
- export declare type Ruleset = {
8
+ export type Ruleset = {
9
9
  [key: string]: any;
10
10
  };
11
- export declare type CountryRuleset = {
11
+ export type CountryRuleset = {
12
12
  [country: string]: Ruleset;
13
13
  };
14
- export declare type FormatRules = {
14
+ export type FormatRules = {
15
15
  [field: string]: Formatter;
16
16
  };
17
- export declare type CountryFormatRules = {
17
+ export type CountryFormatRules = {
18
18
  [country: string]: FormatRules;
19
19
  };
20
20
  export interface ValidatorRule {
@@ -22,10 +22,10 @@ export interface ValidatorRule {
22
22
  errorMessage?: string | ErrorMessageObject;
23
23
  modes: ValidatorMode[];
24
24
  }
25
- export declare type ValidatorRules = {
25
+ export type ValidatorRules = {
26
26
  [field: string]: ValidatorRule | ValidatorRule[];
27
27
  };
28
- export declare type CountryBasedValidatorRules = {
28
+ export type CountryBasedValidatorRules = {
29
29
  [country: string]: ValidatorRules;
30
30
  };
31
31
  export interface FieldData {
@@ -38,7 +38,7 @@ export interface FieldContext {
38
38
  [key: string]: any;
39
39
  };
40
40
  }
41
- export declare type ValidationRuleResults = {
41
+ export type ValidationRuleResults = {
42
42
  [key: string]: ValidationRuleResult;
43
43
  };
44
44
  export {};
@@ -1,6 +1,6 @@
1
1
  import { ValidatorRules } from '../Validator/types';
2
2
  import { FormatterFn } from '../Formatters/types';
3
- export declare type FormState<FormSchema> = {
3
+ export type FormState<FormSchema> = {
4
4
  schema?: string[];
5
5
  data: FormSchema;
6
6
  errors: {
@@ -19,7 +19,7 @@ export interface Formatter {
19
19
  format?: string;
20
20
  maxlength?: number;
21
21
  }
22
- export declare type FormProps = {
22
+ export type FormProps = {
23
23
  rules?: ValidatorRules;
24
24
  formatters?: {
25
25
  [key: string]: Formatter | Function;
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.32.0",
26
+ "version": "5.34.0",
27
27
  "license": "MIT",
28
28
  "homepage": "https://docs.adyen.com/checkout",
29
29
  "repository": "github:Adyen/adyen-web",
@@ -63,21 +63,21 @@
63
63
  "@rollup/plugin-json": "^6.0.0",
64
64
  "@rollup/plugin-node-resolve": "^15.0.0",
65
65
  "@rollup/plugin-replace": "^5.0.1",
66
- "@testing-library/jest-dom": "^5.16.5",
67
- "@testing-library/preact": "^3.0.0",
68
- "@testing-library/preact-hooks": "^1.1.0",
69
- "@testing-library/user-event": "^14.4.3",
70
- "@types/jest": "29.2.6",
71
- "@typescript-eslint/eslint-plugin": "^5.37.0",
72
- "@typescript-eslint/parser": "^5.39.0",
66
+ "@testing-library/jest-dom": "5.16.5",
67
+ "@testing-library/preact": "3.2.3",
68
+ "@testing-library/preact-hooks": "1.1.0",
69
+ "@testing-library/user-event": "14.4.3",
70
+ "@types/jest": "29.4.0",
71
+ "@typescript-eslint/eslint-plugin": "5.50.0",
72
+ "@typescript-eslint/parser": "5.50.0",
73
73
  "autoprefixer": "10.4.13",
74
- "babel-jest": "29.3.1",
74
+ "babel-jest": "29.4.1",
75
75
  "cross-env": "^7.0.3",
76
76
  "cssnano": "5.1.14",
77
77
  "dotenv": "^16.0.3",
78
78
  "enzyme": "3.11.0",
79
79
  "enzyme-adapter-preact-pure": "4.1.0",
80
- "eslint": "8.30.0",
80
+ "eslint": "8.33.0",
81
81
  "eslint-plugin-import": "^2.26.0",
82
82
  "eslint-plugin-jsx-a11y": "^6.6.1",
83
83
  "eslint-plugin-react": "^7.31.8",
@@ -86,8 +86,8 @@
86
86
  "filesize": "^10.0.0",
87
87
  "gzip-size": "^6.0.0",
88
88
  "husky": "^8.0.1",
89
- "jest": "29.3.1",
90
- "jest-environment-jsdom": "29.3.1",
89
+ "jest": "29.4.1",
90
+ "jest-environment-jsdom": "29.4.1",
91
91
  "jest-mock-extended": "^3.0.1",
92
92
  "lint-staged": "^13.0.3",
93
93
  "postcss": "8.4.21",
@@ -96,11 +96,11 @@
96
96
  "rollup-plugin-stylelint": "1.0.0",
97
97
  "rollup-plugin-terser": "^7.0.2",
98
98
  "rollup-plugin-visualizer": "^5.8.3",
99
- "sass": "1.57.1",
99
+ "sass": "1.58.0",
100
100
  "stylelint": "14.16.1",
101
101
  "stylelint-config-standard-scss": "6.1.0",
102
102
  "tslib": "^2.4.1",
103
- "typescript": "4.5.3",
103
+ "typescript": "4.9.5",
104
104
  "whatwg-fetch": "^3.6.2"
105
105
  },
106
106
  "dependencies": {