@adyen/adyen-web 5.38.0 → 5.39.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 (33) hide show
  1. package/dist/adyen.css +1 -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 +1 -1
  6. package/dist/cjs/adyen.css.map +1 -1
  7. package/dist/cjs/index.js +1 -1
  8. package/dist/es/adyen.css +1 -1
  9. package/dist/es/adyen.css.map +1 -1
  10. package/dist/es/index.js +1 -1
  11. package/dist/es.modern/adyen.css +1 -1
  12. package/dist/es.modern/adyen.css.map +1 -1
  13. package/dist/es.modern/index.js +1 -1
  14. package/dist/types/components/ApplePay/ApplePay.d.ts +1 -1
  15. package/dist/types/components/ApplePay/ApplePayService.d.ts +5 -2
  16. package/dist/types/components/ApplePay/payment-request.d.ts +1 -6
  17. package/dist/types/components/ApplePay/types.d.ts +16 -3
  18. package/dist/types/components/Card/components/CardInput/components/CVCHint.d.ts +1 -1
  19. package/dist/types/components/Card/components/CardInput/components/types.d.ts +1 -0
  20. package/dist/types/components/Card/components/ClickToPay/models/ShopperCard.d.ts +4 -4
  21. package/dist/types/components/Card/components/ClickToPay/services/sdks/config.d.ts +1 -1
  22. package/dist/types/components/PayByBank/PayByBank.spec.d.ts +1 -0
  23. package/dist/types/components/PayPal/types.d.ts +5 -0
  24. package/dist/types/components/helpers/IssuerListContainer.d.ts +1 -0
  25. package/dist/types/components/internal/QRLoader/QRLoader.d.ts +1 -1
  26. package/dist/types/components/internal/QRLoader/types.d.ts +1 -0
  27. package/dist/types/components/internal/SecuredFields/lib/configuration/constants.d.ts +11 -0
  28. package/dist/types/core/ProcessResponse/PaymentMethodsResponse/PaymentMethodsResponse.d.ts +3 -3
  29. package/dist/types/core/ProcessResponse/PaymentMethodsResponse/types.d.ts +2 -4
  30. package/dist/types/core/ProcessResponse/PaymentMethodsResponse/utils.d.ts +3 -2
  31. package/dist/types/core/types.d.ts +2 -2
  32. package/dist/types/types/index.d.ts +1 -0
  33. package/package.json +6 -6
@@ -45,7 +45,7 @@ declare class ApplePayElement extends UIElement<ApplePayElementProps> {
45
45
  * Formats the component data output
46
46
  */
47
47
  protected formatData(): ApplePayElementData;
48
- submit(): Promise<void>;
48
+ submit(): Promise<void | {}>;
49
49
  private startSession;
50
50
  private validateMerchant;
51
51
  /**
@@ -3,6 +3,7 @@ import { OnAuthorizedCallback } from './types';
3
3
  interface ApplePayServiceOptions {
4
4
  version: number;
5
5
  onValidateMerchant: (resolve: any, reject: any, url: any) => void;
6
+ onError: (error?: unknown) => void;
6
7
  onCancel?: (event: ApplePayJS.Event) => void;
7
8
  onPaymentMethodSelected?: (resolve: any, reject: any, event: ApplePayJS.ApplePayPaymentMethodSelectedEvent) => void;
8
9
  onShippingMethodSelected?: (resolve: any, reject: any, event: ApplePayJS.ApplePayShippingMethodSelectedEvent) => void;
@@ -11,6 +12,7 @@ interface ApplePayServiceOptions {
11
12
  }
12
13
  declare class ApplePayService {
13
14
  private session;
15
+ private readonly options;
14
16
  constructor(paymentRequest: ApplePayJS.ApplePayPaymentRequest, options: ApplePayServiceOptions);
15
17
  /**
16
18
  * Begins the merchant validation process.
@@ -25,7 +27,7 @@ declare class ApplePayService {
25
27
  * @param onValidateMerchant - A promise implemented by the merchant that will resolve with the merchantSession
26
28
  * @see {@link https://developer.apple.com/documentation/apple_pay_on_the_web/apple_pay_js_api/providing_merchant_validation}
27
29
  */
28
- onvalidatemerchant(event: ApplePayJS.ApplePayValidateMerchantEvent, onValidateMerchant: any): void;
30
+ onvalidatemerchant(event: ApplePayJS.ApplePayValidateMerchantEvent, onValidateMerchant: any): Promise<void>;
29
31
  /**
30
32
  * An event handler that is called when the user has authorized the Apple Pay payment with Touch ID, Face ID, or passcode.
31
33
  * The onpaymentauthorized function must complete the payment and respond by calling completePayment before the 30 second timeout.
@@ -38,6 +40,7 @@ declare class ApplePayService {
38
40
  /**
39
41
  * An event handler that is called when a new payment method is selected.
40
42
  * The onpaymentmethodselected function must resolve before the 30 second timeout
43
+ *
41
44
  * @param event - The event parameter contains the payment (ApplePayPayment) attribute.
42
45
  * @param onPaymentMethodSelected - A promise that will complete the payment when resolved. Use this promise to process the payment.
43
46
  * @see {@link https://developer.apple.com/documentation/apple_pay_on_the_web/applepaysession/1778013-onpaymentmethodselected}
@@ -66,6 +69,6 @@ declare class ApplePayService {
66
69
  * @param onCancel -
67
70
  * @see {@link https://developer.apple.com/documentation/apple_pay_on_the_web/applepaysession/1778029-oncancel}
68
71
  */
69
- oncancel(event: ApplePayJS.Event, onCancel: any): any;
72
+ oncancel(event: ApplePayJS.Event, onCancel: any): void;
70
73
  }
