@adyen/adyen-web 5.23.1 → 5.24.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 (30) hide show
  1. package/dist/adyen.css +21 -21
  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 +21 -21
  6. package/dist/cjs/adyen.css.map +1 -1
  7. package/dist/cjs/index.js +1 -1
  8. package/dist/es/adyen.css +21 -21
  9. package/dist/es/adyen.css.map +1 -1
  10. package/dist/es/index.js +1 -1
  11. package/dist/es.modern/adyen.css +21 -21
  12. package/dist/es.modern/adyen.css.map +1 -1
  13. package/dist/es.modern/index.js +1 -1
  14. package/dist/types/components/Ach/Ach.d.ts +41 -3
  15. package/dist/types/components/Ach/components/AchInput/types.d.ts +8 -4
  16. package/dist/types/components/Ach/types.d.ts +7 -0
  17. package/dist/types/components/Card/Bancontact.d.ts +1 -0
  18. package/dist/types/components/Card/Card.d.ts +1 -0
  19. package/dist/types/components/Card/components/ClickToPay/services/sdks/AbstractSrcInitiator.d.ts +3 -3
  20. package/dist/types/components/Card/components/ClickToPay/services/sdks/MastercardSdk.d.ts +2 -2
  21. package/dist/types/components/Card/components/ClickToPay/services/sdks/SrcSdkLoader.d.ts +5 -2
  22. package/dist/types/components/Card/components/ClickToPay/services/sdks/VisaSdk.d.ts +2 -2
  23. package/dist/types/components/Card/components/ClickToPay/services/sdks/config.d.ts +9 -6
  24. package/dist/types/components/Card/components/ClickToPay/services/sdks/types.d.ts +7 -0
  25. package/dist/types/components/Card/components/ClickToPay/services/types.d.ts +1 -0
  26. package/dist/types/components/Card/components/ClickToPay/services/utils.d.ts +3 -0
  27. package/dist/types/components/Card/types.d.ts +4 -0
  28. package/dist/types/components/internal/SecuredFields/lib/configuration/constants.d.ts +1 -1
  29. package/dist/types/components/internal/SecuredFields/lib/securedField/AbstractSecuredField.d.ts +1 -0
  30. package/package.json +1 -1
@@ -1,19 +1,57 @@
1
1
  import { h } from 'preact';
2
2
  import UIElement from '../UIElement';
