@adyen/adyen-web 5.4.0 → 5.6.2

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 (155) hide show
  1. package/dist/adyen.css +2 -1
  2. package/dist/adyen.css.map +1 -1
  3. package/dist/adyen.js +1 -1
  4. package/dist/adyen.js.map +1 -1
  5. package/dist/cjs/adyen.css +2 -1
  6. package/dist/cjs/adyen.css.map +1 -1
  7. package/dist/cjs/index.js +1 -1
  8. package/dist/es/adyen.css +2 -1
  9. package/dist/es/adyen.css.map +1 -1
  10. package/dist/es/ar.js +1 -1
  11. package/dist/es/cs-CZ.js +1 -1
  12. package/dist/es/da-DK.js +1 -1
  13. package/dist/es/de-DE.js +1 -1
  14. package/dist/es/el-GR.js +1 -1
  15. package/dist/es/es-ES.js +1 -1
  16. package/dist/es/fi-FI.js +1 -1
  17. package/dist/es/fr-FR.js +1 -1
  18. package/dist/es/hr-HR.js +1 -1
  19. package/dist/es/hu-HU.js +1 -1
  20. package/dist/es/index.js +1 -1
  21. package/dist/es/it-IT.js +1 -1
  22. package/dist/es/ja-JP.js +1 -1
  23. package/dist/es/ko-KR.js +1 -1
  24. package/dist/es/nl-NL.js +1 -1
  25. package/dist/es/no-NO.js +1 -1
  26. package/dist/es/pl-PL.js +1 -1
  27. package/dist/es/pt-BR.js +1 -1
  28. package/dist/es/ro-RO.js +1 -1
  29. package/dist/es/ru-RU.js +1 -1
  30. package/dist/es/sk-SK.js +1 -1
  31. package/dist/es/sl-SI.js +1 -1
  32. package/dist/es/sv-SE.js +1 -1
  33. package/dist/es/zh-CN.js +1 -1
  34. package/dist/es/zh-TW.js +1 -1
  35. package/dist/es.modern/adyen.css +2 -1
  36. package/dist/es.modern/adyen.css.map +1 -1
  37. package/dist/es.modern/ar.js +1 -1
  38. package/dist/es.modern/cs-CZ.js +1 -1
  39. package/dist/es.modern/da-DK.js +1 -1
  40. package/dist/es.modern/de-DE.js +1 -1
  41. package/dist/es.modern/el-GR.js +1 -1
  42. package/dist/es.modern/es-ES.js +1 -1
  43. package/dist/es.modern/fi-FI.js +1 -1
  44. package/dist/es.modern/fr-FR.js +1 -1
  45. package/dist/es.modern/hr-HR.js +1 -1
  46. package/dist/es.modern/hu-HU.js +1 -1
  47. package/dist/es.modern/index.js +1 -1
  48. package/dist/es.modern/it-IT.js +1 -1
  49. package/dist/es.modern/ja-JP.js +1 -1
  50. package/dist/es.modern/ko-KR.js +1 -1
  51. package/dist/es.modern/nl-NL.js +1 -1
  52. package/dist/es.modern/no-NO.js +1 -1
  53. package/dist/es.modern/pl-PL.js +1 -1
  54. package/dist/es.modern/pt-BR.js +1 -1
  55. package/dist/es.modern/ro-RO.js +1 -1
  56. package/dist/es.modern/ru-RU.js +1 -1
  57. package/dist/es.modern/sk-SK.js +1 -1
  58. package/dist/es.modern/sl-SI.js +1 -1
  59. package/dist/es.modern/sv-SE.js +1 -1
  60. package/dist/es.modern/zh-CN.js +1 -1
  61. package/dist/es.modern/zh-TW.js +1 -1
  62. package/dist/types/components/Card/Bancontact.d.ts +7 -1
  63. package/dist/types/components/Card/Card.d.ts +6 -0
  64. package/dist/types/components/Card/components/CardInput/CardInput.d.ts +1 -0
  65. package/dist/types/components/Card/components/CardInput/components/types.d.ts +1 -1
  66. package/dist/types/components/Card/components/CardInput/defaultProps.d.ts +1 -0
  67. package/dist/types/components/Card/components/CardInput/layouts.d.ts +9 -0
  68. package/dist/types/components/Card/components/CardInput/types.d.ts +40 -1
  69. package/dist/types/components/Card/components/CardInput/utils.d.ts +4 -0
  70. package/dist/types/components/Card/types.d.ts +2 -2
  71. package/dist/types/components/Dropin/Dropin.d.ts +5 -1
  72. package/dist/types/components/Dropin/components/DropinComponent.d.ts +3 -2
  73. package/dist/types/components/Dropin/types.d.ts +7 -3
  74. package/dist/types/components/PayPal/types.d.ts +5 -0
  75. package/dist/types/components/ThreeDS2/callSubmit3DS2Fingerprint.d.ts +2 -1
  76. package/dist/types/components/ThreeDS2/types.d.ts +18 -0
  77. package/dist/types/components/UIElement.d.ts +10 -11
  78. package/dist/types/components/internal/Address/Specifications.d.ts +7 -1
  79. package/dist/types/components/internal/Address/types.d.ts +5 -6
  80. package/dist/types/components/internal/FormFields/Field/Field.d.ts +2 -1
  81. package/dist/types/components/internal/FormFields/Field/types.d.ts +1 -0
  82. package/dist/types/components/internal/FormFields/Select/Select.d.ts +1 -1
  83. package/dist/types/components/internal/FormFields/Select/types.d.ts +1 -0
  84. package/dist/types/components/internal/SecuredFields/SFP/SFPUtils.d.ts +19 -0
  85. package/dist/types/components/internal/SecuredFields/{SecuredFieldsProvider.d.ts → SFP/SecuredFieldsProvider.d.ts} +4 -4
  86. package/dist/types/components/internal/SecuredFields/{SecuredFieldsProviderHandlers.d.ts → SFP/SecuredFieldsProviderHandlers.d.ts} +1 -1
  87. package/dist/types/components/internal/SecuredFields/{defaultProps.d.ts → SFP/defaultProps.d.ts} +2 -2
  88. package/dist/types/components/internal/SecuredFields/lib/{core → CSF}/AbstractCSF.d.ts +8 -7
  89. package/dist/types/components/internal/SecuredFields/lib/{core → CSF}/CSF.d.ts +1 -5
  90. package/dist/types/components/internal/SecuredFields/lib/{core/utils/registerAdditionalField.d.ts → CSF/extensions/additionalFields.d.ts} +0 -0
  91. package/dist/types/components/internal/SecuredFields/lib/{configuration → CSF/extensions}/configureCallbacks.d.ts +0 -0
  92. package/dist/types/components/internal/SecuredFields/lib/{core → CSF/extensions}/createSecuredFields.d.ts +0 -0
  93. package/dist/types/components/internal/SecuredFields/lib/{core/utils → CSF/extensions}/handleBrandFromBinLookup.d.ts +1 -1
  94. package/dist/types/components/internal/SecuredFields/lib/{configuration → CSF/extensions}/handleConfig.d.ts +0 -0
  95. package/dist/types/components/internal/SecuredFields/lib/{core → CSF/extensions}/handleEncryption.d.ts +1 -1
  96. package/dist/types/components/internal/SecuredFields/lib/{core/utils/tabbing → CSF/extensions}/handleTab.d.ts +0 -0
  97. package/dist/types/components/internal/SecuredFields/lib/{core → CSF/extensions}/handleValidation.d.ts +1 -1
  98. package/dist/types/components/internal/SecuredFields/lib/CSF/index.d.ts +2 -0
  99. package/dist/types/components/internal/SecuredFields/lib/{core → CSF}/initCSF.d.ts +1 -1
  100. package/dist/types/components/internal/SecuredFields/lib/CSF/partials/handleBinValue.d.ts +11 -0
  101. package/dist/types/components/internal/SecuredFields/lib/CSF/partials/handleFocus.d.ts +15 -0
  102. package/dist/types/components/internal/SecuredFields/lib/CSF/partials/handleIframeConfigFeedback.d.ts +11 -0
  103. package/dist/types/components/internal/SecuredFields/lib/CSF/partials/isConfigured.d.ts +13 -0
  104. package/dist/types/components/internal/SecuredFields/lib/CSF/partials/postMessageToAllIframes.d.ts +13 -0
  105. package/dist/types/components/internal/SecuredFields/lib/CSF/partials/processAutoComplete.d.ts +14 -0
  106. package/dist/types/components/internal/SecuredFields/lib/CSF/partials/processBrand.d.ts +20 -0
  107. package/dist/types/components/internal/SecuredFields/lib/CSF/partials/setFocusOnFrame.d.ts +11 -0
  108. package/dist/types/components/internal/SecuredFields/lib/CSF/partials/validateForm.d.ts +10 -0
  109. package/dist/types/components/internal/SecuredFields/lib/CSF/types.d.ts +83 -0
  110. package/dist/types/components/internal/SecuredFields/lib/{core → CSF}/utils/callbackUtils.d.ts +0 -0
  111. package/dist/types/components/internal/SecuredFields/lib/{utilities → CSF/utils}/cardType.d.ts +1 -1
  112. package/dist/types/components/internal/SecuredFields/lib/{core → CSF/utils}/destroySecuredFields.d.ts +0 -0
  113. package/dist/types/components/internal/SecuredFields/lib/{ui → CSF/utils}/encryptedElements.d.ts +0 -0
  114. package/dist/types/components/internal/SecuredFields/lib/{core → CSF}/utils/getCardGroupTypes.d.ts +0 -0
  115. package/dist/types/components/internal/SecuredFields/lib/CSF/utils/iframes/getIframeContentWin.d.ts +5 -0
  116. package/dist/types/components/internal/SecuredFields/lib/{core → CSF}/utils/iframes/postMessageToIframe.d.ts +0 -0
  117. package/dist/types/components/internal/SecuredFields/lib/{core → CSF}/utils/iframes/postMessageValidation.d.ts +0 -0
  118. package/dist/types/components/internal/SecuredFields/lib/{core → CSF}/utils/processErrors.d.ts +1 -1
  119. package/dist/types/components/internal/SecuredFields/lib/{core → CSF}/utils/tabbing/tabScenarioACH.d.ts +0 -0
  120. package/dist/types/components/internal/SecuredFields/lib/{core → CSF}/utils/tabbing/tabScenarioCreditCard.d.ts +0 -0
  121. package/dist/types/components/internal/SecuredFields/lib/{core → CSF}/utils/tabbing/tabScenarioGiftCard.d.ts +0 -0
  122. package/dist/types/components/internal/SecuredFields/lib/{core → CSF}/utils/tabbing/tabScenarioKCP.d.ts +0 -0
  123. package/dist/types/components/internal/SecuredFields/lib/{ui/domUtils.d.ts → CSF/utils/tabbing/utils.d.ts} +0 -1
  124. package/dist/types/components/internal/SecuredFields/lib/{utilities → CSF/utils}/userAgent.d.ts +0 -0
  125. package/dist/types/components/internal/SecuredFields/lib/configuration/constants.d.ts +4 -3
  126. package/dist/types/components/internal/SecuredFields/lib/{core → securedField}/AbstractSecuredField.d.ts +2 -6
  127. package/dist/types/components/internal/SecuredFields/lib/{core → securedField}/SecuredField.d.ts +2 -1
  128. package/dist/types/components/internal/SecuredFields/lib/{utilities → securedField/utils}/createIframe.d.ts +0 -0
  129. package/dist/types/components/internal/SecuredFields/lib/{core/utils/init → securedField/utils}/processAriaConfig.d.ts +2 -2
  130. package/dist/types/components/internal/SecuredFields/lib/{core/utils/init → securedField/utils}/processPlaceholders.d.ts +1 -1
  131. package/dist/types/components/internal/SecuredFields/lib/types.d.ts +5 -81
  132. package/dist/types/components/internal/SecuredFields/lib/utilities/commonUtils.d.ts +6 -1
  133. package/dist/types/components/internal/SecuredFields/utils.d.ts +1 -20
  134. package/dist/types/components/internal/SocialSecurityNumberBrazil/SocialSecurityNumberBrazil.d.ts +2 -1
  135. package/dist/types/components/types.d.ts +20 -0
  136. package/dist/types/core/Context/CoreContext.d.ts +2 -0
  137. package/dist/types/core/Context/CoreProvider.d.ts +4 -0
  138. package/dist/types/core/Context/useCoreContext.d.ts +1 -0
  139. package/dist/types/core/Errors/ErrorPanel.d.ts +14 -0
  140. package/dist/types/core/ProcessResponse/PaymentMethodsResponse/PaymentMethodsResponse.d.ts +1 -0
  141. package/dist/types/core/Services/http.d.ts +5 -4
  142. package/dist/types/core/core.d.ts +9 -2
  143. package/dist/types/utils/Validator/Validator.d.ts +1 -1
  144. package/dist/types/utils/hasOwnProperty.d.ts +1 -1
  145. package/package.json +3 -3
  146. package/dist/types/components/internal/SecuredFields/lib/core/utils/handleBinValue.d.ts +0 -2
  147. package/dist/types/components/internal/SecuredFields/lib/core/utils/iframes/handleFocus.d.ts +0 -2
  148. package/dist/types/components/internal/SecuredFields/lib/core/utils/iframes/handleIframeConfigFeedback.d.ts +0 -1
  149. package/dist/types/components/internal/SecuredFields/lib/core/utils/iframes/postMessageToAllIframes.d.ts +0 -1
  150. package/dist/types/components/internal/SecuredFields/lib/core/utils/iframes/setFocusOnFrame.d.ts +0 -1
  151. package/dist/types/components/internal/SecuredFields/lib/core/utils/isConfigured.d.ts +0 -1
  152. package/dist/types/components/internal/SecuredFields/lib/core/utils/processAutoComplete.d.ts +0 -2
  153. package/dist/types/components/internal/SecuredFields/lib/core/utils/processBrand.d.ts +0 -8
  154. package/dist/types/components/internal/SecuredFields/lib/core/utils/validateForm.d.ts +0 -1
  155. package/dist/types/components/internal/SecuredFields/lib/index.d.ts +0 -2
