@adyen/adyen-web 5.5.0 → 5.7.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 (118) hide show
  1. package/README.md +1 -1
  2. package/dist/adyen.css +3 -2
  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 +3 -2
  7. package/dist/cjs/adyen.css.map +1 -1
  8. package/dist/cjs/index.js +1 -1
  9. package/dist/es/adyen.css +3 -2
  10. package/dist/es/adyen.css.map +1 -1
  11. package/dist/es/index.js +1 -1
  12. package/dist/es.modern/adyen.css +3 -2
  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/components/AchInput/AchInput.d.ts +2 -4
  16. package/dist/types/components/Ach/components/AchInput/defaultProps.d.ts +0 -3
  17. package/dist/types/components/Ach/components/AchInput/types.d.ts +40 -0
  18. package/dist/types/components/Card/Bancontact.d.ts +10 -5
  19. package/dist/types/components/Card/Card.d.ts +10 -4
  20. package/dist/types/components/Card/components/CardInput/CardInput.d.ts +2 -39
  21. package/dist/types/components/Card/components/CardInput/components/CardFieldsWrapper.d.ts +47 -0
  22. package/dist/types/components/Card/components/CardInput/components/Installments/Installments.d.ts +4 -0
  23. package/dist/types/components/Card/components/CardInput/components/StoredCardFields.d.ts +1 -1
  24. package/dist/types/components/Card/components/CardInput/components/StoredCardFieldsWrapper.d.ts +16 -0
  25. package/dist/types/components/Card/components/CardInput/components/types.d.ts +1 -1
  26. package/dist/types/components/Card/components/CardInput/defaultProps.d.ts +2 -4
  27. package/dist/types/components/Card/components/CardInput/handlers.d.ts +8 -0
  28. package/dist/types/components/Card/components/CardInput/layouts.d.ts +9 -0
  29. package/dist/types/components/Card/components/CardInput/types.d.ts +86 -14
  30. package/dist/types/components/Card/components/CardInput/utils.d.ts +50 -0
  31. package/dist/types/components/Card/types.d.ts +2 -4
  32. package/dist/types/components/Dropin/Dropin.d.ts +5 -1
  33. package/dist/types/components/Dropin/components/DropinComponent.d.ts +3 -2
  34. package/dist/types/components/Dropin/types.d.ts +7 -3
  35. package/dist/types/components/SecuredFields/SecuredFieldsInput/SecuredFieldsInput.d.ts +31 -1
  36. package/dist/types/components/ThreeDS2/callSubmit3DS2Fingerprint.d.ts +2 -1
  37. package/dist/types/components/ThreeDS2/types.d.ts +18 -0
  38. package/dist/types/components/UIElement.d.ts +10 -11
  39. package/dist/types/components/internal/Address/Specifications.d.ts +7 -1
  40. package/dist/types/components/internal/Address/types.d.ts +5 -6
  41. package/dist/types/components/internal/FormFields/Field/Field.d.ts +2 -1
  42. package/dist/types/components/internal/FormFields/Field/types.d.ts +1 -0
  43. package/dist/types/components/internal/FormFields/Select/Select.d.ts +1 -1
  44. package/dist/types/components/internal/FormFields/Select/types.d.ts +1 -0
  45. package/dist/types/components/internal/SecuredFields/SFP/SFPUtils.d.ts +19 -0
  46. package/dist/types/components/internal/SecuredFields/{SecuredFieldsProvider.d.ts → SFP/SecuredFieldsProvider.d.ts} +4 -26
  47. package/dist/types/components/internal/SecuredFields/{SecuredFieldsProviderHandlers.d.ts → SFP/SecuredFieldsProviderHandlers.d.ts} +1 -1
  48. package/dist/types/components/internal/SecuredFields/SFP/defaultProps.d.ts +64 -0
  49. package/dist/types/components/internal/SecuredFields/SFP/types.d.ts +32 -0
  50. package/dist/types/components/internal/SecuredFields/lib/{core → CSF}/AbstractCSF.d.ts +8 -7
  51. package/dist/types/components/internal/SecuredFields/lib/{core → CSF}/CSF.d.ts +1 -5
  52. package/dist/types/components/internal/SecuredFields/lib/{core/utils/registerAdditionalField.d.ts → CSF/extensions/additionalFields.d.ts} +0 -0
  53. package/dist/types/components/internal/SecuredFields/lib/{configuration → CSF/extensions}/configureCallbacks.d.ts +0 -0
  54. package/dist/types/components/internal/SecuredFields/lib/{core → CSF/extensions}/createSecuredFields.d.ts +0 -0
  55. package/dist/types/components/internal/SecuredFields/lib/{core/utils → CSF/extensions}/handleBrandFromBinLookup.d.ts +1 -1
  56. package/dist/types/components/internal/SecuredFields/lib/{configuration → CSF/extensions}/handleConfig.d.ts +0 -0
  57. package/dist/types/components/internal/SecuredFields/lib/{core → CSF/extensions}/handleEncryption.d.ts +1 -1
  58. package/dist/types/components/internal/SecuredFields/lib/{core/utils/tabbing → CSF/extensions}/handleTab.d.ts +0 -0
  59. package/dist/types/components/internal/SecuredFields/lib/{core → CSF/extensions}/handleValidation.d.ts +1 -1
  60. package/dist/types/components/internal/SecuredFields/lib/CSF/index.d.ts +2 -0
  61. package/dist/types/components/internal/SecuredFields/lib/{core → CSF}/initCSF.d.ts +1 -1
  62. package/dist/types/components/internal/SecuredFields/lib/CSF/partials/handleBinValue.d.ts +11 -0
  63. package/dist/types/components/internal/SecuredFields/lib/CSF/partials/handleFocus.d.ts +15 -0
  64. package/dist/types/components/internal/SecuredFields/lib/CSF/partials/handleIframeConfigFeedback.d.ts +11 -0
  65. package/dist/types/components/internal/SecuredFields/lib/CSF/partials/isConfigured.d.ts +13 -0
  66. package/dist/types/components/internal/SecuredFields/lib/CSF/partials/postMessageToAllIframes.d.ts +13 -0
  67. package/dist/types/components/internal/SecuredFields/lib/CSF/partials/processAutoComplete.d.ts +14 -0
  68. package/dist/types/components/internal/SecuredFields/lib/CSF/partials/processBrand.d.ts +20 -0
  69. package/dist/types/components/internal/SecuredFields/lib/CSF/partials/setFocusOnFrame.d.ts +11 -0
  70. package/dist/types/components/internal/SecuredFields/lib/CSF/partials/validateForm.d.ts +10 -0
  71. package/dist/types/components/internal/SecuredFields/lib/CSF/types.d.ts +83 -0
  72. package/dist/types/components/internal/SecuredFields/lib/{core → CSF}/utils/callbackUtils.d.ts +0 -0
  73. package/dist/types/components/internal/SecuredFields/lib/{utilities → CSF/utils}/cardType.d.ts +1 -1
  74. package/dist/types/components/internal/SecuredFields/lib/{core → CSF/utils}/destroySecuredFields.d.ts +0 -0
  75. package/dist/types/components/internal/SecuredFields/lib/{ui → CSF/utils}/encryptedElements.d.ts +0 -0
  76. package/dist/types/components/internal/SecuredFields/lib/{core → CSF}/utils/getCardGroupTypes.d.ts +0 -0
  77. package/dist/types/components/internal/SecuredFields/lib/CSF/utils/iframes/getIframeContentWin.d.ts +5 -0
  78. package/dist/types/components/internal/SecuredFields/lib/{core → CSF}/utils/iframes/postMessageToIframe.d.ts +0 -0
  79. package/dist/types/components/internal/SecuredFields/lib/{core → CSF}/utils/iframes/postMessageValidation.d.ts +0 -0
  80. package/dist/types/components/internal/SecuredFields/lib/{core → CSF}/utils/processErrors.d.ts +1 -1
  81. package/dist/types/components/internal/SecuredFields/lib/{core → CSF}/utils/tabbing/tabScenarioACH.d.ts +0 -0
  82. package/dist/types/components/internal/SecuredFields/lib/{core → CSF}/utils/tabbing/tabScenarioCreditCard.d.ts +0 -0
  83. package/dist/types/components/internal/SecuredFields/lib/{core → CSF}/utils/tabbing/tabScenarioGiftCard.d.ts +0 -0
  84. package/dist/types/components/internal/SecuredFields/lib/{core → CSF}/utils/tabbing/tabScenarioKCP.d.ts +0 -0
  85. package/dist/types/components/internal/SecuredFields/lib/{ui/domUtils.d.ts → CSF/utils/tabbing/utils.d.ts} +0 -1
  86. package/dist/types/components/internal/SecuredFields/lib/{utilities → CSF/utils}/userAgent.d.ts +0 -0
  87. package/dist/types/components/internal/SecuredFields/lib/configuration/constants.d.ts +4 -3
  88. package/dist/types/components/internal/SecuredFields/lib/{core → securedField}/AbstractSecuredField.d.ts +2 -6
  89. package/dist/types/components/internal/SecuredFields/lib/{core → securedField}/SecuredField.d.ts +2 -1
  90. package/dist/types/components/internal/SecuredFields/lib/{utilities → securedField/utils}/createIframe.d.ts +0 -0
  91. package/dist/types/components/internal/SecuredFields/lib/{core/utils/init → securedField/utils}/processAriaConfig.d.ts +2 -2
  92. package/dist/types/components/internal/SecuredFields/lib/{core/utils/init → securedField/utils}/processPlaceholders.d.ts +1 -1
  93. package/dist/types/components/internal/SecuredFields/lib/types.d.ts +5 -81
  94. package/dist/types/components/internal/SecuredFields/lib/utilities/commonUtils.d.ts +6 -1
  95. package/dist/types/components/internal/SecuredFields/utils.d.ts +1 -20
  96. package/dist/types/components/internal/SocialSecurityNumberBrazil/SocialSecurityNumberBrazil.d.ts +2 -1
  97. package/dist/types/components/types.d.ts +20 -0
  98. package/dist/types/core/Context/CoreContext.d.ts +2 -0
  99. package/dist/types/core/Context/CoreProvider.d.ts +4 -0
  100. package/dist/types/core/Context/useCoreContext.d.ts +1 -0
  101. package/dist/types/core/Errors/ErrorPanel.d.ts +14 -0
  102. package/dist/types/core/ProcessResponse/PaymentMethodsResponse/PaymentMethodsResponse.d.ts +1 -0
  103. package/dist/types/core/Services/http.d.ts +5 -4
  104. package/dist/types/core/core.d.ts +9 -2
  105. package/dist/types/utils/Validator/Validator.d.ts +1 -1
  106. package/dist/types/utils/hasOwnProperty.d.ts +1 -1
  107. package/package.json +3 -3
  108. package/dist/types/components/internal/SecuredFields/defaultProps.d.ts +0 -104
  109. package/dist/types/components/internal/SecuredFields/lib/core/utils/handleBinValue.d.ts +0 -2
  110. package/dist/types/components/internal/SecuredFields/lib/core/utils/iframes/handleFocus.d.ts +0 -2
  111. package/dist/types/components/internal/SecuredFields/lib/core/utils/iframes/handleIframeConfigFeedback.d.ts +0 -1
  112. package/dist/types/components/internal/SecuredFields/lib/core/utils/iframes/postMessageToAllIframes.d.ts +0 -1
  113. package/dist/types/components/internal/SecuredFields/lib/core/utils/iframes/setFocusOnFrame.d.ts +0 -1
  114. package/dist/types/components/internal/SecuredFields/lib/core/utils/isConfigured.d.ts +0 -1
  115. package/dist/types/components/internal/SecuredFields/lib/core/utils/processAutoComplete.d.ts +0 -2
  116. package/dist/types/components/internal/SecuredFields/lib/core/utils/processBrand.d.ts +0 -8
  117. package/dist/types/components/internal/SecuredFields/lib/core/utils/validateForm.d.ts +0 -1
  118. package/dist/types/components/internal/SecuredFields/lib/index.d.ts +0 -2