3
- export declare class AchElement extends UIElement {
3
+ import { AchElementProps } from './types';
4
+ export declare class AchElement extends UIElement<AchElementProps> {
4
5
  static type: string;
5
- formatProps(props: any): any;
6
+ formatProps(props: AchElementProps): {
7
+ holderNameRequired: boolean;
8
+ storedPaymentMethodId?: string;
9
+ hasHolderName?: boolean;
10
+ enableStoreDetails: boolean;
11
+ session?: import("../../core/CheckoutSession/CheckoutSession").default;
12
+ onChange?: (state: any, element: UIElement<any>) => void;
13
+ onValid?: (state: any, element: UIElement<any>) => void;
14
+ beforeSubmit?: (state: any, element: UIElement<any>, actions: any) => Promise<void>;
15
+ onSubmit?: (state: any, element: UIElement<any>) => void;
16
+ onComplete?: (state: any, element: UIElement<any>) => void;
17
+ onAdditionalDetails?: (state: any, element: UIElement<any>) => void;
18
+ onError?: (error: any, element?: UIElement<any>) => void;
19
+ onPaymentCompleted?: (result: any, element: UIElement<any>) => void;
20
+ beforeRedirect?: (resolve: any, reject: any, redirectData: any, element: UIElement<any>) => void;
21
+ isInstantPayment?: boolean;
22
+ type?: string;
23
+ name?: string;
24
+ icon?: string;
25
+ amount?: import("../../types").PaymentAmount;
26
+ secondaryAmount?: import("../../types").PaymentAmountExtended;
27
+ showPayButton?: boolean;
28
+ setStatusAutomatically?: boolean;
29
+ payButton?: (options: import("../types").PayButtonFunctionProps) => h.JSX.Element;
30
+ loadingContext?: string;
31
+ createFromAction?: (action: import("../../types").PaymentAction, props: object) => UIElement<any>;
32
+ clientKey?: string;
33
+ elementRef?: any;
34
+ i18n?: import("../../language").default;
35
+ _parentInstance?: import("../../core/core").default;
36
+ order?: import("../../types").Order;
37
+ modules?: {
38
+ analytics: import("../../core/Analytics/Analytics").default;
39
+ risk: import("../../core/RiskModule").default;
40
+ };
41
+ isDropin?: boolean;
42
+ };
6
43
  /**
7
44
  * Formats the component data output
8
45
  */
9
46
  formatData(): {
47
+ storePaymentMethod: any;
10
48
  billingAddress: any;
11
49
  paymentMethod: any;
12
50
  };
13
51
  updateStyles(stylesObj: any): this;
14
52
  setFocusOn(fieldName: any): this;
15
53
  get isValid(): boolean;
16
- get displayName(): any;
54
+ get displayName(): string;
17
55
  render(): h.JSX.Element;
18
56
  }
19
57
  export default AchElement;
@@ -1,5 +1,6 @@
1
1
  import Language from '../../../../language/Language';
2
2
  import { StylesObject } from '../../../internal/SecuredFields/lib/types';
3
+ import UIElement from "../../../UIElement";
3
4
  export interface ACHInputStateValid {
4
5
  holderName?: boolean;
5
6
  billingAddress?: boolean;
@@ -25,25 +26,28 @@ export interface ACHInputProps {
25
26
  billingAddressAllowedCountries?: string[];
26
27
  billingAddressRequired?: boolean;
27
28
  billingAddressRequiredFields?: string[];
28
- clientKey: string;
29
+ clientKey?: string;
29
30
  data?: ACHInputDataState;
31
+ enableStoreDetails: boolean;
30
32
  hasHolderName?: boolean;
31
33
  holderName?: string;
32
34
  holderNameRequired?: boolean;
33
35
  i18n?: Language;
34
36
  keypadFix?: boolean;
35
37
  legacyInputMode?: boolean;
36
- loadingContext: string;
38
+ loadingContext?: string;
37
39
  onAllValid?: () => {};
38
40
  onBlur?: (e: any) => {};
39
- onChange?: (obj: any) => {};
41
+ onChange?: (obj: any) => void;
42
+ onSubmit?: (obj: any) => void;
40
43
  onConfigSuccess?: () => {};
41
- onError?: () => {};
44
+ onError?: (error: any, element?: UIElement<any>) => void;
42
45
  onFieldValid?: () => {};
43
46
  onFocus?: (e: any) => {};
44
47
  onLoad?: () => {};
45
48
  payButton?: (obj: any) => {};
46
49
  placeholders?: Placeholders;
50
+ ref?: any;
47
51
  showPayButton?: boolean;
48
52
  showWarnings?: boolean;
49
53
  styles?: StylesObject;
@@ -0,0 +1,7 @@
1
+ import { UIElementProps } from '../types';
2
+ export interface AchElementProps extends UIElementProps {
3
+ storedPaymentMethodId?: string;
4
+ holderNameRequired?: boolean;
5
+ hasHolderName?: boolean;
6
+ enableStoreDetails: boolean;
7
+ }
@@ -52,6 +52,7 @@ declare class BancontactElement extends CardElement {
52
52
  shopperIdentityValue: any;
53
53
  locale: string;
54
54
  shopperIdentityType?: "email" | "mobilePhone";
55
+ merchantDisplayName: string;
55
56
  };
56
57
  brand?: string;
57
58
  useClickToPay: boolean;
@@ -60,6 +60,7 @@ export declare class CardElement extends UIElement<CardElementProps> {
60
60
  shopperIdentityValue: any;
61
61
  locale: string;
62
62
  shopperIdentityType?: "email" | "mobilePhone";
63
+ merchantDisplayName: string;
63
64
  };
64
65
  brand?: string;
65
66
  useClickToPay: boolean;
@@ -1,5 +1,5 @@
1
1
  import { IdentityLookupParams } from '../types';
2
- import { SrcCheckoutParams, SrciCheckoutResponse, SrciCompleteIdentityValidationResponse, SrciIdentityLookupResponse, SrciInitiateIdentityValidationResponse, SrciIsRecognizedResponse, SrcInitParams, SrcProfile } from './types';
2
+ import { CustomSdkConfiguration, SrcCheckoutParams, SrciCheckoutResponse, SrciCompleteIdentityValidationResponse, SrciIdentityLookupResponse, SrciInitiateIdentityValidationResponse, SrciIsRecognizedResponse, SrcInitParams, SrcProfile } from './types';
3
3
  import { ClickToPayScheme } from '../../../../types';
4
4
  export interface ISrcInitiator {
5
5
  schemeName: ClickToPayScheme;
@@ -17,10 +17,10 @@ export interface ISrcInitiator {
17
17
  export default abstract class AbstractSrcInitiator implements ISrcInitiator {
18
18
  schemeSdk: any;
19
19
  abstract readonly schemeName: ClickToPayScheme;
20
- protected readonly dpaLocale: string;
20
+ protected readonly customSdkConfiguration: CustomSdkConfiguration;
21
21
  private readonly sdkUrl;
22
22
  private scriptElement;
23
- protected constructor(sdkUrl: string, dpaLocale: string);
23
+ protected constructor(sdkUrl: string, customSdkConfiguration: CustomSdkConfiguration);
24
24
  loadSdkScript(): Promise<void>;
25
25
  removeSdkScript(): void;
26
26
  /**
@@ -1,9 +1,9 @@
1
1
  import { IdentityLookupParams } from '../types';
2
2
  import AbstractSrcInitiator from './AbstractSrcInitiator';
3
- import { SrciCompleteIdentityValidationResponse, SrciIdentityLookupResponse, SrcInitParams } from './types';
3
+ import { CustomSdkConfiguration, SrciCompleteIdentityValidationResponse, SrciIdentityLookupResponse, SrcInitParams } from './types';
4
4
  declare class MastercardSdk extends AbstractSrcInitiator {
5
5
  readonly schemeName = "mc";
6
- constructor(environment: string, locale: string);
6
+ constructor(environment: string, customSdkConfig: CustomSdkConfiguration);
7
7
  protected isSdkIsAvailableOnWindow(): boolean;
8
8
  protected assignSdkReference(): void;
9
9
  init(params: SrcInitParams, srciTransactionId: string): Promise<void>;
@@ -5,8 +5,11 @@ export interface ISrcSdkLoader {
5
5
  }
6
6
  declare class SrcSdkLoader implements ISrcSdkLoader {
7
7
  readonly schemes: string[];
8
- private readonly locale;
9
- constructor(schemes: string[], locale?: string);
8
+ private readonly customSdkConfiguration;
9
+ constructor(schemes: string[], { dpaLocale, dpaPresentationName }: {
10
+ dpaLocale?: string;
11
+ dpaPresentationName?: string;
12
+ });
10
13
  load(environment: string): Promise<ISrcInitiator[]>;
11
14
  }
12
15
  export default SrcSdkLoader;
@@ -1,9 +1,9 @@
1
1
  import { IdentityLookupParams } from '../types';
2
2
  import AbstractSrcInitiator from './AbstractSrcInitiator';
3
- import { SrciCompleteIdentityValidationResponse, SrciIdentityLookupResponse, SrcInitParams } from './types';
3
+ import { CustomSdkConfiguration, SrciCompleteIdentityValidationResponse, SrciIdentityLookupResponse, SrcInitParams } from './types';
4
4
  declare class VisaSdk extends AbstractSrcInitiator {
5
5
  readonly schemeName = "visa";
6
- constructor(environment: string, locale: string);
6
+ constructor(environment: string, customSdkConfig: CustomSdkConfiguration);
7
7
  protected isSdkIsAvailableOnWindow(): boolean;
8
8
  protected assignSdkReference(): void;
9
9
  init(params: SrcInitParams, srciTransactionId: string): Promise<void>;
@@ -1,18 +1,18 @@
1
+ import { CustomSdkConfiguration } from './types';
1
2
  declare const VISA_SDK_TEST = "https://sandbox-assets.secure.checkout.visa.com/checkout-widget/resources/js/src-i-adapter/visaSdk.js";
2
3
  declare const VISA_SDK_PROD = "https://assets.secure.checkout.visa.com/checkout-widget/resources/js/src-i-adapter/visaSdk.js";
3
4
  declare const MC_SDK_TEST = "https://sandbox.src.mastercard.com/sdk/srcsdk.mastercard.js";
4
5
  declare const MC_SDK_PROD = "https://src.mastercard.com/sdk/srcsdk.mastercard.js";
5
- declare const getVisaSetttings: ({ dpaLocale }: {
6
- dpaLocale?: string;
7
- }) => {
6
+ declare const getVisaSetttings: ({ dpaLocale, dpaPresentationName }: CustomSdkConfiguration) => {
8
7
  dpaTransactionOptions: {
9
8
  dpaLocale: string;
10
9
  payloadTypeIndicator: string;
11
10
  };
11
+ dpaData: {
12
+ dpaPresentationName: string;
13
+ };
12
14
  };
13
- declare const getMastercardSettings: ({ dpaLocale }: {
14
- dpaLocale?: string;
15
- }) => {
15
+ declare const getMastercardSettings: ({ dpaLocale, dpaPresentationName }: CustomSdkConfiguration) => {
16
16
  dpaTransactionOptions: {
17
17
  dpaLocale: string;
18
18
  paymentOptions: {
@@ -24,5 +24,8 @@ declare const getMastercardSettings: ({ dpaLocale }: {
24
24
  };
25
25
  confirmPayment: boolean;
26
26
  };
27
+ dpaData: {
28
+ dpaPresentationName: string;
29
+ };
27
30
  };
28
31
  export { VISA_SDK_TEST, VISA_SDK_PROD, MC_SDK_TEST, MC_SDK_PROD, getVisaSetttings, getMastercardSettings };
@@ -1,3 +1,10 @@
1
+ /**
2
+ * Type that represent the object which contains the customizable properties of the SDK initialization
3
+ */
4
+ export declare type CustomSdkConfiguration = {
5
+ dpaLocale: string;
6
+ dpaPresentationName: string;
7
+ };
1
8
  /**
2
9
  * Types used to define the interface with the SRCi SDK
3
10
  */
@@ -30,6 +30,7 @@ declare type MastercardCheckout = {
30
30
  declare type VisaCheckout = {
31
31
  srcCheckoutPayload?: string;
32
32
  srcTokenReference?: string;
33
+ srcCorrelationId: string;
33
34
  srcScheme: string;
34
35
  };
35
36
  export interface SrcProfileWithScheme extends SrcProfile {
@@ -1,6 +1,9 @@
1
1
  import { ClickToPayCheckoutPayload, SrcProfileWithScheme } from './types';
2
2
  import { SrciCheckoutResponse } from './sdks/types';
3
3
  import ShopperCard from '../models/ShopperCard';
4
+ /**
5
+ * Creates the payload for the /payments call
6
+ */
4
7
  declare function createCheckoutPayloadBasedOnScheme(card: ShopperCard, checkoutResponse: SrciCheckoutResponse, environment: string): ClickToPayCheckoutPayload;
5
8
  declare function createShopperCardsList(srcProfiles: SrcProfileWithScheme[]): ShopperCard[];
6
9
  export { createShopperCardsList, createCheckoutPayloadBasedOnScheme };
@@ -93,6 +93,10 @@ export declare type ClickToPayScheme = 'mc' | 'visa';
93
93
  export declare type ClickToPayConfiguration = {
94
94
  shopperIdentityValue: string;
95
95
  shopperIdentityType?: 'email' | 'mobilePhone';
96
+ /**
97
+ * Used to display the merchant name in case the DCF appears (ex: first time doing transaction in the device),
98
+ */
99
+ merchantDisplayName: string;
96
100
  /**
97
101
  * Used to ensure the correct language and user experience if DCF screen is displayed. As a fallback, it uses the main locale
98
102
  * defined during the creation of the Checkout.
@@ -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 = "4.2.0";
14
+ export declare const SF_VERSION = "4.2.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[];
@@ -70,6 +70,7 @@ declare abstract class AbstractSecuredField {
70
70
  protected iframeSrc: string;
71
71
  protected loadingContext: string;
72
72
  protected holderEl: HTMLElement;
73
+ protected iframeRef: HTMLElement;
73
74
  loadToConfigTimeout: number;
74
75
  protected _errorType: string;
75
76
  protected _hasError: boolean;
package/package.json CHANGED
@@ -23,7 +23,7 @@
23
23
  "./dist/adyen.css": "./dist/adyen.css",
24
24
  "./package.json": "./package.json"
25
25
  },
26
- "version": "5.23.1",
26
+ "version": "5.24.0",
27
27
  "license": "MIT",
28
28
  "homepage": "https://docs.adyen.com/checkout",
29
29
  "repository": "github:Adyen/adyen-web",