@@ -1,2 +1,2 @@
1
- import { SFFeedbackObj } from '../types';
1
+ import { SFFeedbackObj } from '../../types';
2
2
  export declare function handleValidation(pFeedbackObj: SFFeedbackObj): void;
@@ -0,0 +1,2 @@
1
+ import csf from './initCSF';
2
+ export default csf;
@@ -1,3 +1,3 @@
1
- import { CSFReturnObject, CSFSetupObject } from '../types';
1
+ import { CSFReturnObject, CSFSetupObject } from './types';
2
2
  declare const initCSF: (pSetupObj: CSFSetupObject) => CSFReturnObject;
3
3
  export default initCSF;
@@ -0,0 +1,11 @@
1
+ import { SFFeedbackObj } from '../../types';
2
+ /**
3
+ * @param csfState - comes from initial, partial, implementation
4
+ * @param csfCallbacks - comes from initial, partial, implementation
5
+ *
6
+ * @param pFeedbackObj -
7
+ */
8
+ export declare function handleBinValue({ csfState, csfCallbacks }: {
9
+ csfState: any;
10
+ csfCallbacks: any;
11
+ }, pFeedbackObj: SFFeedbackObj): void;
@@ -0,0 +1,15 @@
1
+ import { SFFeedbackObj } from '../../types';
2
+ /**
3
+ * Call focus callback and store which field currently has focus
4
+ *
5
+ * @param csfState - comes from initial, partial, implementation
6
+ * @param csfProps - comes from initial, partial, implementation
7
+ * @param csfCallbacks - comes from initial, partial, implementation
8
+ *
9
+ * @param pFeedbackObj -
10
+ */
11
+ export declare function handleFocus({ csfState, csfProps, csfCallbacks }: {
12
+ csfState: any;
13
+ csfProps: any;
14
+ csfCallbacks: any;
15
+ }, pFeedbackObj: SFFeedbackObj): void;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * @param csfState - comes from initial, partial, implementation
3
+ * @param csfCallbacks - comes from initial, partial, implementation
4
+ * @param isConfigured - comes from initial, partial, implementation
5
+ *
6
+ * @param pFeedbackObj -
7
+ */
8
+ export declare function handleIframeConfigFeedback({ csfState, csfCallbacks }: {
9
+ csfState: any;
10
+ csfCallbacks: any;
11
+ }, isConfigured: any, pFeedbackObj: any): boolean;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * @param csfState - comes from initial, partial, implementation
3
+ * @param csfConfig - comes from initial, partial, implementation
4
+ * @param csfProps - comes from initial, partial, implementation
5
+ * @param csfCallbacks - comes from initial, partial, implementation
6
+ * @param validateForm - comes from initial, partial, implementation
7
+ */
8
+ export declare function isConfigured({ csfState, csfConfig, csfProps, csfCallbacks }: {
9
+ csfState: any;
10
+ csfConfig: any;
11
+ csfProps: any;
12
+ csfCallbacks: any;
13
+ }, validateForm: any): void;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * UTIL TO BROADCAST TO ALL IFRAMES AT ONCE
3
+ * Adds correct txVariant, fieldType and numKey for each iframe
4
+ *
5
+ * @param csfState - comes from initial, partial, implementation
6
+ * @param csfConfig - comes from initial, partial, implementation
7
+ *
8
+ * @param pDataObj -
9
+ */
10
+ export declare function postMessageToAllIframes({ csfState, csfConfig }: {
11
+ csfState: any;
12
+ csfConfig: any;
13
+ }, pDataObj: object): void;
@@ -0,0 +1,14 @@
1
+ import { SFFeedbackObj } from '../../types';
2
+ /**
3
+ *
4
+ * @param csfState - comes from initial, partial, implementation
5
+ * @param csfConfig - comes from initial, partial, implementation
6
+ * @param csfCallbacks - comes from initial, partial, implementation
7
+ *
8
+ * @param pFeedbackObj -
9
+ */
10
+ export declare function processAutoComplete({ csfState, csfConfig, csfCallbacks }: {
11
+ csfState: any;
12
+ csfConfig: any;
13
+ csfCallbacks: any;
14
+ }, pFeedbackObj: SFFeedbackObj): void;
@@ -0,0 +1,20 @@
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
+ * @param csfState - comes from initial, partial, implementation
9
+ * @param csfConfig - comes from initial, partial, implementation
10
+ * @param csfProps - comes from initial, partial, implementation
11
+ * @param csfCallbacks - comes from initial, partial, implementation
12
+ *
13
+ * @param pFeedbackObj -
14
+ */
15
+ export default function processBrand({ csfState, csfConfig, csfProps, csfCallbacks }: {
16
+ csfState: any;
17
+ csfConfig: any;
18
+ csfProps: any;
19
+ csfCallbacks: any;
20
+ }, pFeedbackObj: SFFeedbackObj): boolean;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * @param csfState - comes from initial, partial, implementation
3
+ * @param csfConfig - comes from initial, partial, implementation
4
+ *
5
+ * @param pFieldType -
6
+ * @param doLog -
7
+ */
8
+ export declare function setFocusOnFrame({ csfState, csfConfig }: {
9
+ csfState: any;
10
+ csfConfig: any;
11
+ }, pFieldType: string, doLog?: boolean): void;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @param csfState - comes from initial, partial, implementation
3
+ * @param csfProps - comes from initial, partial, implementation
4
+ * @param csfCallbacks - comes from initial, partial, implementation
5
+ */
6
+ export default function validateForm({ csfState, csfProps, csfCallbacks }: {
7
+ csfState: any;
8
+ csfProps: any;
9
+ csfCallbacks: any;
10
+ }): void;
@@ -0,0 +1,83 @@
1
+ import Language from '../../../../../language/Language';
2
+ import { BrandStorageObject } from '../types';
3
+ /**
4
+ * Exposed functions that can be called on the CSF instance
5
+ */
6
+ export interface CSFReturnObject {
7
+ updateStyles: any;
8
+ setFocusOnFrame: any;
9
+ isValidated: any;
10
+ destroy: any;
11
+ brandsFromBinLookup: any;
12
+ hasUnsupportedCard: any;
13
+ addSecuredField: any;
14
+ removeSecuredField: any;
15
+ setKCPStatus: any;
16
+ sendValueToFrame?: any;
17
+ }
18
+ /**
19
+ * Base interface for SetupObject & ConfigObject
20
+ */
21
+ interface CSFCommonProps {
22
+ loadingContext: string;
23
+ cardGroupTypes?: string[];
24
+ allowedDOMAccess?: boolean;
25
+ autoFocus?: boolean;
26
+ trimTrailingSeparator?: boolean;
27
+ showWarnings?: boolean;
28
+ keypadFix?: boolean;
29
+ isKCP?: boolean;
30
+ iframeUIConfig?: object;
31
+ legacyInputMode?: boolean;
32
+ minimumExpiryDate?: string;
33
+ implementationType?: string;
34
+ isCollatingErrors?: boolean;
35
+ }
36
+ /**
37
+ * Object sent when SecuredFieldsProvider initialises CSF
38
+ */
39
+ export interface CSFSetupObject extends CSFCommonProps {
40
+ type: string;
41
+ clientKey: string;
42
+ rootNode: string | HTMLElement;
43
+ callbacks?: object;
44
+ i18n?: Language;
45
+ }
46
+ /**
47
+ * The type for the config object created by CSF: properties that just need to be set once, at startup, and then don't change
48
+ * This object provides the source for many of the properties that are written into the SFSetupObject used to initialise a new SecuredField.ts
49
+ */
50
+ export interface CSFConfigObject extends CSFCommonProps {
51
+ iframeSrc: string;
52
+ isCreditCardType: boolean;
53
+ sfLogAtStart: boolean;
54
+ }
55
+ export interface CSFCallbacksConfig {
56
+ onLoad?: (callbackObj: object) => void;
57
+ onConfigSuccess?: (callbackObj: object) => void;
58
+ onFieldValid?: (callbackObj: object) => void;
59
+ onAllValid?: (callbackObj: object) => void;
60
+ onBrand?: (callbackObj: object) => void;
61
+ onError?: (callbackObj: object) => void;
62
+ onFocus?: (callbackObj: object) => void;
63
+ onBinValue?: (callbackObj: object) => void;
64
+ onAutoComplete?: (callbackObj: object) => void;
65
+ onAdditionalSFConfig?: (callbackObj: object) => void;
66
+ onAdditionalSFRemoved?: (callbackObj: object) => void;
67
+ }
68
+ export interface CSFStateObject {
69
+ type: string;
70
+ brand: BrandStorageObject;
71
+ allValid: boolean;
72
+ numIframes: number;
73
+ originalNumIframes: number;
74
+ iframeCount: number;
75
+ iframeConfigCount: number;
76
+ isConfigured: boolean;
77
+ hasSeparateDateFields: boolean;
78
+ currentFocusObject: string;
79
+ registerFieldForIos: boolean;
80
+ securedFields: object;
81
+ isKCP: boolean;
82
+ }
83
+ export {};
@@ -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.2";
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;