@adyen/adyen-web 5.13.0 → 5.15.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 (55) hide show
  1. package/README.md +1 -1
  2. package/dist/adyen.css +6 -6
  3. package/dist/adyen.js +1 -1
  4. package/dist/adyen.js.map +1 -1
  5. package/dist/cjs/adyen.css +6 -6
  6. package/dist/cjs/index.js +1 -1
  7. package/dist/es/adyen.css +6 -6
  8. package/dist/es/index.js +1 -1
  9. package/dist/es.modern/adyen.css +6 -6
  10. package/dist/es.modern/index.js +1 -1
  11. package/dist/types/components/Atome/config.d.ts +2 -2
  12. package/dist/types/components/BankTransfer/types.d.ts +3 -0
  13. package/dist/types/components/BcmcMobile/BcmcMobile.d.ts +1 -4
  14. package/dist/types/components/Card/Bancontact.d.ts +1 -4
  15. package/dist/types/components/Card/Card.d.ts +1 -4
  16. package/dist/types/components/Card/components/CardInput/components/CardFieldsWrapper.d.ts +3 -1
  17. package/dist/types/components/Card/components/CardInput/components/CardHolderName.d.ts +1 -1
  18. package/dist/types/components/Card/components/CardInput/components/types.d.ts +6 -0
  19. package/dist/types/components/Card/components/CardInput/defaultProps.d.ts +2 -0
  20. package/dist/types/components/Card/components/CardInput/types.d.ts +7 -1
  21. package/dist/types/components/Card/components/CardInput/utils.d.ts +9 -1
  22. package/dist/types/components/Dragonpay/Dragonpay.d.ts +1 -4
  23. package/dist/types/components/Dropin/Dropin.d.ts +1 -4
  24. package/dist/types/components/Dropin/components/DropinComponent.d.ts +5 -0
  25. package/dist/types/components/Dropin/types.d.ts +4 -1
  26. package/dist/types/components/Pix/Pix.d.ts +1 -4
  27. package/dist/types/components/Swish/Swish.d.ts +1 -4
  28. package/dist/types/components/WeChat/WeChat.d.ts +1 -4
  29. package/dist/types/components/internal/Address/Specifications.d.ts +9 -0
  30. package/dist/types/components/internal/Address/constants.d.ts +9 -0
  31. package/dist/types/components/internal/Address/types.d.ts +4 -1
  32. package/dist/types/components/internal/IFrame/Iframe.d.ts +1 -3
  33. package/dist/types/components/internal/PhoneInput/types.d.ts +4 -0
  34. package/dist/types/components/internal/SecuredFields/SFP/SecuredFieldsProvider.d.ts +2 -0
  35. package/dist/types/components/internal/SecuredFields/SFP/SecuredFieldsProviderHandlers.d.ts +2 -0
  36. package/dist/types/components/internal/SecuredFields/SFP/defaultProps.d.ts +1 -0
  37. package/dist/types/components/internal/SecuredFields/lib/CSF/AbstractCSF.d.ts +3 -1
  38. package/dist/types/components/internal/SecuredFields/lib/CSF/extensions/handleIOSTouchEvents.d.ts +39 -0
  39. package/dist/types/components/internal/SecuredFields/lib/CSF/types.d.ts +1 -0
  40. package/dist/types/components/internal/SecuredFields/lib/configuration/constants.d.ts +1 -1
  41. package/dist/types/components/internal/SecuredFields/lib/securedField/AbstractSecuredField.d.ts +1 -1
  42. package/dist/types/components/internal/SecuredFields/lib/securedField/SecuredField.d.ts +1 -1
  43. package/dist/types/components/internal/SecuredFields/lib/utilities/commonUtils.d.ts +6 -6
  44. package/dist/types/components/internal/SocialSecurityNumberBrazil/SocialSecurityNumberBrazil.d.ts +2 -1
  45. package/dist/types/components/types.d.ts +2 -4
  46. package/dist/types/core/CheckoutSession/CheckoutSession.d.ts +5 -0
  47. package/dist/types/core/Services/sessions/cancel-order.d.ts +6 -0
  48. package/dist/types/utils/Validator/ValidationRuleResult.d.ts +17 -0
  49. package/dist/types/utils/Validator/Validator.d.ts +5 -18
  50. package/dist/types/utils/Validator/types.d.ts +4 -0
  51. package/dist/types/utils/useForm/reducer.d.ts +4 -2
  52. package/dist/types/utils/useForm/types.d.ts +18 -8
  53. package/dist/types/utils/useForm/useForm.d.ts +2 -18
  54. package/package.json +3 -3
  55. package/dist/types/components/internal/SecuredFields/lib/CSF/extensions/additionalFields.d.ts +0 -9