71
74
  export default ApplePayService;
@@ -1,8 +1,3 @@
1
1
  /// <reference types="applepayjs" />
2
- export declare const preparePaymentRequest: ({ countryCode, companyName, amount, ...props }: {
3
- [x: string]: any;
4
- countryCode: any;
5
- companyName: any;
6
- amount: any;
7
- }) => ApplePayJS.ApplePayPaymentRequest;
2
+ export declare const preparePaymentRequest: (paymentRequest: any) => ApplePayJS.ApplePayPaymentRequest;
8
3
  export default preparePaymentRequest;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="applepayjs" />
2
- import { PaymentAmount } from '../../types';
3
2
  import { UIElementProps } from '../types';
4
3
  declare global {
5
4
  interface Window {
@@ -16,7 +15,6 @@ export interface ApplePayElementProps extends UIElementProps {
16
15
  * @see {@link https://developer.apple.com/documentation/apple_pay_on_the_web/apple_pay_on_the_web_version_history Apple Pay on the Web Version History}
17
16
  */
18
17
  version?: number;
19
- amount: PaymentAmount;
20
18
  /**
21
19
  * The merchant’s two-letter ISO 3166 country code.
22
20
  */
@@ -30,7 +28,10 @@ export interface ApplePayElementProps extends UIElementProps {
30
28
  * @default 'final'
31
29
  */
32
30
  totalPriceStatus?: ApplePayJS.ApplePayLineItemType;
33
- configuration: {
31
+ /**
32
+ * ApplePay configuration sent by the /paymentMethods response
33
+ */
34
+ configuration?: {
34
35
  merchantName?: string;
35
36
  merchantId?: string;
36
37
  };
@@ -62,6 +63,18 @@ export interface ApplePayElementProps extends UIElementProps {
62
63
  * The payment networks supported by the merchant.
63
64
  */
64
65
  supportedNetworks?: string[];
66
+ /**
67
+ * ApplePayRecurringPaymentRequest - Represents a request to set up a recurring payment, typically a subscription.
68
+ * {@link https://developer.apple.com/documentation/apple_pay_on_the_web/applepayrecurringpaymentrequest}
69
+ */
70
+ recurringPaymentRequest?: {
71
+ paymentDescription: string;
72
+ regularBilling: ApplePayJS.ApplePayLineItem;
73
+ trialBilling?: ApplePayJS.ApplePayLineItem;
74
+ billingAgreement?: string;
75
+ managementURL: string;
76
+ tokenNotificationURL?: string;
77
+ };
65
78
  /**
66
79
  * The billing information that you require from the user in order to process the transaction.
67
80
  */
@@ -1,3 +1,3 @@
1
1
  import { h } from 'preact';
2
2
  import { CVCHintProps } from './types';
3
- export default function CVCHint({ frontCVC }: CVCHintProps): h.JSX.Element;
3
+ export default function CVCHint({ frontCVC, fieldLabel }: CVCHintProps): h.JSX.Element;
@@ -60,6 +60,7 @@ export interface CVCProps {
60
60
  onFocusField: (field: string) => void;
61
61
  }
62
62
  export interface CVCHintProps {
63
+ fieldLabel: string;
63
64
  frontCVC: boolean;
64
65
  }
65
66
  export interface DualBrandingIconProps {
@@ -9,10 +9,10 @@ declare class ShopperCard {
9
9
  srcCorrelationId: string;
10
10
  tokenId?: string;
11
11
  isExpired: boolean;
12
- private panExpirationMonth;
13
- private panExpirationYear;
14
- private descriptorName?;
15
- private status?;
12
+ private readonly panExpirationMonth;
13
+ private readonly panExpirationYear;
14
+ private readonly descriptorName?;
15
+ private readonly status?;
16
16
  constructor(maskedCard: SrcCard, scheme: ClickToPayScheme, srcCorrelationId: string);
17
17
  get title(): string;
18
18
  get isDcfPopupEmbedded(): boolean;
@@ -8,7 +8,7 @@ declare const getVisaSetttings: ({ dpaLocale, dpaPresentationName }: CustomSdkCo
8
8
  dpaLocale: string;
9
9
  payloadTypeIndicator: string;
10
10
  customInputData: {
11
- checkoutOrchestator: string;
11
+ checkoutOrchestrator: string;
12
12
  };
13
13
  };
14
14
  dpaData: {
@@ -63,6 +63,11 @@ interface PayPalCommonProps {
63
63
  * @defaultValue false
64
64
  */
65
65
  blockPayPalPayLaterButton?: boolean;
66
+ /**
67
+ * Set to true to force the UI to load Paypal Messages Component
68
+ * @defaultValue false
69
+ */
70
+ enableMessages?: boolean;
66
71
  /**
67
72
  * @see {@link https://developer.paypal.com/docs/business/javascript-sdk/javascript-sdk-configuration/#csp-nonce}
68
73
  */
@@ -27,6 +27,7 @@ declare class IssuerListContainer extends UIElement<IssuerListContainerProps> {
27
27
  highlightedIssuers: any[];
28
28
  loadingContext: string;
29
29
  showPaymentMethodItemImages: boolean;
30
+ showPayButton: boolean;
30
31
  };
31
32
  formatProps(props: any): any;
32
33
  /**
@@ -24,7 +24,7 @@ declare class QRLoader extends Component<QRLoaderProps, QRLoaderState> {
24
24
  private onComplete;
25
25
  private onError;
26
26
  private checkStatus;
27
- render({ amount, url, brandLogo, countdownTime, type, onActionHandled }: QRLoaderProps, { expired, completed, loading }: {
27
+ render({ amount, url, brandLogo, brandName, countdownTime, type, onActionHandled }: QRLoaderProps, { expired, completed, loading }: {
28
28
  expired: any;
29
29
  completed: any;
30
30
  loading: any;
@@ -19,6 +19,7 @@ export interface QRLoaderProps {
19
19
  i18n?: Language;
20
20
  classNameModifiers?: string[];
21
21
  brandLogo?: string;
22
+ brandName?: string;
22
23
  introduction?: string;
23
24
  instructions?: string;
24
25
  copyBtn?: boolean;
@@ -31,3 +31,14 @@ export declare const DATA_ENCRYPTED_FIELD_ATTR = "data-cse";
31
31
  export declare const DATA_INFO = "data-info";
32
32
  export declare const DATA_UID = "data-uid";
33
33
  export declare const BRAND_ICON_UI_EXCLUSION_LIST: string[];
34
+ export declare const BRAND_READABLE_NAME_MAP: {
35
+ visa: string;
36
+ mc: string;
37
+ amex: string;
38
+ discover: string;
39
+ cup: string;
40
+ jcb: string;
41
+ diners: string;
42
+ maestro: string;
43
+ bcmc: string;
44
+ };
@@ -1,8 +1,8 @@
1
- import { PaymentMethod } from '../../../types';
1
+ import { PaymentMethod, StoredPaymentMethod } from '../../../types';
2
2
  declare class PaymentMethodsResponse {
3
3
  paymentMethods: PaymentMethod[];
4
- storedPaymentMethods: PaymentMethod[];
5
- constructor(response: any, options?: {});
4
+ storedPaymentMethods: StoredPaymentMethod[];
5
+ constructor(response: PaymentMethodsResponse, options?: {});
6
6
  private mapCreatedComponentType;
7
7
  has(paymentMethod: string): boolean;
8
8
  find(paymentMethod: string): PaymentMethod;
@@ -1,13 +1,11 @@
1
1
  import { PaymentMethod, StoredPaymentMethod } from '../../../types';
2
- export interface PaymentMethodsResponseObject {
2
+ export interface PaymentMethodsResponse {
3
3
  /**
4
4
  * Detailed list of payment methods required to generate payment forms.
5
5
  */
6
- paymentMethods: PaymentMethod[];
6
+ paymentMethods?: PaymentMethod[];
7
7
  /**
8
8
  * List of all stored payment methods.
9
9
  */
10
10
  storedPaymentMethods?: StoredPaymentMethod[];
11
- groups?: any;
12
- oneClickPaymentMethods?: any;
13
11
  }
@@ -1,4 +1,5 @@
1
1
  import { PaymentMethod, StoredPaymentMethod } from '../../../types';
2
+ import { PaymentMethodsResponse } from './types';
2
3
  export declare const processPaymentMethods: (paymentMethods: PaymentMethod[], { allowPaymentMethods, removePaymentMethods }: {
3
4
  allowPaymentMethods?: any[];
4
5
  removePaymentMethods?: any[];
@@ -6,5 +7,5 @@ export declare const processPaymentMethods: (paymentMethods: PaymentMethod[], {
6
7
  export declare const processStoredPaymentMethods: (storedPaymentMethods: StoredPaymentMethod[], { allowPaymentMethods, removePaymentMethods }: {
7
8
  allowPaymentMethods?: any[];
8
9
  removePaymentMethods?: any[];
9
- }) => PaymentMethod[];
10
- export declare const checkPaymentMethodsResponse: (response: any) => void;
10
+ }) => StoredPaymentMethod[];
11
+ export declare const checkPaymentMethodsResponse: (paymentMethodsResponse: PaymentMethodsResponse) => void;
@@ -1,7 +1,7 @@
1
1
  import { CustomTranslations, Locales } from '../language/types';
2
2
  import { PaymentMethods, PaymentMethodOptions, PaymentActionsType, PaymentAmountExtended, Order } from '../types';
3
3
  import { AnalyticsOptions } from './Analytics/types';
4
- import { PaymentMethodsResponseObject } from './ProcessResponse/PaymentMethodsResponse/types';
4
+ import { PaymentMethodsResponse } from './ProcessResponse/PaymentMethodsResponse/types';
5
5
  import { RiskModuleOptions } from './RiskModule/RiskModule';
6
6
  export interface CoreOptions {
7
7
  session?: any;
@@ -28,7 +28,7 @@ export interface CoreOptions {
28
28
  /**
29
29
  * The full `/paymentMethods` response
30
30
  */
31
- paymentMethodsResponse?: PaymentMethodsResponseObject;
31
+ paymentMethodsResponse?: PaymentMethodsResponse;
32
32
  /**
33
33
  * Amount of the payment
34
34
  */
@@ -114,6 +114,7 @@ export interface StoredPaymentMethod extends PaymentMethod {
114
114
  supportedShopperInteractions: string[];
115
115
  /**
116
116
  * A unique identifier of this stored payment method.
117
+ * Mapped from 'storedPaymentMethod.id'
117
118
  */
118
119
  storedPaymentMethodId?: string;
119
120
  }
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.38.0",
26
+ "version": "5.39.0",
27
27
  "license": "MIT",
28
28
  "homepage": "https://docs.adyen.com/checkout",
29
29
  "repository": "github:Adyen/adyen-web",
@@ -68,10 +68,10 @@
68
68
  "@testing-library/preact-hooks": "1.1.0",
69
69
  "@testing-library/user-event": "14.4.3",
70
70
  "@types/jest": "29.4.0",
71
- "@typescript-eslint/eslint-plugin": "5.54.0",
72
- "@typescript-eslint/parser": "5.54.0",
71
+ "@typescript-eslint/eslint-plugin": "5.54.1",
72
+ "@typescript-eslint/parser": "5.54.1",
73
73
  "autoprefixer": "10.4.13",
74
- "babel-jest": "29.4.3",
74
+ "babel-jest": "29.5.0",
75
75
  "cross-env": "^7.0.3",
76
76
  "cssnano": "5.1.15",
77
77
  "dotenv": "^16.0.3",
@@ -86,8 +86,8 @@
86
86
  "filesize": "^10.0.0",
87
87
  "gzip-size": "^6.0.0",
88
88
  "husky": "^8.0.1",
89
- "jest": "29.4.3",
90
- "jest-environment-jsdom": "29.4.3",
89
+ "jest": "29.5.0",
90
+ "jest-environment-jsdom": "29.5.0",
91
91
  "jest-mock-extended": "^3.0.1",
92
92
  "lint-staged": "^13.0.3",
93
93
  "postcss": "8.4.21",