@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,9 +1,9 @@
1
1
  import { h } from 'preact';
2
2
  import './AchInput.scss';
3
- declare function AchInput(props: any): h.JSX.Element;
3
+ import { ACHInputProps } from './types';
4
+ declare function AchInput(props: ACHInputProps): h.JSX.Element;
4
5
  declare namespace AchInput {
5
6
  var defaultProps: {
6
- details: any[];
7
7
  type: string;
8
8
  hasHolderName: boolean;
9
9
  holderNameRequired: boolean;
@@ -13,9 +13,7 @@ declare namespace AchInput {
13
13
  onConfigSuccess: () => void;
14
14
  onAllValid: () => void;
15
15
  onFieldValid: () => void;
16
- onBrand: () => void;
17
16
  onError: () => void;
18
- onBinValue: () => void;
19
17
  onBlur: () => void;
20
18
  onFocus: () => void;
21
19
  onChange: () => void;
@@ -1,5 +1,4 @@
1
1
  declare const _default: {
2
- details: any[];
3
2
  type: string;
4
3
  hasHolderName: boolean;
5
4
  holderNameRequired: boolean;
@@ -9,9 +8,7 @@ declare const _default: {
9
8
  onConfigSuccess: () => void;
10
9
  onAllValid: () => void;
11
10
  onFieldValid: () => void;
12
- onBrand: () => void;
13
11
  onError: () => void;
14
- onBinValue: () => void;
15
12
  onBlur: () => void;
16
13
  onFocus: () => void;
17
14
  onChange: () => void;
@@ -1,3 +1,5 @@
1
+ import Language from '../../../../language/Language';
2
+ import { StylesObject } from '../../../internal/SecuredFields/lib/types';
1
3
  export interface ACHInputStateValid {
2
4
  holderName?: boolean;
3
5
  billingAddress?: boolean;
@@ -10,3 +12,41 @@ export interface ACHInputStateError {
10
12
  encryptedBankAccountNumber?: boolean;
11
13
  encryptedBankLocationId?: boolean;
12
14
  }
15
+ export interface ACHInputDataState {
16
+ holderName?: string;
17
+ billingAddress?: object;
18
+ }
19
+ declare type Placeholders = {
20
+ holderName?: string;
21
+ };
22
+ export interface ACHInputProps {
23
+ allowedDOMAccess?: boolean;
24
+ autoFocus?: boolean;
25
+ billingAddressAllowedCountries?: string[];
26
+ billingAddressRequired?: boolean;
27
+ billingAddressRequiredFields?: string[];
28
+ clientKey: string;
29
+ data?: ACHInputDataState;
30
+ hasHolderName?: boolean;
31
+ holderName?: string;
32
+ holderNameRequired?: boolean;
33
+ i18n?: Language;
34
+ keypadFix?: boolean;
35
+ legacyInputMode?: boolean;
36
+ loadingContext: string;
37
+ onAllValid?: () => {};
38
+ onBlur?: (e: any) => {};
39
+ onChange?: (obj: any) => {};
40
+ onConfigSuccess?: () => {};
41
+ onError?: () => {};
42
+ onFieldValid?: () => {};
43
+ onFocus?: (e: any) => {};
44
+ onLoad?: () => {};
45
+ payButton?: (obj: any) => {};
46
+ placeholders?: Placeholders;
47
+ showPayButton?: boolean;
48
+ showWarnings?: boolean;
49
+ styles?: StylesObject;
50
+ type?: string;
51
+ }
52
+ export {};
@@ -5,6 +5,7 @@ declare class BancontactElement extends CardElement {
5
5
  protected static defaultProps: {
6
6
  brands: string[];
7
7
  onBinLookup: () => void;
8
+ SRConfig: {};
8
9
  };
9
10
  /**
10
11
  * Now that the Bancontact (BCMC) Card component can accept a number dual branded with Visa (which requires a CVC) it has to be handled differently
@@ -14,7 +15,10 @@ declare class BancontactElement extends CardElement {
14
15
  */
15
16
  formatProps(props: CardElementProps): {
16
17
  type: string;
17
- cvcPolicy: import("../internal/SecuredFields/lib/core/AbstractSecuredField").CVCPolicyType;
18
+ cvcPolicy: import("../internal/SecuredFields/lib/types").CVCPolicyType;
19
+ holderNameRequired: boolean;
20
+ hasCVC: boolean;
21
+ billingAddressRequired: any;
18
22
  countryCode: any;
19
23
  configuration: {
20
24
  socialSecurityNumberMode: import("./types").SocialSecurityMode;
@@ -24,10 +28,11 @@ declare class BancontactElement extends CardElement {
24
28
  };
25
29
  brandsConfiguration: import("./types").CardBrandsConfiguration;
26
30
  icon: string;
27
- groupTypes: string[];
28
- holderNameRequired: boolean;
29
- hasCVC: boolean;
30
- billingAddressRequired: any;
31
+ SRConfig: {
32
+ collateErrors: any;
33
+ moveFocus: any;
34
+ showPanel: any;
35
+ };
31
36
  brand?: string;
32
37
  brands?: string[];
33
38
  enableStoreDetails?: boolean;
@@ -6,8 +6,13 @@ export declare class CardElement extends UIElement<CardElementProps> {
6
6
  static type: string;
7
7
  protected static defaultProps: {
8
8
  onBinLookup: () => void;
9
+ SRConfig: {};
9
10
  };
11
+ setComponentRef: (ref: any) => void;
10
12
  formatProps(props: CardElementProps): {
13
+ holderNameRequired: boolean;
14
+ hasCVC: boolean;
15
+ billingAddressRequired: any;
11
16
  type: string;
12
17
  countryCode: any;
13
18
  configuration: {
@@ -18,10 +23,11 @@ export declare class CardElement extends UIElement<CardElementProps> {
18
23
  };
19
24
  brandsConfiguration: import("./types").CardBrandsConfiguration;
20
25
  icon: string;
21
- groupTypes: string[];
22
- holderNameRequired: boolean;
23
- hasCVC: boolean;
24
- billingAddressRequired: any;
26
+ SRConfig: {
27
+ collateErrors: any;
28
+ moveFocus: any;
29
+ showPanel: any;
30
+ };
25
31
  brand?: string;
26
32
  brands?: string[];
27
33
  enableStoreDetails?: boolean;
@@ -1,42 +1,5 @@
1
- import { h } from 'preact';
1
+ import { FunctionalComponent } from 'preact';
2
2
  import './CardInput.scss';
3
3
  import { CardInputProps } from './types';
4
- declare function CardInput(props: CardInputProps): h.JSX.Element;
5
- declare namespace CardInput {
6
- var defaultProps: {
7
- details: any[];
8
- type: string;
9
- hasHolderName: boolean;
10
- holderNameRequired: boolean;
11
- enableStoreDetails: boolean;
12
- hideCVC: boolean;
13
- hasCVC: boolean;
14
- hasStoreDetails: boolean;
15
- storedDetails: any;
16
- showBrandIcon: boolean;
17
- positionHolderNameOnTop: boolean;
18
- billingAddressRequired: boolean;
19
- billingAddressRequiredFields: string[];
20
- installmentOptions: {};
21
- configuration: {
22
- koreanAuthenticationRequired: boolean;
23
- socialSecurityNumberMode: import("../../types").SocialSecurityMode;
24
- };
25
- onLoad: () => any;
26
- onConfigSuccess: () => any;
27
- onAllValid: () => any;
28
- onFieldValid: () => any;
29
- onBrand: () => any;
30
- onError: () => any;
31
- onBinValue: () => any;
32
- onBlur: () => any;
33
- onFocus: () => any;
34
- onChange: () => any;
35
- data: {
36
- billingAddress: {};
37
- };
38
- styles: {};
39
- placeholders: {};
40
- };
41
- }
4
+ declare const CardInput: FunctionalComponent<CardInputProps>;
42
5
  export default CardInput;
@@ -0,0 +1,47 @@
1
+ import { h } from 'preact';
2
+ export declare const CardFieldsWrapper: ({ data, valid, errors, handleChangeFor, sfpState, setFocusOn, collateErrors, errorFieldId, cvcPolicy, focusedElement, hasInstallments, handleInstallments, showAmountsInInstallments, mergedSRErrors, moveFocus, showPanel, handleErrorPanelFocus, formData, formErrors, formValid, expiryDatePolicy, dualBrandSelectElements, extensions, selectedBrandValue, showKCP, showBrazilianSSN, socialSecurityNumber, handleOnStoreDetails, billingAddress, handleAddress, billingAddressRef, amount, billingAddressRequired, billingAddressRequiredFields, billingAddressAllowedCountries, brandsConfiguration, enableStoreDetails, hasCVC, hasHolderName, holderNameRequired, installmentOptions, placeholders, positionHolderNameOnTop, showBrandIcon }: {
3
+ data: any;
4
+ valid: any;
5
+ errors: any;
6
+ handleChangeFor: any;
7
+ sfpState: any;
8
+ setFocusOn: any;
9
+ collateErrors: any;
10
+ errorFieldId: any;
11
+ cvcPolicy: any;
12
+ focusedElement: any;
13
+ hasInstallments: any;
14
+ handleInstallments: any;
15
+ showAmountsInInstallments: any;
16
+ mergedSRErrors: any;
17
+ moveFocus: any;
18
+ showPanel: any;
19
+ handleErrorPanelFocus: any;
20
+ formData: any;
21
+ formErrors: any;
22
+ formValid: any;
23
+ expiryDatePolicy: any;
24
+ dualBrandSelectElements: any;
25
+ extensions: any;
26
+ selectedBrandValue: any;
27
+ showKCP: any;
28
+ showBrazilianSSN: any;
29
+ socialSecurityNumber: any;
30
+ handleOnStoreDetails: any;
31
+ billingAddress: any;
32
+ handleAddress: any;
33
+ billingAddressRef: any;
34
+ amount: any;
35
+ billingAddressRequired: any;
36
+ billingAddressRequiredFields: any;
37
+ billingAddressAllowedCountries: any;
38
+ brandsConfiguration: any;
39
+ enableStoreDetails: any;
40
+ hasCVC: any;
41
+ hasHolderName: any;
42
+ holderNameRequired: any;
43
+ installmentOptions: any;
44
+ placeholders: any;
45
+ positionHolderNameOnTop: any;
46
+ showBrandIcon: any;
47
+ }) => h.JSX.Element;
@@ -1,5 +1,9 @@
1
1
  import { h } from 'preact';
2
2
  import { InstallmentsProps } from '../types';
3
+ export interface InstallmentsObj {
4
+ value: number;
5
+ plan?: 'revolving';
6
+ }
3
7
  /**
4
8
  * Installments generic dropdown
5
9
  */
@@ -1,3 +1,3 @@
1
1
  import { h } from 'preact';
2
2
  import { StoredCardFieldsProps } from './types';
3
- export default function StoredCardFields({ brand, hasCVC, onFocusField, errors, valid, ...props }: StoredCardFieldsProps): h.JSX.Element;
3
+ export default function StoredCardFields({ brand, hasCVC, onFocusField, errors, valid, cvcPolicy, focusedElement, lastFour, expiryMonth, expiryYear }: StoredCardFieldsProps): h.JSX.Element;
@@ -0,0 +1,16 @@
1
+ import { h } from 'preact';
2
+ export declare const StoredCardFieldsWrapper: ({ sfpState, setFocusOn, cvcPolicy, focusedElement, hasInstallments, handleInstallments, showAmountsInInstallments, amount, hasCVC, installmentOptions, lastFour, expiryMonth, expiryYear }: {
3
+ sfpState: any;
4
+ setFocusOn: any;
5
+ cvcPolicy: any;
6
+ focusedElement: any;
7
+ hasInstallments: any;
8
+ handleInstallments: any;
9
+ showAmountsInInstallments: any;
10
+ amount: any;
11
+ hasCVC: any;
12
+ installmentOptions: any;
13
+ lastFour: any;
14
+ expiryMonth: any;
15
+ expiryYear: any;
16
+ }) => h.JSX.Element;
@@ -1,7 +1,7 @@
1
1
  import { PaymentAmount } from '../../../../../types';
2
2
  import { CardBrandsConfiguration } from '../../../types';
3
3
  import { ComponentChildren } from 'preact';
4
- import { CVCPolicyType, DatePolicyType } from '../../../../internal/SecuredFields/lib/core/AbstractSecuredField';
4
+ import { CVCPolicyType, DatePolicyType } from '../../../../internal/SecuredFields/lib/types';
5
5
  export interface BrandIconProps {
6
6
  brand: string;
7
7
  brandsConfiguration: CardBrandsConfiguration;
@@ -1,14 +1,11 @@
1
1
  import { SocialSecurityMode } from '../../types';
2
2
  declare const _default: {
3
- details: any[];
4
3
  type: string;
4
+ setComponentRef: () => void;
5
5
  hasHolderName: boolean;
6
6
  holderNameRequired: boolean;
7
7
  enableStoreDetails: boolean;
8
- hideCVC: boolean;
9
8
  hasCVC: boolean;
10
- hasStoreDetails: boolean;
11
- storedDetails: any;
12
9
  showBrandIcon: boolean;
13
10
  positionHolderNameOnTop: boolean;
14
11
  billingAddressRequired: boolean;
@@ -33,5 +30,6 @@ declare const _default: {
33
30
  };
34
31
  styles: {};
35
32
  placeholders: {};
33
+ SRConfig: {};
36
34
  };
37
35
  export default _default;
@@ -0,0 +1,8 @@
1
+ import { ErrorPanelObj } from '../../../../core/Errors/ErrorPanel';
2
+ import { CbObjOnFocus } from '../../../internal/SecuredFields/lib/types';
3
+ /**
4
+ * Return a function that can act as a callback for the ErrorPanel
5
+ */
6
+ export declare const getErrorPanelHandler: (isValidating: any, sfp: any, handleFocus: (e: CbObjOnFocus) => void) => (errors: ErrorPanelObj) => void;
7
+ export declare const getAddressHandler: (setFormData: any, setFormValid: any, setFormErrors: any) => (address: any) => void;
8
+ export declare const getFocusHandler: (setFocusedElement: any, onFocus: any, onBlur: any) => (e: CbObjOnFocus) => void;
@@ -0,0 +1,9 @@
1
+ export declare const CREDIT_CARD: string[];
2
+ export declare const CREDIT_CARD_NAME_TOP: string[];
3
+ export declare const CREDIT_CARD_NAME_BOTTOM: string[];
4
+ export declare const KCP_CARD: string[];
5
+ export declare const KCP_CARD_NAME_TOP: string[];
6
+ export declare const KCP_CARD_NAME_BOTTOM: string[];
7
+ export declare const SSN_CARD: string[];
8
+ export declare const SSN_CARD_NAME_TOP: string[];
9
+ export declare const SSN_CARD_NAME_BOTTOM: string[];
@@ -1,9 +1,13 @@
1
1
  import Language from '../../../../language/Language';
2
- import { CardBrandsConfiguration, CardConfiguration, DualBrandSelectElement, SocialSecurityMode } from '../../types';
2
+ import { BinLookupResponse, CardBrandsConfiguration, CardConfiguration, DualBrandSelectElement } from '../../types';
3
3
  import { PaymentAmount } from '../../../../types';
4
4
  import { InstallmentOptions } from './components/types';
5
5
  import { ValidationResult } from '../../../internal/PersonalDetails/types';
6
- import { CVCPolicyType, DatePolicyType } from '../../../internal/SecuredFields/lib/core/AbstractSecuredField';
6
+ import { CVCPolicyType, DatePolicyType } from '../../../internal/SecuredFields/lib/types';
7
+ import { ValidationRuleResult } from '../../../../utils/Validator/Validator';
8
+ import Specifications from '../../../internal/Address/Specifications';
9
+ import { AddressSchema, StringObject } from '../../../internal/Address/types';
10
+ import { CbObjOnError, StylesObject } from '../../../internal/SecuredFields/lib/types';
7
11
  export interface CardInputValidState {
8
12
  holderName?: boolean;
9
13
  billingAddress?: boolean;
@@ -31,46 +35,71 @@ export interface CardInputDataState {
31
35
  socialSecurityNumber?: string;
32
36
  taxNumber?: string;
33
37
  }
34
- interface Placeholders {
38
+ declare type Placeholders = {
35
39
  holderName?: string;
36
- }
40
+ };
41
+ /**
42
+ * Should be the subset of the props sent to CardInput that are *actually* used by CardInput
43
+ * - either in the comp itself or are passed on to its children
44
+ */
37
45
  export interface CardInputProps {
38
46
  amount?: PaymentAmount;
47
+ allowedDOMAccess?: boolean;
48
+ autoFocus?: boolean;
39
49
  billingAddressAllowedCountries?: string[];
40
50
  billingAddressRequired?: boolean;
41
51
  billingAddressRequiredFields?: string[];
42
52
  brand?: string;
53
+ brands?: string[];
43
54
  brandsConfiguration?: CardBrandsConfiguration;
55
+ clientKey: string;
44
56
  configuration?: CardConfiguration;
45
57
  countryCode?: string;
46
58
  cvcPolicy?: CVCPolicyType;
47
59
  data?: CardInputDataState;
48
60
  enableStoreDetails?: boolean;
61
+ expiryMonth?: string;
62
+ expiryYear?: string;
49
63
  fundingSource?: string;
50
64
  hasCVC?: boolean;
51
65
  hasHolderName?: boolean;
52
- holderName?: string;
53
66
  holderNameRequired?: boolean;
54
67
  i18n?: Language;
68
+ implementationType?: string;
69
+ isCollatingErrors?: boolean;
55
70
  installmentOptions?: InstallmentOptions;
56
- socialSecurityNumberMode?: SocialSecurityMode;
57
- loadingContext?: string;
71
+ keypadFix?: boolean;
72
+ lastFour?: string;
73
+ loadingContext: string;
74
+ legacyInputMode?: boolean;
75
+ minimumExpiryDate?: string;
76
+ onAdditionalSFConfig?: () => {};
77
+ onAdditionalSFRemoved?: () => {};
78
+ onAllValid?: () => {};
79
+ onAutoComplete?: () => {};
80
+ onBinValue?: () => {};
58
81
  onBlur?: (e: any) => {};
82
+ onBrand?: () => {};
83
+ onConfigSuccess?: () => {};
84
+ onChange?: (state: any) => {};
85
+ onError?: () => {};
86
+ onFieldValid?: () => {};
59
87
  onFocus?: (e: any) => {};
88
+ onLoad?: () => {};
60
89
  payButton?: (obj: any) => {};
61
90
  placeholders?: Placeholders;
62
91
  positionHolderNameOnTop?: boolean;
92
+ setComponentRef?: (ref: any) => void;
93
+ showBrandIcon?: boolean;
63
94
  showInstallmentAmounts?: boolean;
64
95
  showPayButton?: boolean;
96
+ showWarnings?: boolean;
97
+ specifications?: Specifications;
98
+ SRConfig?: ScreenreaderConfig;
65
99
  storedPaymentMethodId?: string;
66
- styles?: object;
100
+ styles?: StylesObject;
101
+ trimTrailingSeparator?: boolean;
67
102
  type?: string;
68
- onChange?: (state: any) => {};
69
- onSubmit?: () => {};
70
- onBrand?: () => {};
71
- onBinValue?: () => {};
72
- details?: object;
73
- storedDetails?: object;
74
103
  }
75
104
  export interface CardInputState {
76
105
  dualBrandSelectElements: DualBrandSelectElement[];
@@ -88,4 +117,47 @@ export interface CardInputState {
88
117
  issuingCountryCode: string;
89
118
  showSocialSecurityNumber?: boolean;
90
119
  }
120
+ export interface CardInputRef {
121
+ sfp?: any;
122
+ setFocusOn?: (who: any) => void;
123
+ showValidation?: (who: any) => void;
124
+ processBinLookupResponse?: (binLookupResponse: BinLookupResponse, isReset: boolean) => void;
125
+ setStatus?: any;
126
+ updateStyles?: (stylesObj: StylesObject) => void;
127
+ handleUnsupportedCard?: (errObj: CbObjOnError) => boolean;
128
+ }
129
+ interface ScreenreaderConfig {
130
+ collateErrors?: boolean;
131
+ moveFocus?: boolean;
132
+ showPanel?: boolean;
133
+ }
134
+ interface FieldError {
135
+ errorMessage?: string;
136
+ errorI18n?: string;
137
+ }
138
+ export interface ErrorObj {
139
+ holderName?: ValidationRuleResult;
140
+ socialSecurityNumber?: ValidationRuleResult;
141
+ taxNumber?: ValidationRuleResult;
142
+ billingAddress?: ValidationRuleResult;
143
+ encryptedCardNumber?: FieldError;
144
+ encryptedExpiryDate?: FieldError;
145
+ encryptedSecurityCode?: FieldError;
146
+ encryptedBankAccountNumber?: FieldError;
147
+ encryptedBankLocationId?: FieldError;
148
+ encryptedPassword?: FieldError;
149
+ encryptedPin?: FieldError;
150
+ }
151
+ export interface LayoutObj {
152
+ props: CardInputProps;
153
+ showKCP: boolean;
154
+ showBrazilianSSN: boolean;
155
+ countrySpecificSchemas: AddressSchema;
156
+ }
157
+ export interface SortErrorsObj {
158
+ errors: ErrorObj;
159
+ layout: string[];
160
+ i18n: Language;
161
+ countrySpecificLabels: StringObject;
162
+ }
91
163
  export {};
@@ -1 +1,51 @@
1
+ import { ErrorPanelObj } from '../../../../core/Errors/ErrorPanel';
2
+ import Language from '../../../../language/Language';
3
+ import { CardInputProps, LayoutObj, SortErrorsObj } from './types';
1
4
  export declare const getCardImageUrl: (brand: string, loadingContext: string) => string;
5
+ export declare const getLayout: ({ props, showKCP, showBrazilianSSN, countrySpecificSchemas }: LayoutObj) => string[];
6
+ export declare const sortErrorsForPanel: ({ errors, layout, i18n, countrySpecificLabels }: SortErrorsObj) => ErrorPanelObj;
7
+ export declare const extractPropsForCardFields: (props: CardInputProps) => {
8
+ amount: import("../../../../types").PaymentAmount;
9
+ billingAddressRequired: boolean;
10
+ billingAddressRequiredFields: string[];
11
+ billingAddressAllowedCountries: string[];
12
+ brandsConfiguration: import("../../types").CardBrandsConfiguration;
13
+ enableStoreDetails: boolean;
14
+ hasCVC: boolean;
15
+ hasHolderName: boolean;
16
+ holderNameRequired: boolean;
17
+ installmentOptions: import("./components/types").InstallmentOptions;
18
+ placeholders: {
19
+ holderName?: string;
20
+ };
21
+ positionHolderNameOnTop: boolean;
22
+ showBrandIcon: boolean;
23
+ lastFour: string;
24
+ expiryMonth: string;
25
+ expiryYear: string;
26
+ };
27
+ export declare const extractPropsForSFP: (props: CardInputProps) => {
28
+ allowedDOMAccess: boolean;
29
+ autoFocus: boolean;
30
+ brands: string[];
31
+ brandsConfiguration: import("../../types").CardBrandsConfiguration;
32
+ clientKey: string;
33
+ countryCode: string;
34
+ i18n: Language;
35
+ implementationType: string;
36
+ keypadFix: boolean;
37
+ legacyInputMode: boolean;
38
+ loadingContext: string;
39
+ minimumExpiryDate: string;
40
+ onAdditionalSFConfig: () => {};
41
+ onAdditionalSFRemoved: () => {};
42
+ onAllValid: () => {};
43
+ onAutoComplete: () => {};
44
+ onBinValue: () => {};
45
+ onConfigSuccess: () => {};
46
+ onError: () => {};
47
+ onFieldValid: () => {};
48
+ onLoad: () => {};
49
+ showWarnings: boolean;
50
+ trimTrailingSeparator: boolean;
51
+ };
@@ -1,7 +1,7 @@
1
1
  import { UIElementProps } from '../types';
2
2
  import { AddressData, BrowserInfo } from '../../types';
3
3
  import { CbObjOnBinValue, CbObjOnBrand, CbObjOnConfigSuccess, CbObjOnError, CbObjOnFieldValid, CbObjOnFocus, CbObjOnLoad, CbObjOnBinLookup } from '../internal/SecuredFields/lib/types';
4
- import { CVCPolicyType, DatePolicyType } from '../internal/SecuredFields/lib/core/AbstractSecuredField';
4
+ import { CVCPolicyType, DatePolicyType } from '../internal/SecuredFields/lib/types';
5
5
  export interface CardElementProps extends UIElementProps {
6
6
  /**
7
7
  * Only set for a stored card,
@@ -17,8 +17,6 @@ export interface CardElementProps extends UIElementProps {
17
17
  * except for a single branded card when it will be the same as the brand prop
18
18
  */
19
19
  type?: string;
20
- /** @deprecated use brands instead */
21
- groupTypes?: string[];
22
20
  /** List of brands accepted by the component */
23
21
  brands?: string[];
24
22
  /** Show/hide the "store details" checkbox */
@@ -108,7 +106,7 @@ export interface BrandObject {
108
106
  brand: string;
109
107
  cvcPolicy: CVCPolicyType;
110
108
  enableLuhnCheck: boolean;
111
- showExpiryDate: boolean;
109
+ showExpiryDate?: boolean;
112
110
  expiryDatePolicy?: DatePolicyType;
113
111
  showSocialSecurityNumber?: boolean;
114
112
  supported: boolean;
@@ -25,6 +25,10 @@ declare class DropinElement extends UIElement<DropinElementProps> {
25
25
  showPayButton: boolean;
26
26
  };
27
27
  dropinRef: any;
28
+ /**
29
+ * Reference to the component created from `handleAction` (Ex.: ThreeDS2Challenge)
30
+ */
31
+ componentFromAction?: UIElement;
28
32
  constructor(props: any);
29
33
  formatProps(props: any): {
30
34
  instantPaymentTypes: InstantPaymentTypes[];
@@ -87,7 +91,7 @@ declare class DropinElement extends UIElement<DropinElementProps> {
87
91
  * Creates the Drop-in elements
88
92
  */
89
93
  private handleCreate;
90
- handleAction(action: PaymentAction, props?: {}): any;
94
+ handleAction(action: PaymentAction, props?: {}): this | null;
91
95
  closeActivePaymentMethod(): void;
92
96
  render(): h.JSX.Element;
93
97
  }
@@ -1,11 +1,12 @@
1
1
  import { Component } from 'preact';
2
- import { DropinComponentProps, DropinComponentState } from '../types';
2
+ import { DropinComponentProps, DropinComponentState, DropinStatusProps } from '../types';
3
3
  import './DropinComponent.scss';
4
+ import { UIElementStatus } from '../../types';
4
5
  export declare class DropinComponent extends Component<DropinComponentProps, DropinComponentState> {
5
6
  state: DropinComponentState;
6
7
  componentDidMount(): void;
7
8
  prepareDropinData: () => void;
8
- private setStatus;
9
+ setStatus: (status: UIElementStatus, props?: DropinStatusProps) => void;
9
10
  private setActivePaymentMethod;
10
11
  componentDidUpdate(prevProps: any, prevState: any): void;
11
12
  private handleOnSelectPaymentMethod;
@@ -1,6 +1,6 @@
1
1
  import { PaymentMethod, StoredPaymentMethod, Order, OrderStatus } from '../../types';
2
2
  import UIElement from '../UIElement';
3
- import { UIElementProps } from '../types';
3
+ import { UIElementProps, UIElementStatus } from '../types';
4
4
  import { PaymentMethodsConfiguration } from '../../core/types';
5
5
  export declare type InstantPaymentTypes = 'paywithgoogle' | 'applepay';
6
6
  export interface DropinElementProps extends UIElementProps {
@@ -27,7 +27,7 @@ export interface DropinElementProps extends UIElementProps {
27
27
  *
28
28
  * @defaultValue []
29
29
  */
30
- instantPaymentTypes: InstantPaymentTypes[];
30
+ instantPaymentTypes?: InstantPaymentTypes[];
31
31
  openFirstStoredPaymentMethod?: boolean;
32
32
  openFirstPaymentMethod?: boolean;
33
33
  onSubmit?: (data: any, component: any) => void;
@@ -53,7 +53,11 @@ export interface DropinComponentProps extends DropinElementProps {
53
53
  onOrderCancel?: (order: Order) => void;
54
54
  }
55
55
  interface DropinStatus {
56
- type: 'loading' | 'ready' | 'success' | 'error';
56
+ type: UIElementStatus;
57
+ props?: DropinStatusProps;
58
+ }
59
+ export interface DropinStatusProps {
60
+ component?: UIElement;
57
61
  }
58
62
  export interface DropinComponentState {
59
63
  elements: any[];
@@ -1,8 +1,38 @@
1
1
  import { h } from 'preact';
2
2
  import Language from '../../../language/Language';
3
+ import { CardBrandsConfiguration } from '../../Card/types';
4
+ import { StylesObject } from '../../internal/SecuredFields/lib/types';
3
5
  interface SecuredFieldsProps {
4
- onChange: (data: any) => void;
6
+ allowedDOMAccess?: boolean;
7
+ autoFocus?: boolean;
8
+ brands?: string[];
9
+ brandsConfiguration?: CardBrandsConfiguration;
10
+ clientKey?: string;
11
+ countryCode?: string;
5
12
  i18n: Language;
13
+ implementationType?: string;
14
+ isCollatingErrors?: boolean;
15
+ keypadFix?: boolean;
16
+ loadingContext?: string;
17
+ legacyInputMode?: boolean;
18
+ minimumExpiryDate?: string;
19
+ onAdditionalSFConfig?: () => {};
20
+ onAdditionalSFRemoved?: () => {};
21
+ onAllValid?: () => {};
22
+ onAutoComplete?: () => {};
23
+ onBinValue?: () => {};
24
+ onBrand?: () => {};
25
+ onConfigSuccess?: () => {};
26
+ onChange: (data: any) => void;
27
+ onError?: () => {};
28
+ onFieldValid?: () => {};
29
+ onFocus?: (e: any) => {};
30
+ onLoad?: () => {};
31
+ rootNode: HTMLElement;
32
+ showWarnings?: boolean;
33
+ styles?: StylesObject;
34
+ trimTrailingSeparator?: boolean;
35
+ type: string;
6
36
  }
7
37
  declare function SecuredFieldsInput(props: SecuredFieldsProps): h.JSX.Element;
8
38
  declare namespace SecuredFieldsInput {