@@ -1,6 +1,6 @@
1
- export declare const ALLOWED_COUNTRIES: string[];
1
+ export declare const ATOME_SUPPORTED_COUNTRIES: string[];
2
2
  /**
3
- * Creates Address Specification for each country that Atome supports.
3
+ * Creates Address Specification according to the Atome UI. This specification overrides all available specifications
4
4
  *
5
5
  * This custom specification is needed in order to create the desired layout of the Atome billing address part. The usage of the
6
6
  * 'default' layout specification from the Address component does not align correctly the available fields, therefore we need to
@@ -13,3 +13,6 @@ export interface BankTransferState extends UIElementProps {
13
13
  };
14
14
  isValid: boolean;
15
15
  }
16
+ export interface BankTransferSchema {
17
+ shopperEmail?: string;
18
+ }
@@ -11,10 +11,7 @@ declare class BCMCMobileElement extends QRLoaderContainer {
11
11
  qrCodeImage?: string;
12
12
  paymentData?: string;
13
13
  instructions?: string;
14
- session?: {
15
- id: string;
16
- data: string;
17
- };
14
+ session?: import("../../core/CheckoutSession/CheckoutSession").default;
18
15
  onChange?: (state: any, element: import("../UIElement").UIElement<any>) => void;
19
16
  onValid?: (state: any, element: import("../UIElement").UIElement<any>) => void;
20
17
  beforeSubmit?: (state: any, element: import("../UIElement").UIElement<any>, actions: any) => Promise<void>;
@@ -57,10 +57,7 @@ declare class BancontactElement extends CardElement {
57
57
  onFocus?: (event: import("../internal/SecuredFields/lib/types").CbObjOnFocus) => void;
58
58
  onBinValue?: (event: import("../internal/SecuredFields/lib/types").CbObjOnBinValue) => void;
59
59
  onBinLookup?: (event: import("../internal/SecuredFields/lib/types").CbObjOnBinLookup) => void;
60
- session?: {
61
- id: string;
62
- data: string;
63
- };
60
+ session?: import("../../core/CheckoutSession/CheckoutSession").default;
64
61
  onChange?: (state: any, element: import("../UIElement").UIElement<any>) => void;
65
62
  onValid?: (state: any, element: import("../UIElement").UIElement<any>) => void;
66
63
  beforeSubmit?: (state: any, element: import("../UIElement").UIElement<any>, actions: any) => Promise<void>;
@@ -52,10 +52,7 @@ export declare class CardElement extends UIElement<CardElementProps> {
52
52
  onFocus?: (event: import("../internal/SecuredFields/lib/types").CbObjOnFocus) => void;
53
53
  onBinValue?: (event: import("../internal/SecuredFields/lib/types").CbObjOnBinValue) => void;
54
54
  onBinLookup?: (event: CbObjOnBinLookup) => void;
55
- session?: {
56
- id: string;
57
- data: string;
58
- };
55
+ session?: import("../../core/CheckoutSession/CheckoutSession").default;
59
56
  onChange?: (state: any, element: UIElement<any>) => void;
60
57
  onValid?: (state: any, element: UIElement<any>) => void;
61
58
  beforeSubmit?: (state: any, element: UIElement<any>, actions: any) => Promise<void>;
@@ -1,5 +1,5 @@
1
1
  import { h } from 'preact';
2
- export declare const CardFieldsWrapper: ({ data, valid, errors, handleChangeFor, sfpState, setFocusOn, collateErrors, errorFieldId, cvcPolicy, focusedElement, hasInstallments, handleInstallments, showAmountsInInstallments, brandsIcons, 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, showBrandsUnderCardNumber }: {
2
+ export declare const CardFieldsWrapper: ({ data, valid, errors, handleChangeFor, sfpState, setFocusOn, collateErrors, errorFieldId, cvcPolicy, focusedElement, hasInstallments, handleInstallments, showAmountsInInstallments, brandsIcons, mergedSRErrors, moveFocus, showPanel, handleErrorPanelFocus, formData, formErrors, formValid, expiryDatePolicy, dualBrandSelectElements, extensions, selectedBrandValue, showKCP, showBrazilianSSN, socialSecurityNumber, handleOnStoreDetails, billingAddress, handleAddress, billingAddressRef, partialAddressSchema, amount, billingAddressRequired, billingAddressRequiredFields, billingAddressAllowedCountries, brandsConfiguration, enableStoreDetails, hasCVC, hasHolderName, holderNameRequired, installmentOptions, placeholders, positionHolderNameOnTop, showBrandIcon, showBrandsUnderCardNumber, iOSFocusedField }: {
3
3
  data: any;
4
4
  valid: any;
5
5
  errors: any;
@@ -32,6 +32,7 @@ export declare const CardFieldsWrapper: ({ data, valid, errors, handleChangeFor,
32
32
  billingAddress: any;
33
33
  handleAddress: any;
34
34
  billingAddressRef: any;
35
+ partialAddressSchema: any;
35
36
  amount: any;
36
37
  billingAddressRequired: any;
37
38
  billingAddressRequiredFields: any;
@@ -46,4 +47,5 @@ export declare const CardFieldsWrapper: ({ data, valid, errors, handleChangeFor,
46
47
  positionHolderNameOnTop: any;
47
48
  showBrandIcon: any;
48
49
  showBrandsUnderCardNumber: any;
50
+ iOSFocusedField: any;
49
51
  }) => h.JSX.Element;
@@ -1,3 +1,3 @@
1
1
  import { h } from 'preact';
2
2
  import { CardHolderNameProps } from './types';
3
- export default function CardHolderName({ onBlur, onInput, placeholder, value, required, error, isValid }: CardHolderNameProps): h.JSX.Element;
3
+ export default function CardHolderName({ onBlur, onInput, placeholder, value, required, error, isValid, disabled }: CardHolderNameProps): h.JSX.Element;
@@ -31,6 +31,7 @@ export interface CardHolderNameProps {
31
31
  placeholder?: string;
32
32
  required?: boolean;
33
33
  value?: string;
34
+ disabled?: boolean;
34
35
  }
35
36
  export interface CardNumberProps {
36
37
  brand: string;
@@ -115,6 +116,7 @@ export interface KCPProps {
115
116
  error: boolean;
116
117
  isValid: boolean;
117
118
  value: string;
119
+ disabled?: boolean;
118
120
  }
119
121
  export declare type RtnType_ParamBooleanFn = (tn: any) => boolean;
120
122
  export declare type RtnType_ParamVoidFn = (e: any) => void;
@@ -138,3 +140,7 @@ export interface SfSpanProps {
138
140
  children?: ComponentChildren;
139
141
  ['data-info']?: string;
140
142
  }
143
+ export interface TouchStartEventObj {
144
+ fieldType: string;
145
+ name?: string;
146
+ }
@@ -1,4 +1,5 @@
1
1
  import { SocialSecurityMode } from '../../types';
2
+ import { AddressModeOptions } from './types';
2
3
  declare const _default: {
3
4
  type: string;
4
5
  setComponentRef: () => void;
@@ -10,6 +11,7 @@ declare const _default: {
10
11
  showBrandsUnderCardNumber: boolean;
11
12
  positionHolderNameOnTop: boolean;
12
13
  billingAddressRequired: boolean;
14
+ billingAddressMode: AddressModeOptions;
13
15
  billingAddressRequiredFields: string[];
14
16
  installmentOptions: {};
15
17
  configuration: {
@@ -4,7 +4,7 @@ import { PaymentAmount } from '../../../../types';
4
4
  import { InstallmentOptions } from './components/types';
5
5
  import { ValidationResult } from '../../../internal/PersonalDetails/types';
6
6
  import { CVCPolicyType, DatePolicyType } from '../../../internal/SecuredFields/lib/types';
7
- import { ValidationRuleResult } from '../../../../utils/Validator/Validator';
7
+ import { ValidationRuleResult } from '../../../../utils/Validator/ValidationRuleResult';
8
8
  import Specifications from '../../../internal/Address/Specifications';
9
9
  import { AddressSchema, StringObject } from '../../../internal/Address/types';
10
10
  import { CbObjOnError, StylesObject } from '../../../internal/SecuredFields/lib/types';
@@ -49,6 +49,7 @@ export interface CardInputProps {
49
49
  billingAddressAllowedCountries?: string[];
50
50
  billingAddressRequired?: boolean;
51
51
  billingAddressRequiredFields?: string[];
52
+ billingAddressMode?: AddressModeOptions;
52
53
  brand?: string;
53
54
  brands?: string[];
54
55
  brandsConfiguration?: CardBrandsConfiguration;
@@ -163,4 +164,9 @@ export interface SortErrorsObj {
163
164
  i18n: Language;
164
165
  countrySpecificLabels: StringObject;
165
166
  }
167
+ export declare enum AddressModeOptions {
168
+ full = "full",
169
+ partial = "partial",
170
+ none = "none"
171
+ }
166
172
  export {};
@@ -1,5 +1,5 @@
1
1
  import { ErrorPanelObj } from '../../../../core/Errors/ErrorPanel';
2
- import { CardInputProps, LayoutObj, SortErrorsObj } from './types';
2
+ import { AddressModeOptions, CardInputProps, LayoutObj, SortErrorsObj } from './types';
3
3
  import { InstallmentsObj } from './components/Installments/Installments';
4
4
  import { SFPProps } from '../../../internal/SecuredFields/SFP/types';
5
5
  export declare const getCardImageUrl: (brand: string, loadingContext: string) => string;
@@ -32,3 +32,11 @@ export declare const extractPropsForCardFields: (props: CardInputProps) => {
32
32
  expiryYear: string;
33
33
  };
34
34
  export declare const extractPropsForSFP: (props: CardInputProps) => SFPProps;
35
+ export declare const handlePartialAddressMode: (addressMode: AddressModeOptions) => any[] | {
36
+ default: {
37
+ labels: {
38
+ postalCode: string;
39
+ };
40
+ schema: "postalCode"[];
41
+ };
42
+ };
@@ -21,10 +21,7 @@ export declare class DragonpayElement extends UIElement<DragonpayElementProps> {
21
21
  loadingContext?: string;
22
22
  reference?: string;
23
23
  i18n?: import("../../language").default;
24
- session?: {
25
- id: string;
26
- data: string;
27
- };
24
+ session?: import("../../core/CheckoutSession/CheckoutSession").default;
28
25
  onChange?: (state: any, element: UIElement<any>) => void;
29
26
  onValid?: (state: any, element: UIElement<any>) => void;
30
27
  beforeSubmit?: (state: any, element: UIElement<any>, actions: any) => Promise<void>;
@@ -46,10 +46,7 @@ declare class DropinElement extends UIElement<DropinElementProps> {
46
46
  onSelect?: (paymentMethod: any) => void;
47
47
  showRemovePaymentMethodButton?: boolean;
48
48
  onDisableStoredPaymentMethod?: (storedPaymentMethod: any, resolve: any, reject: any) => void;
49
- session?: {
50
- id: string;
51
- data: string;
52
- };
49
+ session?: import("../../core/CheckoutSession/CheckoutSession").default;
53
50
  onChange?: (state: any, element: UIElement<any>) => void;
54
51
  onValid?: (state: any, element: UIElement<any>) => void;
55
52
  beforeSubmit?: (state: any, element: UIElement<any>, actions: any) => Promise<void>;
@@ -12,6 +12,11 @@ export declare class DropinComponent extends Component<DropinComponentProps, Dro
12
12
  private handleOnSelectPaymentMethod;
13
13
  private handleDisableStoredPaymentMethod;
14
14
  closeActivePaymentMethod(): void;
15
+ /**
16
+ * getOnOrderCancel decides which onOrderCancel logic should be used, manual or sessions
17
+ */
18
+ private getOnOrderCancel;
19
+ private onOrderCancel;
15
20
  render(props: any, { elements, instantPaymentElements, status, activePaymentMethod, cachedPaymentMethods }: {
16
21
  elements: any;
17
22
  instantPaymentElements: any;
@@ -47,10 +47,13 @@ export interface DropinElementProps extends UIElementProps {
47
47
  */
48
48
  onDisableStoredPaymentMethod?: (storedPaymentMethod: any, resolve: any, reject: any) => void;
49
49
  }
50
+ export interface onOrderCancelData {
51
+ order: Order;
52
+ }
50
53
  export interface DropinComponentProps extends DropinElementProps {
51
54
  onCreateElements: any;
52
55
  onChange: (newState?: object) => void;
53
- onOrderCancel?: (order: Order) => void;
56
+ onOrderCancel?: (data: onOrderCancelData) => void;
54
57
  }
55
58
  interface DropinStatus {
56
59
  type: UIElementStatus;
@@ -23,10 +23,7 @@ declare class PixElement extends QRLoaderContainer<PixProps> {
23
23
  qrCodeImage?: string;
24
24
  paymentData?: string;
25
25
  instructions?: string;
26
- session?: {
27
- id: string;
28
- data: string;
29
- };
26
+ session?: import("../../core/CheckoutSession/CheckoutSession").default;
30
27
  onChange?: (state: any, element: import("../UIElement").UIElement<any>) => void;
31
28
  onValid?: (state: any, element: import("../UIElement").UIElement<any>) => void;
32
29
  beforeSubmit?: (state: any, element: import("../UIElement").UIElement<any>, actions: any) => Promise<void>;
@@ -11,10 +11,7 @@ declare class SwishElement extends QRLoaderContainer {
11
11
  qrCodeImage?: string;
12
12
  paymentData?: string;
13
13
  instructions: string;
14
- session?: {
15
- id: string;
16
- data: string;
17
- };
14
+ session?: import("../../core/CheckoutSession/CheckoutSession").default;
18
15
  onChange?: (state: any, element: import("../UIElement").UIElement<any>) => void;
19
16
  onValid?: (state: any, element: import("../UIElement").UIElement<any>) => void;
20
17
  beforeSubmit?: (state: any, element: import("../UIElement").UIElement<any>, actions: any) => Promise<void>;
@@ -11,10 +11,7 @@ declare class WeChatPayElement extends QRLoaderContainer {
11
11
  qrCodeImage?: string;
12
12
  paymentData?: string;
13
13
  instructions?: string;
14
- session?: {
15
- id: string;
16
- data: string;
17
- };
14
+ session?: import("../../core/CheckoutSession/CheckoutSession").default;
18
15
  onChange?: (state: any, element: import("../UIElement").UIElement<any>) => void;
19
16
  onValid?: (state: any, element: import("../UIElement").UIElement<any>) => void;
20
17
  beforeSubmit?: (state: any, element: import("../UIElement").UIElement<any>, actions: any) => Promise<void>;
@@ -1,4 +1,5 @@
1
1
  import { AddressSchema, StringObject } from './types';
2
+ import { AddressField } from '../../../types';
2
3
  declare class Specifications {
3
4
  private specifications;
4
5
  constructor(specifications?: any);
@@ -45,5 +46,13 @@ declare class Specifications {
45
46
  * @param country - The selected country
46
47
  */
47
48
  getPlaceholderKeyForField(fieldName: string, country: string): string;
49
+ /**
50
+ * Returns an array with the address schema of the selected country or the default address schema
51
+ * Flat version of getAddressSchemaForCountry
52
+ * @param country - The selected country
53
+ * @param mode - Address schema mode, can be 'full', 'partial' or 'none'
54
+ * @returns Array
55
+ */
56
+ getAddressSchemaForCountryFlat(country: string): AddressField[];
48
57
  }
49
58
  export default Specifications;
@@ -3,3 +3,12 @@ export declare const FALLBACK_VALUE = "N/A";
3
3
  export declare const ADDRESS_SCHEMA: readonly ["street", "houseNumberOrName", "postalCode", "city", "stateOrProvince", "country"];
4
4
  export declare const STREET: "street", HOUSE_NUMBER_OR_NAME: "houseNumberOrName", POSTAL_CODE: "postalCode", CITY: "city", STATE_OR_PROVINCE: "stateOrProvince", COUNTRY: "country";
5
5
  export declare const ADDRESS_SPECIFICATIONS: AddressSpecifications;
6
+ export declare const PARTIAL_ADDRESS_SCHEMA: {
7
+ default: {
8
+ labels: {
9
+ postalCode: string;
10
+ };
11
+ schema: "postalCode"[];
12
+ };
13
+ };
14
+ export declare const COUNTRIES_WITH_CUSTOM_SPECIFICATION: string[];
@@ -1,7 +1,7 @@
1
1
  import { AddressField, AddressData } from '../../../types';
2
2
  import Specifications from './Specifications';
3
3
  import { ValidatorRules } from '../../../utils/Validator/types';
4
- import { ValidationRuleResult } from '../../../utils/Validator/Validator';
4
+ import { ValidationRuleResult } from '../../../utils/Validator/ValidationRuleResult';
5
5
  export declare type StringObject = {
6
6
  [key: string]: string;
7
7
  };
@@ -16,6 +16,8 @@ export interface AddressProps {
16
16
  specifications?: AddressSpecifications;
17
17
  validationRules?: ValidatorRules;
18
18
  visibility?: string;
19
+ overrideSchema?: AddressSpecifications;
20
+ iOSFocusedField?: string;
19
21
  }
20
22
  export interface AddressStateError {
21
23
  street?: ValidationRuleResult;
@@ -40,6 +42,7 @@ export interface FieldContainerProps {
40
42
  specifications: Specifications;
41
43
  maxlength?: number;
42
44
  trimOnBlur?: boolean;
45
+ disabled?: boolean;
43
46
  }
44
47
  export interface ReadOnlyAddressProps {
45
48
  data: AddressData;
@@ -17,7 +17,6 @@ declare class Iframe extends Component<IframeProps> {
17
17
  height: string;
18
18
  minWidth: string;
19
19
  minHeight: string;
20
- border: string;
21
20
  src: any;
22
21
  allow: any;
23
22
  title: string;
@@ -26,14 +25,13 @@ declare class Iframe extends Component<IframeProps> {
26
25
  iframeOnLoad(): void;
27
26
  componentDidMount(): void;
28
27
  componentWillUnmount(): void;
29
- render({ name, src, width, height, minWidth, minHeight, border, allow, title }: {
28
+ render({ name, src, width, height, minWidth, minHeight, allow, title }: {
30
29
  name: any;
31
30
  src: any;
32
31
  width: any;
33
32
  height: any;
34
33
  minWidth: any;
35
34
  minHeight: any;
36
- border: any;
37
35
  allow: any;
38
36
  title: any;
39
37
  }): h.JSX.Element;
@@ -27,3 +27,7 @@ export interface PhoneInputState {
27
27
  };
28
28
  isValid?: boolean;
29
29
  }
30
+ export interface PhoneInputSchema {
31
+ phoneNumber?: string;
32
+ phonePrefix?: string;
33
+ }
@@ -22,6 +22,7 @@ declare class SecuredFieldsProvider extends Component<SFPProps, SFPState> {
22
22
  private handleOnError;
23
23
  private handleOnAutoComplete;
24
24
  private handleOnNoDataRequired;
25
+ private handleOnTouchstartIOS;
25
26
  state: SFPState;
26
27
  props: any;
27
28
  private issuingCountryCode;
@@ -46,6 +47,7 @@ declare class SecuredFieldsProvider extends Component<SFPProps, SFPState> {
46
47
  onBinValue: () => void;
47
48
  onFocus: () => void;
48
49
  onAutoComplete: () => void;
50
+ onTouchstartIOS: () => any;
49
51
  styles: {};
50
52
  };
51
53
  componentDidMount(): void;
@@ -28,6 +28,7 @@ declare function handleOnBrand(cardInfo: CbObjOnBrand): void;
28
28
  */
29
29
  declare function handleOnError(cbObj: CbObjOnError, hasUnsupportedCard?: boolean): boolean;
30
30
  declare function handleFocus(cbObj: CbObjOnFocus): void;
31
+ declare function handleOnTouchstartIOS(cbObj: any): void;
31
32
  declare function handleOnAutoComplete(cbObj: CbObjOnAutoComplete): void;
32
33
  /**
33
34
  * Handles cases where no secured fields are necessary (one click payments without CVC)
@@ -44,5 +45,6 @@ declare const _default: {
44
45
  handleOnBrand: typeof handleOnBrand;
45
46
  handleOnError: typeof handleOnError;
46
47
  handleOnNoDataRequired: typeof handleOnNoDataRequired;
48
+ handleOnTouchstartIOS: typeof handleOnTouchstartIOS;
47
49
  };
48
50
  export default _default;
@@ -18,6 +18,7 @@ declare const _default: {
18
18
  onBinValue: () => void;
19
19
  onFocus: () => void;
20
20
  onAutoComplete: () => void;
21
+ onTouchstartIOS: () => any;
21
22
  styles: {};
22
23
  };
23
24
  export default _default;
@@ -16,8 +16,9 @@ declare abstract class AbstractCSF {
16
16
  protected createNonCardSecuredFields: (securedFields: HTMLElement[]) => number;
17
17
  protected createSecuredFields: typeof createSecuredFields;
18
18
  protected destroySecuredFields: () => void;
19
+ protected handleIOSTouchEvents: () => void;
19
20
  protected destroyTouchendListener: () => void;
20
- protected handleAdditionalFields: () => void;
21
+ protected destroyTouchstartListener: () => void;
21
22
  protected handleBinValue: (pFeedbackObj: SFFeedbackObj) => void;
22
23
  protected handleEncryption: (pFeedbackObj: SFFeedbackObj) => void;
23
24
  protected handleFocus: (pFeedbackObj: SFFeedbackObj) => void;
@@ -34,6 +35,7 @@ declare abstract class AbstractCSF {
34
35
  protected setFocusOnFrame: (pFieldType: string, doLog?: boolean) => void;
35
36
  protected setupSecuredField: (pItem: HTMLElement) => void;
36
37
  protected touchendListener: (e: Event) => void;
38
+ protected touchstartListener: () => void;
37
39
  protected encryptedAttrName: string;
38
40
  protected hasRedundantCVCField: boolean;
39
41
  protected isSingleBrandedCard: boolean;
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Detect if touched element is an input or textArea.
3
+ * - If it is do some quirky shit to set focus and caret position on this element
4
+ * - Else do some quirky shit to make the iOS keyboard retract
5
+ *
6
+ * Always then remove this listener and set var saying we have done so (read in CSF...handleFocus)
7
+ * Tell all securedFields some other element now has focus so they can blur themselves
8
+ *
9
+ * @param e -
10
+ */
11
+ declare function touchendListener(e: Event): void;
12
+ /**
13
+ * re. Disabling arrow keys in iOS - need to enable all fields in the form and tell SFs to disable
14
+ *
15
+ * NOTE: Only called when iOS detected
16
+ */
17
+ declare function touchstartListener(e: Event): void;
18
+ /**
19
+ * This works with the touchend handler to allow us to catch (click) events on non-securedFields elements
20
+ * (re. http://gravitydept.com/blog/js-click-event-bubbling-on-ios - events don't bubble unless the click takes place on a link or input)
21
+ *
22
+ * We can use this event to:
23
+ * 1. Set focus on these other elements, and
24
+ * 2. Tell SecuredFields that this has happened so they can blur themselves
25
+ * (see note in adyen-secured-fields...inputBase.js - "Blur event never fires on input field")
26
+ *
27
+ * NOTE: Only called when iOS detected
28
+ */
29
+ declare function handleTouchend(): void;
30
+ declare function destroyTouchendListener(): void;
31
+ declare function destroyTouchstartListener(): void;
32
+ declare const _default: {
33
+ touchendListener: typeof touchendListener;
34
+ touchstartListener: typeof touchstartListener;
35
+ handleTouchend: typeof handleTouchend;
36
+ destroyTouchendListener: typeof destroyTouchendListener;
37
+ destroyTouchstartListener: typeof destroyTouchstartListener;
38
+ };
39
+ export default _default;
@@ -65,6 +65,7 @@ export interface CSFCallbacksConfig {
65
65
  onAutoComplete?: (callbackObj: object) => void;
66
66
  onAdditionalSFConfig?: (callbackObj: object) => void;
67
67
  onAdditionalSFRemoved?: (callbackObj: object) => void;
68
+ onTouchstartIOS?: (callbackObj: object) => void;
68
69
  }
69
70
  export interface CSFStateObject {
70
71
  type: string;
@@ -11,7 +11,7 @@ export declare const ENCRYPTED_BANK_LOCATION_FIELD = "encryptedBankLocationId";
11
11
  export declare const ENCRYPTED_SECURITY_CODE_3_DIGITS = "encryptedSecurityCode3digits";
12
12
  export declare const ENCRYPTED_SECURITY_CODE_4_DIGITS = "encryptedSecurityCode4digits";
13
13
  export declare const GIFT_CARD = "giftcard";
14
- export declare const SF_VERSION = "3.9.0";
14
+ export declare const SF_VERSION = "3.10.1";
15
15
  export declare const DEFAULT_CARD_GROUP_TYPES: string[];
16
16
  export declare const NON_CREDIT_CARD_TYPE_SECURED_FIELDS: string[];
17
17
  export declare const CREDIT_CARD_SF_FIELDS: string[];
@@ -86,7 +86,7 @@ declare abstract class AbstractSecuredField {
86
86
  protected onValidationCallback: RtnType_callbackFn;
87
87
  protected onFocusCallback: RtnType_callbackFn;
88
88
  protected onBinValueCallback: RtnType_callbackFn;
89
- protected onClickCallback: RtnType_callbackFn;
89
+ protected onTouchstartCallback: RtnType_callbackFn;
90
90
  protected onShiftTabCallback: RtnType_callbackFn;
91
91
  protected onAutoCompleteCallback: RtnType_callbackFn;
92
92
  protected constructor();
@@ -17,7 +17,7 @@ declare class SecuredField extends AbstractSecuredField {
17
17
  onConfig(callbackFn: RtnType_callbackFn): SecuredField;
18
18
  onFocus(callbackFn: RtnType_callbackFn): SecuredField;
19
19
  onBinValue(callbackFn: RtnType_callbackFn): SecuredField;
20
- onClick(callbackFn: RtnType_callbackFn): SecuredField;
20
+ onTouchstart(callbackFn: RtnType_callbackFn): SecuredField;
21
21
  onShiftTab(callbackFn: RtnType_callbackFn): SecuredField;
22
22
  onAutoComplete(callbackFn: RtnType_callbackFn): SecuredField;
23
23
  get errorType(): string;
@@ -3,11 +3,11 @@
3
3
  *
4
4
  * @returns Number
5
5
  */
6
- declare function generateRandomNumber(): number;
6
+ export declare function generateRandomNumber(): number;
7
7
  /**
8
8
  * Recursively compare 2 objects
9
9
  */
10
- declare function objectsDeepEqual(x: any, y: any): any;
10
+ export declare function objectsDeepEqual(x: any, y: any): any;
11
11
  /**
12
12
  * Returns true if x is:
13
13
  * null, undefined, false, 0, NaN, empty object or array, empty string
@@ -30,15 +30,15 @@ declare function objectsDeepEqual(x: any, y: any): any;
30
30
  * falsy(true) // => false
31
31
  * ```
32
32
  */
33
- declare function falsy(x: any): boolean;
33
+ export declare function falsy(x: any): boolean;
34
34
  /**
35
35
  * Inverse of falsy - returns true if x is NOT null, undefined, false, 0, NaN, empty object or array, empty string
36
36
  * @param x -
37
37
  */
38
- declare function notFalsy(x: any): boolean;
38
+ export declare function notFalsy(x: any): boolean;
39
39
  /**
40
40
  * This function allows us to partially apply any number of variables to functions that take any number of parameters.
41
41
  * @returns \{function(): *\}
42
42
  */
43
- declare function partial(...args: any[]): (...args2: any[]) => any;
44
- export { generateRandomNumber, existy, falsy, isArray, objectsDeepEqual, notFalsy, partial, truthy };
43
+ export declare function partial(...args: any[]): (...args2: any[]) => any;
44
+ export declare const isEmpty: (input: any) => boolean;
@@ -1,9 +1,10 @@
1
1
  import { h } from 'preact';
2
- export default function ({ onBlur, onInput, valid, error, data, required }: {
2
+ export default function ({ onBlur, onInput, valid, error, data, required, disabled }: {
3
3
  onBlur: any;
4
4
  onInput: any;
5
5
  valid?: boolean;
6
6
  error?: any;
7
7
  data?: string;
8
8
  required?: boolean;
9
+ disabled?: boolean;
9
10
  }): h.JSX.Element;
@@ -3,6 +3,7 @@ import UIElement from './UIElement';
3
3
  import Core from '../core';
4
4
  import Analytics from '../core/Analytics';
5
5
  import RiskElement from '../core/RiskModule';
6
+ import Session from "../core/CheckoutSession";
6
7
  export interface PaymentResponse {
7
8
  action?: PaymentAction;
8
9
  resultCode: string;
@@ -38,10 +39,7 @@ export interface IUIElement {
38
39
  }
39
40
  export declare type UIElementStatus = 'ready' | 'loading' | 'error' | 'success';
40
41
  export interface UIElementProps extends BaseElementProps {
41
- session?: {
42
- id: string;
43
- data: string;
44
- };
42
+ session?: Session;
45
43
  onChange?: (state: any, element: UIElement) => void;
46
44
  onValid?: (state: any, element: UIElement) => void;
47
45
  beforeSubmit?: (state: any, element: UIElement, actions: any) => Promise<void>;
@@ -1,4 +1,5 @@
1
1
  import { CheckoutSession, CheckoutSessionBalanceResponse, CheckoutSessionDetailsResponse, CheckoutSessionOrdersResponse, CheckoutSessionPaymentResponse, CheckoutSessionSetupResponse } from '../../types';
2
+ import { onOrderCancelData } from "../../components/Dropin/types";
2
3
  declare class Session {
3
4
  private readonly session;
4
5
  private readonly storage;
@@ -31,6 +32,10 @@ declare class Session {
31
32
  * Creates an order for the current session
32
33
  */
33
34
  createOrder(): Promise<CheckoutSessionOrdersResponse>;
35
+ /**
36
+ * Cancels an order for the current session
37
+ */
38
+ cancelOrder(data: onOrderCancelData): Promise<CheckoutSessionOrdersResponse>;
34
39
  /**
35
40
  * Gets the stored session but only if the current id and the stored id match
36
41
  */
@@ -0,0 +1,6 @@
1
+ import Session from '../../CheckoutSession';
2
+ import { CheckoutSessionOrdersResponse, Order } from '../../../types';
3
+ /**
4
+ */
5
+ declare function cancelOrder(order: Order, session: Session): Promise<CheckoutSessionOrdersResponse>;
6
+ export default cancelOrder;
@@ -0,0 +1,17 @@
1
+ import { ErrorMessageObject } from './types';
2
+ /**
3
+ * Holds the result of a validation
4
+ */
5
+ export declare class ValidationRuleResult {
6
+ private readonly shouldValidate;
7
+ isValid: boolean;
8
+ errorMessage: string | ErrorMessageObject;
9
+ constructor(rule: any, value: any, mode: any, context: any);
10
+ /**
11
+ * Whether the validation is considered an error.
12
+ * A field is only considered to be an error if the validation rule applies to the current mode i.e. 'blur' or 'input'.
13
+ * Also, if a validation function returns a null value e.g. when the field is empty, then the field will not be considered to be in error
14
+ * unless the whole form is being validated
15
+ */
16
+ hasError(isValidatingForm?: boolean): boolean;
17
+ }