@@ -1,4 +1,4 @@
1
- import { CardObject } from '../types';
1
+ import { CardObject } from '../../types';
2
2
  declare const _default: {
3
3
  detectCard: (pCardNumber: any, pAvailableCards?: any) => any;
4
4
  detectCardLength: (pCard: any, pUnformattedVal: any) => {
@@ -0,0 +1,5 @@
1
+ import { CSFStateObject } from '../../types';
2
+ /**
3
+ * Retrieves the iframe, stored by field type, & returns it's contentWindow
4
+ */
5
+ export default function getIframeContentWin(csfState: CSFStateObject, fieldType: string): Window;
@@ -1,5 +1,5 @@
1
1
  import { CbObjOnError, SFFeedbackObj } from '../../types';
2
- import SecuredField from '../../../../../../components/internal/SecuredFields/lib/core/SecuredField';
2
+ import SecuredField from '../../securedField/SecuredField';
3
3
  declare 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 {};
@@ -1,2 +1 @@
1
- export declare const findRootNode: (pRootNode: any) => any;
2
1
  export declare const getPreviousTabbableNonSFElement: (passedFieldType: any, rootNode: any) => any;
@@ -1,4 +1,4 @@
1
- import { CVCPolicyType, DatePolicyType } from '../core/AbstractSecuredField';
1
+ import { CVCPolicyType, DatePolicyType } from '../types';
2
2
  export declare const ENCRYPTED_CARD_NUMBER = "encryptedCardNumber";
3
3
  export declare const ENCRYPTED_EXPIRY_DATE = "encryptedExpiryDate";
4
4
  export declare const ENCRYPTED_EXPIRY_MONTH = "encryptedExpiryMonth";
@@ -11,10 +11,11 @@ export declare const ENCRYPTED_PIN_FIELD = "encryptedPin";
11
11
  export declare const GIFT_CARD = "giftcard";
12
12
  export declare const ENCRYPTED_BANK_ACCNT_NUMBER_FIELD = "encryptedBankAccountNumber";
13
13
  export declare const ENCRYPTED_BANK_LOCATION_FIELD = "encryptedBankLocationId";
14
- export declare const SF_VERSION = "3.7.3";
14
+ export declare const SF_VERSION = "3.8.0";
15
15
  export declare const DEFAULT_CARD_GROUP_TYPES: string[];
16
16
  export declare const NON_CREDIT_CARD_TYPE_SECURED_FIELDS: string[];
17
- export declare const CSF_FIELDS_ARRAY: string[];
17
+ export declare const SF_FIELDS_ARRAY: string[];
18
+ export declare const ALL_SECURED_FIELDS: string[];
18
19
  export declare const REQUIRED = "required";
19
20
  export declare const OPTIONAL = "optional";
20
21
  export declare const HIDDEN = "hidden";
@@ -1,10 +1,5 @@
1
- import { SFFeedbackObj, StylesObject } from '../types';
1
+ import { CVCPolicyType, DatePolicyType, RtnType_callbackFn, RtnType_noParamVoidFn, RtnType_postMessageListener, StylesObject } from '../types';
2
2
  import { ENCRYPTED_BANK_ACCNT_NUMBER_FIELD, ENCRYPTED_BANK_LOCATION_FIELD, ENCRYPTED_CARD_NUMBER, ENCRYPTED_EXPIRY_DATE, ENCRYPTED_EXPIRY_MONTH, ENCRYPTED_EXPIRY_YEAR, ENCRYPTED_PWD_FIELD, ENCRYPTED_SECURITY_CODE, ENCRYPTED_SECURITY_CODE_3_DIGITS, ENCRYPTED_SECURITY_CODE_4_DIGITS } from '../configuration/constants';
3
- export declare type RtnType_noParamVoidFn = () => void;
4
- export declare type RtnType_postMessageListener = (event: Event) => void;
5
- export declare type RtnType_callbackFn = (feedbackObj: SFFeedbackObj) => void;
6
- export declare type CVCPolicyType = 'required' | 'optional' | 'hidden';
7
- export declare type DatePolicyType = 'required' | 'optional' | 'hidden';
8
3
  /**
9
4
  * Base interface, props common to both SFSetupObject & IframeConfigObject
10
5
  */
@@ -24,6 +19,7 @@ export interface SFInternalConfig {
24
19
  minimumExpiryDate: string;
25
20
  uid: string;
26
21
  implementationType: string;
22
+ isCollatingErrors: boolean;
27
23
  }
28
24
  /**
29
25
  * The object passed from createSecuredFields to a new instance of SecuredField.ts
@@ -1,4 +1,5 @@
1
- import AbstractSecuredField, { SFSetupObject, RtnType_noParamVoidFn, RtnType_postMessageListener, RtnType_callbackFn, CVCPolicyType, DatePolicyType } from '../core/AbstractSecuredField';
1
+ import AbstractSecuredField, { SFSetupObject } from './AbstractSecuredField';
2
+ import { CVCPolicyType, DatePolicyType, RtnType_noParamVoidFn, RtnType_postMessageListener, RtnType_callbackFn } from '../types';
2
3
  import Language from '../../../../../language/Language';
3
4
  declare class SecuredField extends AbstractSecuredField {
4
5
  constructor(pSetupObj: SFSetupObject, i18n: Language);
@@ -1,5 +1,5 @@
1
- import { AriaConfig, SFInternalConfig } from '../../AbstractSecuredField';
2
- import Language from '../../../../../../../language/Language';
1
+ import { AriaConfig, SFInternalConfig } from '../AbstractSecuredField';
2
+ import Language from '../../../../../../language/Language';
3
3
  /**
4
4
  * Checks if the merchant has defined an ariaConfig object and if so enhances it with a iframeTitle and label property, if they don't already exist.
5
5
  * If the ariaConfig object doesn't exist at all we create one with these 2 properties.
@@ -1,4 +1,4 @@
1
- import { SFPlaceholdersObject, SFInternalConfig } from '../../AbstractSecuredField';
1
+ import { SFPlaceholdersObject, SFInternalConfig } from '../AbstractSecuredField';
2
2
  /**
3
3
  * Create placeholders with a value from the relevant translation file
4
4
  */
@@ -1,5 +1,3 @@
1
- import Language from '../../../../language/Language';
2
- import { CVCPolicyType, DatePolicyType } from './core/AbstractSecuredField';
3
1
  import { BrandObject } from '../../../Card/types';
4
2
  declare global {
5
3
  interface Window {
@@ -13,85 +11,6 @@ export interface BrandStorageObject {
13
11
  expiryDatePolicy: DatePolicyType;
14
12
  showSocialSecurityNumber?: boolean;
15
13
  }
16
- /**
17
- * Exposed functions that can be called on the CSF instance
18
- */
19
- export interface CSFReturnObject {
20
- updateStyles: any;
21
- setFocusOnFrame: any;
22
- isValidated: any;
23
- destroy: any;
24
- brandsFromBinLookup: any;
25
- hasUnsupportedCard: any;
26
- addSecuredField: any;
27
- removeSecuredField: any;
28
- setKCPStatus: any;
29
- sendValueToFrame?: any;
30
- }
31
- /**
32
- * Base interface for SetupObject & ConfigObject
33
- */
34
- interface CSFCommonProps {
35
- loadingContext: string;
36
- cardGroupTypes?: string[];
37
- allowedDOMAccess?: boolean;
38
- autoFocus?: boolean;
39
- trimTrailingSeparator?: boolean;
40
- showWarnings?: boolean;
41
- keypadFix?: boolean;
42
- isKCP?: boolean;
43
- iframeUIConfig?: object;
44
- legacyInputMode?: boolean;
45
- minimumExpiryDate?: string;
46
- implementationType?: string;
47
- }
48
- /**
49
- * Object sent when SecuredFieldsProvider initialises CSF
50
- */
51
- export interface CSFSetupObject extends CSFCommonProps {
52
- type: string;
53
- clientKey: string;
54
- rootNode: string | HTMLElement;
55
- callbacks?: object;
56
- i18n?: Language;
57
- }
58
- /**
59
- * The type for the config object created by CSF: properties that just need to be set once, at startup, and then don't change
60
- * This object provides the source for many of the properties that are written into the SFSetupObject used to initialise a new SecuredField.ts
61
- */
62
- export interface CSFConfigObject extends CSFCommonProps {
63
- iframeSrc: string;
64
- isCreditCardType: boolean;
65
- sfLogAtStart: boolean;
66
- }
67
- export interface CSFCallbacksConfig {
68
- onLoad?: (callbackObj: object) => void;
69
- onConfigSuccess?: (callbackObj: object) => void;
70
- onFieldValid?: (callbackObj: object) => void;
71
- onAllValid?: (callbackObj: object) => void;
72
- onBrand?: (callbackObj: object) => void;
73
- onError?: (callbackObj: object) => void;
74
- onFocus?: (callbackObj: object) => void;
75
- onBinValue?: (callbackObj: object) => void;
76
- onAutoComplete?: (callbackObj: object) => void;
77
- onAdditionalSFConfig?: (callbackObj: object) => void;
78
- onAdditionalSFRemoved?: (callbackObj: object) => void;
79
- }
80
- export interface CSFStateObject {
81
- type: string;
82
- brand: BrandStorageObject;
83
- allValid: boolean;
84
- numIframes: number;
85
- originalNumIframes: number;
86
- iframeCount: number;
87
- iframeConfigCount: number;
88
- isConfigured: boolean;
89
- hasSeparateDateFields: boolean;
90
- currentFocusObject: string;
91
- registerFieldForIos: boolean;
92
- securedFields: object;
93
- isKCP: boolean;
94
- }
95
14
  export interface StylesObject {
96
15
  base?: StyleDefinitions;
97
16
  error?: StyleDefinitions;
@@ -259,4 +178,9 @@ export interface SendBrandObject {
259
178
  export interface SendExpiryDateObject {
260
179
  expiryDatePolicy: DatePolicyType;
261
180
  }
181
+ export declare type RtnType_noParamVoidFn = () => void;
182
+ export declare type RtnType_postMessageListener = (event: Event) => void;
183
+ export declare type RtnType_callbackFn = (feedbackObj: SFFeedbackObj) => void;
184
+ export declare type CVCPolicyType = 'required' | 'optional' | 'hidden';
185
+ export declare type DatePolicyType = 'required' | 'optional' | 'hidden';
262
186
  export {};
@@ -36,4 +36,9 @@ declare function falsy(x: any): boolean;
36
36
  * @param x -
37
37
  */
38
38
  declare function notFalsy(x: any): boolean;
39
- export { generateRandomNumber, existy, falsy, isArray, objectsDeepEqual, notFalsy, truthy };
39
+ /**
40
+ * This function allows us to partially apply any number of variables to functions that take any number of parameters.
41
+ * @returns \{function(): *\}
42
+ */
43
+ declare function partial(...args: any[]): (...args2: any[]) => any;
44
+ export { generateRandomNumber, existy, falsy, isArray, objectsDeepEqual, notFalsy, partial, truthy };
@@ -1,24 +1,5 @@
1
1
  import Language from '../../../language/Language';
2
- import { SFPlaceholdersObject } from './lib/core/AbstractSecuredField';
3
- /**
4
- * Make an array of encrypted field names based on the value of the 'data-cse' attribute of elements in the rootNode
5
- */
6
- export declare const getFields: (rootNode: any) => any;
7
- /**
8
- * If, visually, we're dealing with a single date field (expiryDate) we still need separate entries
9
- * for expiryMonth & expiryYear - since that is how the values will be delivered from securedFields
10
- */
11
- export declare const validFieldsReducer: (acc: any, cur: any) => any;
12
- export declare const getErrorReducer: (numDateFields: any, state: any) => (acc: any, field: any) => any;
13
- /**
14
- * Create an object suitable for sending to our handleOnError function
15
- */
16
- export declare const getErrorObject: (fieldType: any, rootNode: any, state: any) => {
17
- rootNode: any;
18
- fieldType: any;
19
- error: any;
20
- type: string;
21
- };
2
+ import { SFPlaceholdersObject } from './lib/securedField/AbstractSecuredField';
22
3
  /**
23
4
  * Lookup translated values for the placeholders for the SecuredFields
24
5
  * and return an object with these mapped to the data-cse value of the SecuredField
@@ -1,8 +1,9 @@
1
1
  import { h } from 'preact';
2
- export default function ({ onChange, onInput, valid, error, data }: {
2
+ export default function ({ onChange, onInput, valid, error, data, required }: {
3
3
  onChange: any;
4
4
  onInput: any;
5
5
  valid?: boolean;
6
6
  error?: any;
7
7
  data?: string;
8
+ required?: boolean;
8
9
  }): h.JSX.Element;
@@ -21,6 +21,22 @@ export interface BaseElementProps {
21
21
  };
22
22
  isDropin?: boolean;
23
23
  }
24
+ export interface IUIElement {
25
+ isValid: boolean;
26
+ displayName: string;
27
+ accessibleName: string;
28
+ type: string;
29
+ elementRef: any;
30
+ submit(): void;
31
+ setStatus(status: UIElementStatus, props?: {
32
+ message?: string;
33
+ [key: string]: any;
34
+ }): UIElement;
35
+ handleAction(action: PaymentAction): UIElement | null;
36
+ showValidation(): void;
37
+ setState(newState: object): void;
38
+ }
39
+ export declare type UIElementStatus = 'ready' | 'loading' | 'error' | 'success';
24
40
  export interface UIElementProps extends BaseElementProps {
25
41
  session?: {
26
42
  id: string;
@@ -45,5 +61,9 @@ export interface UIElementProps extends BaseElementProps {
45
61
  * @defaultValue true
46
62
  */
47
63
  showPayButton?: boolean;
64
+ /**
65
+ * Set to false to not set the Component status to 'loading' when onSubmit is triggered.
66
+ * @defaultValue true
67
+ */
48
68
  setStatusAutomatically?: boolean;
49
69
  }
@@ -1,5 +1,7 @@
1
+ import { CommonPropsTypes } from './CoreProvider';
1
2
  import Language from '../../language/Language';
2
3
  export declare const CoreContext: import("preact").Context<{
3
4
  i18n: Language;
4
5
  loadingContext: string;
6
+ commonProps: CommonPropsTypes;
5
7
  }>;
@@ -3,6 +3,10 @@ interface CoreProviderProps {
3
3
  loadingContext: string;
4
4
  i18n: any;
5
5
  children?: any;
6
+ commonProps?: CommonPropsTypes;
7
+ }
8
+ export interface CommonPropsTypes {
9
+ isCollatingErrors?: boolean;
6
10
  }
7
11
  /**
8
12
  * CoreProvider Component
@@ -1,5 +1,6 @@
1
1
  declare function useCoreContext(): {
2
2
  i18n: import("../../language").default;
3
3
  loadingContext: string;
4
+ commonProps: import("./CoreProvider").CommonPropsTypes;
4
5
  };
5
6
  export default useCoreContext;
@@ -0,0 +1,14 @@
1
+ import { h } from 'preact';
2
+ import './ErrorPanel.scss';
3
+ export interface ErrorPanelObj {
4
+ errorMessages: string[];
5
+ fieldList: string[];
6
+ }
7
+ export interface ErrorPanelProps {
8
+ id?: string;
9
+ heading?: string;
10
+ errors: ErrorPanelObj;
11
+ callbackFn?: (who: any) => void;
12
+ showPanel?: boolean;
13
+ }
14
+ export declare function ErrorPanel({ id, heading, errors, callbackFn, showPanel }: ErrorPanelProps): h.JSX.Element;
@@ -3,6 +3,7 @@ declare class PaymentMethodsResponse {
3
3
  paymentMethods: PaymentMethod[];
4
4
  storedPaymentMethods: PaymentMethod[];
5
5
  constructor(response: any, options?: {});
6
+ private mapCreatedComponentType;
6
7
  has(paymentMethod: string): boolean;
7
8
  find(paymentMethod: string): PaymentMethod;
8
9
  }
@@ -6,9 +6,10 @@ interface HttpOptions {
6
6
  loadingContext?: string;
7
7
  method?: string;
8
8
  path: string;
9
- errorLevel?: 'silent' | 'info' | 'warn' | 'error' | 'fatal';
9
+ errorLevel?: ErrorLevel;
10
10
  }
11
- export declare function http(options: HttpOptions, data?: any): Promise<any>;
12
- export declare const httpGet: (options: HttpOptions, data?: any) => Promise<any>;
13
- export declare const httpPost: (options: HttpOptions, data?: any) => Promise<any>;
11
+ declare type ErrorLevel = 'silent' | 'info' | 'warn' | 'error' | 'fatal';
12
+ export declare function http<T>(options: HttpOptions, data?: any): Promise<T>;
13
+ export declare function httpGet<T = any>(options: HttpOptions, data?: any): Promise<T>;
14
+ export declare function httpPost<T = any>(options: HttpOptions, data?: any): Promise<T>;
14
15
  export {};
@@ -29,8 +29,15 @@ declare class Core {
29
29
  submitDetails(details: any): void;
30
30
  /**
31
31
  * Instantiates a new UIElement component ready to be mounted
32
- * @param paymentMethod - name or class of the paymentMethod
33
- * @param options - options that will be merged to the global Checkout props
32
+ *
33
+ * @param paymentMethod - either name of the paymentMethod (in theory this can also be a class, but we don't use it this way)
34
+ * or object extracted from the paymentMethods response .paymentMethods or .storedPaymentMethods (scenario: Dropin creating components for its PM list)
35
+ *
36
+ * @param options - an object whose form varies, can be:
37
+ * - the merchant defined config object passed when a component is created via checkout.create
38
+ * - the Dropin created object from Dropin/components/utils.getCommonProps()
39
+ * - an object extracted from the paymentMethods response .storedPaymentMethods (scenario: standalone storedCard comp)
40
+ *
34
41
  * @returns new UIElement
35
42
  */
36
43
  create<T extends keyof PaymentMethods>(paymentMethod: T | string, options?: PaymentMethodOptions<T>): InstanceType<PaymentMethods[T]>;
@@ -20,7 +20,7 @@ export declare type ValidatorRules = {
20
20
  /**
21
21
  * Holds the result of a validation
22
22
  */
23
- declare class ValidationRuleResult {
23
+ export declare class ValidationRuleResult {
24
24
  private readonly shouldValidate;
25
25
  isValid: boolean;
26
26
  errorMessage: string;
@@ -1 +1 @@
1
- export declare function hasOwnProperty(obj: any, prop: any): any;
1
+ export declare function hasOwnProperty(obj: {}, prop: any): any;
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.5.0",
26
+ "version": "5.7.0",
27
27
  "license": "MIT",
28
28
  "homepage": "https://docs.adyen.com/checkout",
29
29
  "repository": "github:Adyen/adyen-web",
@@ -57,7 +57,7 @@
57
57
  "@babel/preset-typescript": "^7.15.0",
58
58
  "@babel/runtime-corejs3": "^7.16.3",
59
59
  "@rollup/plugin-babel": "^5.3.0",
60
- "@rollup/plugin-commonjs": "^19.0.0",
60
+ "@rollup/plugin-commonjs": "^21.0.1",
61
61
  "@rollup/plugin-eslint": "^8.0.1",
62
62
  "@rollup/plugin-json": "^4.1.0",
63
63
  "@rollup/plugin-node-resolve": "^13.0.0",
@@ -84,7 +84,7 @@
84
84
  "gzip-size": "^6.0.0",
85
85
  "jest": "^26.6.3",
86
86
  "node-sass": "^6.0.1",
87
- "postcss": "^8.3.5",
87
+ "postcss": "^8.4.5",
88
88
  "postcss-reporter": "^7.0.2",
89
89
  "prettier": "^1.19.1",
90
90
  "rollup": "^2.61.1",
@@ -1,104 +0,0 @@
1
- import { Language } from '../../../language/Language';
2
- import { CVCPolicyType } from './lib/core/AbstractSecuredField';
3
- export interface SFPProps {
4
- /**
5
- * CSF RELATED (±22)
6
- */
7
- allowedDOMAccess?: boolean;
8
- autoFocus?: boolean;
9
- brands?: string[];
10
- groupTypes?: string[];
11
- keypadFix?: boolean;
12
- loadingContext: string;
13
- onAllValid?: any;
14
- onAutoComplete?: any;
15
- onBinValue?: any;
16
- onBrand?: any;
17
- onConfigSuccess?: any;
18
- onError?: any;
19
- onFieldValid?: any;
20
- onFocus?: any;
21
- onLoad?: any;
22
- clientKey?: string;
23
- placeholders?: object;
24
- rootNode?: HTMLElement;
25
- showWarnings?: boolean;
26
- styles?: object;
27
- trimTrailingSeparator?: boolean;
28
- type: string;
29
- /**
30
- * SFP RELATED (6)
31
- */
32
- i18n: Language;
33
- koreanAuthenticationRequired: boolean;
34
- hasKoreanFields: boolean;
35
- onChange: any;
36
- render: any;
37
- legacyInputMode: boolean;
38
- minimumExpiryDate: string;
39
- /**
40
- * RELATED TO COMPS HIGHER UP THE RENDER CHAIN - Card, CardInput etc (±39)
41
- */
42
- amount: object;
43
- billingAddressAllowedCountries: string[];
44
- billingAddressRequired: boolean;
45
- billingAddressRequiredFields: string[];
46
- brand: string;
47
- createFromAction: () => {};
48
- cvcPolicy: CVCPolicyType;
49
- data: object;
50
- details: object[];
51
- enableStoreDetails: boolean;
52
- environment: string;
53
- expiryMonth: string;
54
- expiryYear: string;
55
- hasCVC: boolean;
56
- hasHolderName: boolean;
57
- hideCVC: boolean;
58
- holderName: string;
59
- holderNameRequired: boolean;
60
- hasStoreDetails: boolean;
61
- id: string;
62
- installmentOptions: object;
63
- lastFour: string;
64
- locale: string;
65
- modules: object;
66
- name: string;
67
- onAdditionalDetails: () => {};
68
- onBlur: () => {};
69
- onSubmit: () => {};
70
- payButton: () => {};
71
- paymentMethods: object[];
72
- paymentMethodsResponse: object;
73
- risk: object;
74
- showBrandIcon: boolean;
75
- showPayButton: boolean;
76
- storedDetails: boolean;
77
- storedPaymentMethodId: string;
78
- storedPaymentMethods: object[];
79
- supportedShopperInteractions: string[];
80
- }
81
- declare const _default: {
82
- type: string;
83
- keypadFix: boolean;
84
- rootNode: any;
85
- loadingContext: any;
86
- groupTypes: any[];
87
- allowedDOMAccess: boolean;
88
- showWarnings: boolean;
89
- autoFocus: boolean;
90
- trimTrailingSeparator: boolean;
91
- onChange: () => void;
92
- onLoad: () => void;
93
- onConfigSuccess: () => void;
94
- onAllValid: () => void;
95
- onFieldValid: () => void;
96
- onBrand: () => void;
97
- onError: () => void;
98
- onBinValue: () => void;
99
- onFocus: () => void;
100
- onAutoComplete: () => void;
101
- placeholders: {};
102
- styles: {};
103
- };
104
- export default _default;
@@ -1,2 +0,0 @@
1
- import { SFFeedbackObj } from '../../types';
2
- export declare function handleBinValue(pFeedbackObj: SFFeedbackObj): void;
@@ -1,2 +0,0 @@
1
- import { SFFeedbackObj } from '../../../types';
2
- export declare function handleFocus(pFeedbackObj: SFFeedbackObj): void;
@@ -1 +0,0 @@
1
- export declare function handleIframeConfigFeedback(pFeedbackObj: any): boolean;
@@ -1 +0,0 @@
1
- export declare function postMessageToAllIframes(pDataObj: object): void;
@@ -1 +0,0 @@
1
- export declare function setFocusOnFrame(pFieldType: string, doLog?: boolean): void;
@@ -1 +0,0 @@
1
- export declare function isConfigured(): void;
@@ -1,2 +0,0 @@
1
- import { SFFeedbackObj } from '../../types';
2
- export declare function processAutoComplete(pFeedbackObj: SFFeedbackObj): void;
@@ -1,8 +0,0 @@
1
- import { SFFeedbackObj } from '../../types';
2
- /**
3
- * - If generic card type AND passed brand doesn't equal stored brand - send the new brand to the cvc input
4
- * (so it can reassess what length it should be and if any value it contains is now valid)
5
- *
6
- * - Create object for onBrand callback aka SFPHandlers.handleOnBrand
7
- */
8
- export declare function handleProcessBrand(pFeedbackObj: SFFeedbackObj): boolean;
@@ -1 +0,0 @@
1
- export declare function assessFormValidity(): void;
@@ -1,2 +0,0 @@
1
- import csf from './core/initCSF';
2
- export default csf;