@adyen/adyen-web 5.22.0 → 5.23.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 (87) hide show
  1. package/dist/adyen.css +13 -4
  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 +13 -4
  6. package/dist/cjs/adyen.css.map +1 -1
  7. package/dist/cjs/index.js +1 -1
  8. package/dist/es/adyen.css +13 -4
  9. package/dist/es/adyen.css.map +1 -1
  10. package/dist/es/index.js +1 -1
  11. package/dist/es.modern/adyen.css +13 -4
  12. package/dist/es.modern/adyen.css.map +1 -1
  13. package/dist/es.modern/index.js +1 -1
  14. package/dist/types/components/BcmcMobile/BcmcMobile.d.ts +1 -0
  15. package/dist/types/components/Card/Bancontact.d.ts +12 -0
  16. package/dist/types/components/Card/Card.d.ts +28 -1
  17. package/dist/types/components/Card/ClickToPayHolder.d.ts +6 -0
  18. package/dist/types/components/Card/ClickToPayWrapper.d.ts +4 -0
  19. package/dist/types/components/Card/components/CardInput/defaultProps.d.ts +1 -0
  20. package/dist/types/components/Card/components/CardInput/types.d.ts +1 -0
  21. package/dist/types/components/Card/components/ClickToPay/ClickToPayComponent.d.ts +6 -0
  22. package/dist/types/components/Card/components/ClickToPay/components/CtPCards/CtPCards.d.ts +7 -0
  23. package/dist/types/components/Card/components/ClickToPay/components/CtPCards/CtPCardsList/CtPCardsList.d.ts +8 -0
  24. package/dist/types/components/Card/components/ClickToPay/components/CtPCards/CtPCardsList/index.d.ts +1 -0
  25. package/dist/types/components/Card/components/ClickToPay/components/CtPCards/CtPEmptyCardsList/CtPEmptyCardsList.d.ts +6 -0
  26. package/dist/types/components/Card/components/ClickToPay/components/CtPCards/CtPEmptyCardsList/index.d.ts +1 -0
  27. package/dist/types/components/Card/components/ClickToPay/components/CtPCards/CtPSingleCard/CtPSingleCard.d.ts +8 -0
  28. package/dist/types/components/Card/components/ClickToPay/components/CtPCards/CtPSingleCard/index.d.ts +1 -0
  29. package/dist/types/components/Card/components/ClickToPay/components/CtPCards/index.d.ts +1 -0
  30. package/dist/types/components/Card/components/ClickToPay/components/CtPLoader/CtPLoader.d.ts +4 -0
  31. package/dist/types/components/Card/components/ClickToPay/components/CtPLoader/index.d.ts +1 -0
  32. package/dist/types/components/Card/components/ClickToPay/components/CtPLogin/CtPLogin.d.ts +4 -0
  33. package/dist/types/components/Card/components/ClickToPay/components/CtPLogin/CtPLoginInput.d.ts +18 -0
  34. package/dist/types/components/Card/components/ClickToPay/components/CtPLogin/index.d.ts +1 -0
  35. package/dist/types/components/Card/components/ClickToPay/components/CtPLogin/validate.d.ts +2 -0
  36. package/dist/types/components/Card/components/ClickToPay/components/CtPOneTimePassword/CtPOneTimePassword.d.ts +4 -0
  37. package/dist/types/components/Card/components/ClickToPay/components/CtPOneTimePassword/CtPOneTimePasswordInput/CtPOneTimePasswordInput.d.ts +20 -0
  38. package/dist/types/components/Card/components/ClickToPay/components/CtPOneTimePassword/CtPOneTimePasswordInput/CtPResendOtpLink.d.ts +7 -0
  39. package/dist/types/components/Card/components/ClickToPay/components/CtPOneTimePassword/CtPOneTimePasswordInput/index.d.ts +1 -0
  40. package/dist/types/components/Card/components/ClickToPay/components/CtPOneTimePassword/CtPOneTimePasswordInput/validate.d.ts +2 -0
  41. package/dist/types/components/Card/components/ClickToPay/components/CtPOneTimePassword/index.d.ts +1 -0
  42. package/dist/types/components/Card/components/ClickToPay/components/CtPSection/CtPLogoutLink.d.ts +4 -0
  43. package/dist/types/components/Card/components/ClickToPay/components/CtPSection/CtPSection.d.ts +7 -0
  44. package/dist/types/components/Card/components/ClickToPay/components/CtPSection/index.d.ts +1 -0
  45. package/dist/types/components/Card/components/ClickToPay/context/ClickToPayContext.d.ts +22 -0
  46. package/dist/types/components/Card/components/ClickToPay/context/ClickToPayProvider.d.ts +16 -0
  47. package/dist/types/components/Card/components/ClickToPay/context/useClickToPayContext.d.ts +3 -0
  48. package/dist/types/components/Card/components/ClickToPay/index.d.ts +1 -0
  49. package/dist/types/components/Card/components/ClickToPay/models/ShopperCard.d.ts +15 -0
  50. package/dist/types/components/Card/components/ClickToPay/services/ClickToPayService.d.ts +79 -0
  51. package/dist/types/components/Card/components/ClickToPay/services/sdks/AbstractSrcInitiator.d.ts +75 -0
  52. package/dist/types/components/Card/components/ClickToPay/services/sdks/MastercardSdk.d.ts +13 -0
  53. package/dist/types/components/Card/components/ClickToPay/services/sdks/SrcSdkLoader.d.ts +12 -0
  54. package/dist/types/components/Card/components/ClickToPay/services/sdks/SrciError.d.ts +16 -0
  55. package/dist/types/components/Card/components/ClickToPay/services/sdks/VisaSdk.d.ts +13 -0
  56. package/dist/types/components/Card/components/ClickToPay/services/sdks/config.d.ts +28 -0
  57. package/dist/types/components/Card/components/ClickToPay/services/sdks/types.d.ts +46 -0
  58. package/dist/types/components/Card/components/ClickToPay/services/sdks/utils.d.ts +5 -0
  59. package/dist/types/components/Card/components/ClickToPay/services/types.d.ts +39 -0
  60. package/dist/types/components/Card/components/ClickToPay/services/utils.d.ts +6 -0
  61. package/dist/types/components/Card/components/ClickToPay/utils.d.ts +7 -0
  62. package/dist/types/components/Card/types.d.ts +26 -0
  63. package/dist/types/components/Dragonpay/Dragonpay.d.ts +1 -0
  64. package/dist/types/components/Dropin/Dropin.d.ts +1 -0
  65. package/dist/types/components/Pix/Pix.d.ts +1 -0
  66. package/dist/types/components/Swish/Swish.d.ts +1 -0
  67. package/dist/types/components/UIElement.d.ts +1 -0
  68. package/dist/types/components/WeChat/WeChat.d.ts +1 -0
  69. package/dist/types/components/index.d.ts +1 -0
  70. package/dist/types/components/internal/Button/types.d.ts +3 -1
  71. package/dist/types/components/internal/ContentSeparator/ContentSeparator.d.ts +2 -1
  72. package/dist/types/components/internal/FormFields/Field/types.d.ts +2 -1
  73. package/dist/types/components/internal/FormFields/Select/Select.d.ts +1 -1
  74. package/dist/types/components/internal/FormFields/Select/components/SelectListItem.d.ts +1 -1
  75. package/dist/types/components/internal/FormFields/Select/types.d.ts +4 -0
  76. package/dist/types/components/internal/Icon/Icon.d.ts +3 -1
  77. package/dist/types/components/internal/PayButton/PayButton.d.ts +7 -6
  78. package/dist/types/components/internal/PayButton/components/SecondaryButtonLabel.d.ts +6 -0
  79. package/dist/types/components/internal/PayButton/utils.d.ts +7 -0
  80. package/dist/types/components/types.d.ts +3 -1
  81. package/dist/types/components/utils.d.ts +2 -2
  82. package/dist/types/core/types.d.ts +6 -2
  83. package/dist/types/index.d.ts +1 -1
  84. package/dist/types/language/config.d.ts +33 -0
  85. package/dist/types/language/locales/index.d.ts +66 -0
  86. package/dist/types/types/index.d.ts +8 -0
  87. package/package.json +1 -1
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Types used to define the interface with the SRCi SDK
3
+ */
4
+ export declare type SrciInitiateIdentityValidationResponse = {
5
+ maskedValidationChannel: string;
6
+ };
7
+ export declare type SrciCompleteIdentityValidationResponse = {
8
+ idToken: string;
9
+ };
10
+ export declare type SrciIsRecognizedResponse = {
11
+ recognized: boolean;
12
+ idTokens?: string[];
13
+ };
14
+ export declare type SrciCheckoutResponse = {
15
+ dcfActionCode: string;
16
+ encryptedPayload?: string;
17
+ idToken?: string;
18
+ };
19
+ export declare type SrciIdentityLookupResponse = {
20
+ consumerPresent: boolean;
21
+ };
22
+ export declare type SrcProfile = {
23
+ profiles: Array<{
24
+ maskedCards: SrcCard[];
25
+ }>;
26
+ srcCorrelationId: string;
27
+ };
28
+ export declare type SrcCard = {
29
+ srcDigitalCardId: string;
30
+ panLastFour: string;
31
+ dateOfCardLastUsed: string;
32
+ paymentCardDescriptor: string;
33
+ digitalCardData: {
34
+ descriptorName: string;
35
+ artUri: string;
36
+ };
37
+ tokenId?: string;
38
+ };
39
+ export declare type SrcCheckoutParams = {
40
+ srcCorrelationId: string;
41
+ srcDigitalCardId: string;
42
+ };
43
+ export interface SrcInitParams {
44
+ srcInitiatorId: string;
45
+ srciDpaId: string;
46
+ }
@@ -0,0 +1,5 @@
1
+ declare const SchemeNames: {
2
+ mc: string;
3
+ visa: string;
4
+ };
5
+ export { SchemeNames };
@@ -0,0 +1,39 @@
1
+ import { CtpState } from './ClickToPayService';
2
+ import { SrcProfile } from './sdks/types';
3
+ import { ClickToPayScheme } from '../../../types';
4
+ import ShopperCard from '../models/ShopperCard';
5
+ export interface IClickToPayService {
6
+ state: CtpState;
7
+ shopperCards: ShopperCard[];
8
+ shopperValidationContact: string;
9
+ schemes: string[];
10
+ initialize(): Promise<void>;
11
+ checkout(card: ShopperCard): Promise<ClickToPayCheckoutPayload>;
12
+ logout(): Promise<void>;
13
+ verifyIfShopperIsEnrolled(value: string, type?: string): Promise<{
14
+ isEnrolled: boolean;
15
+ }>;
16
+ subscribeOnStateChange(callback: CallbackStateSubscriber): void;
17
+ startIdentityValidation(): Promise<void>;
18
+ finishIdentityValidation(otpCode: string): Promise<void>;
19
+ }
20
+ export declare type CallbackStateSubscriber = (state: CtpState) => void;
21
+ export interface IdentityLookupParams {
22
+ value: string;
23
+ type?: 'email' | 'mobilePhone';
24
+ }
25
+ declare type MastercardCheckout = {
26
+ srcDigitalCardId: string;
27
+ srcCorrelationId: string;
28
+ srcScheme: string;
29
+ };
30
+ declare type VisaCheckout = {
31
+ srcCheckoutPayload?: string;
32
+ srcTokenReference?: string;
33
+ srcScheme: string;
34
+ };
35
+ export interface SrcProfileWithScheme extends SrcProfile {
36
+ scheme: ClickToPayScheme;
37
+ }
38
+ export declare type ClickToPayCheckoutPayload = VisaCheckout | MastercardCheckout;
39
+ export {};
@@ -0,0 +1,6 @@
1
+ import { ClickToPayCheckoutPayload, SrcProfileWithScheme } from './types';
2
+ import { SrciCheckoutResponse } from './sdks/types';
3
+ import ShopperCard from '../models/ShopperCard';
4
+ declare function createCheckoutPayloadBasedOnScheme(card: ShopperCard, checkoutResponse: SrciCheckoutResponse, environment: string): ClickToPayCheckoutPayload;
5
+ declare function createShopperCardsList(srcProfiles: SrcProfileWithScheme[]): ShopperCard[];
6
+ export { createShopperCardsList, createCheckoutPayloadBasedOnScheme };
@@ -0,0 +1,7 @@
1
+ import { IClickToPayService } from './services/types';
2
+ import { CardConfiguration, ClickToPayConfiguration } from '../../types';
3
+ /**
4
+ * Creates the Click to Pay service in case the required configuration is provided
5
+ */
6
+ declare function createClickToPayService(configuration: CardConfiguration, clickToPayConfiguration: ClickToPayConfiguration | undefined, environment: string): IClickToPayService | null;
7
+ export { createClickToPayService };
@@ -12,6 +12,15 @@ export interface CardElementProps extends UIElementProps {
12
12
  * Configuration specific to brands
13
13
  */
14
14
  brandsConfiguration?: CardBrandsConfiguration;
15
+ /**
16
+ * Flag indicating if merchant really intent to use Click to Pay
17
+ * Will be removed when we Click to Pay goes live
18
+ */
19
+ useClickToPay: boolean;
20
+ /**
21
+ * Configuration for Click to Pay
22
+ */
23
+ clickToPayConfiguration?: ClickToPayConfiguration;
15
24
  /**
16
25
  * type will always be "card" (generic card, stored card)
17
26
  * except for a single branded card when it will be the same as the brand prop
@@ -80,9 +89,26 @@ export interface CardElementProps extends UIElementProps {
80
89
  onBinLookup?: (event: CbObjOnBinLookup) => void;
81
90
  [key: string]: any;
82
91
  }
92
+ export declare type ClickToPayScheme = 'mc' | 'visa';
93
+ export declare type ClickToPayConfiguration = {
94
+ shopperIdentityValue: string;
95
+ shopperIdentityType?: 'email' | 'mobilePhone';
96
+ /**
97
+ * Used to ensure the correct language and user experience if DCF screen is displayed. As a fallback, it uses the main locale
98
+ * defined during the creation of the Checkout.
99
+ * Format: ISO language_country pair (e.g., en_US )
100
+ *
101
+ * @default en_US
102
+ */
103
+ locale?: string;
104
+ };
83
105
  export declare type SocialSecurityMode = 'show' | 'hide' | 'auto';
84
106
  /** If the merchant wishes to set any of these properties in their local config they should do so via a "configuration" object */
85
107
  export interface CardConfiguration {
108
+ visaSrciDpaId?: string;
109
+ visaSrcInitiatorId?: string;
110
+ mcSrcClientId?: string;
111
+ mcDpaId?: string;
86
112
  merchantIdentifier?: string;
87
113
  merchantOrigin?: string;
88
114
  gatewayMerchantId?: string;
@@ -35,6 +35,7 @@ export declare class DragonpayElement extends UIElement<DragonpayElementProps> {
35
35
  name?: string;
36
36
  icon?: string;
37
37
  amount?: import("../../types").PaymentAmount;
38
+ secondaryAmount?: import("../../types").PaymentAmountExtended;
38
39
  showPayButton?: boolean;
39
40
  setStatusAutomatically?: boolean;
40
41
  payButton?: (options: import("../types").PayButtonFunctionProps) => h.JSX.Element;
@@ -60,6 +60,7 @@ declare class DropinElement extends UIElement<DropinElementProps> {
60
60
  name?: string;
61
61
  icon?: string;
62
62
  amount?: import("../../types").PaymentAmount;
63
+ secondaryAmount?: import("../../types").PaymentAmountExtended;
63
64
  showPayButton?: boolean;
64
65
  setStatusAutomatically?: boolean;
65
66
  payButton?: (options: import("../types").PayButtonFunctionProps) => h.JSX.Element;
@@ -37,6 +37,7 @@ declare class PixElement extends QRLoaderContainer<PixProps> {
37
37
  name?: string;
38
38
  icon?: string;
39
39
  amount?: import("../../types").PaymentAmount;
40
+ secondaryAmount?: import("../../types").PaymentAmountExtended;
40
41
  showPayButton?: boolean;
41
42
  setStatusAutomatically?: boolean;
42
43
  payButton?: (options: import("../types").PayButtonFunctionProps) => h.JSX.Element;
@@ -25,6 +25,7 @@ declare class SwishElement extends QRLoaderContainer {
25
25
  name?: string;
26
26
  icon?: string;
27
27
  amount?: import("../../types").PaymentAmount;
28
+ secondaryAmount?: import("../../types").PaymentAmountExtended;
28
29
  showPayButton?: boolean;
29
30
  setStatusAutomatically?: boolean;
30
31
  payButton?: (options: import("../types").PayButtonFunctionProps) => import("preact").JSX.Element;
@@ -18,6 +18,7 @@ export declare class UIElement<P extends UIElementProps = any> extends BaseEleme
18
18
  */
19
19
  submit(): void;
20
20
  showValidation(): this;
21
+ setElementStatus(status: UIElementStatus, props?: any): this;
21
22
  setStatus(status: UIElementStatus, props?: any): this;
22
23
  private submitPayment;
23
24
  private submitAdditionalDetails;
@@ -25,6 +25,7 @@ declare class WeChatPayElement extends QRLoaderContainer {
25
25
  name?: string;
26
26
  icon?: string;
27
27
  amount?: import("../../types").PaymentAmount;
28
+ secondaryAmount?: import("../../types").PaymentAmountExtended;
28
29
  showPayButton?: boolean;
29
30
  setStatusAutomatically?: boolean;
30
31
  payButton?: (options: import("../types").PayButtonFunctionProps) => import("preact").JSX.Element;
@@ -101,6 +101,7 @@ declare const componentsMap: {
101
101
  doku_wallet: typeof Doku;
102
102
  donation: typeof Donation;
103
103
  dotpay: typeof Dotpay;
104
+ onlineBanking: typeof Dotpay;
104
105
  dragonpay_ebanking: typeof Dragonpay;
105
106
  dragonpay_otc_banking: typeof Dragonpay;
106
107
  dragonpay_otc_non_banking: typeof Dragonpay;
@@ -1,12 +1,14 @@
1
+ export declare type ButtonVariant = 'primary' | 'secondary' | 'ghost' | 'action';
1
2
  export interface ButtonProps {
2
3
  status?: string;
3
4
  /**
4
5
  * Class name modifiers will be used as: `adyen-checkout__image--${modifier}`
5
6
  */
6
7
  classNameModifiers?: string[];
7
- variant: 'primary' | 'secondary' | 'ghost' | 'action';
8
+ variant?: ButtonVariant;
8
9
  disabled?: boolean;
9
10
  label?: string;
11
+ secondaryLabel?: string;
10
12
  icon?: string;
11
13
  inline?: boolean;
12
14
  href?: string;
@@ -2,6 +2,7 @@ import { h } from 'preact';
2
2
  import './ContentSeparator.scss';
3
3
  interface ContentSeparatorProps {
4
4
  label?: string;
5
+ classNames?: string[];
5
6
  }
6
- declare function ContentSeparator({ label }: ContentSeparatorProps): h.JSX.Element;
7
+ declare function ContentSeparator({ label, classNames }: ContentSeparatorProps): h.JSX.Element;
7
8
  export default ContentSeparator;
@@ -1,4 +1,4 @@
1
- import { Component, ComponentChildren } from 'preact';
1
+ import { h, Component, ComponentChildren } from 'preact';
2
2
  export interface FieldProps {
3
3
  className?: string;
4
4
  classNameModifiers?: string[];
@@ -12,6 +12,7 @@ export interface FieldProps {
12
12
  isLoading?: boolean;
13
13
  isValid?: boolean;
14
14
  label?: string | Component;
15
+ labelEndAdornment?: string | h.JSX.Element;
15
16
  onBlur?: any;
16
17
  onFocus?: any;
17
18
  onFocusField?: any;
@@ -1,7 +1,7 @@
1
1
  import { h } from 'preact';
2
2
  import { SelectProps } from './types';
3
3
  import './Select.scss';
4
- declare function Select({ items, className, classNameModifiers, filterable, readonly, onChange, selected, name, isInvalid, isValid, placeholder, uniqueId, isCollatingErrors }: SelectProps): h.JSX.Element;
4
+ declare function Select({ items, className, classNameModifiers, filterable, readonly, onChange, selected, name, isInvalid, isValid, placeholder, uniqueId, isCollatingErrors, isIconOnLeftSide }: SelectProps): h.JSX.Element;
5
5
  declare namespace Select {
6
6
  var defaultProps: {
7
7
  className: string;
@@ -1,4 +1,4 @@
1
1
  import { h } from 'preact';
2
2
  import { SelectItemProps } from '../types';
3
- declare const SelectListItem: ({ item, selected, ...props }: SelectItemProps) => h.JSX.Element;
3
+ declare const SelectListItem: ({ item, selected, isIconOnLeftSide, ...props }: SelectItemProps) => h.JSX.Element;
4
4
  export default SelectListItem;
@@ -19,6 +19,7 @@ export interface SelectProps {
19
19
  selected: string;
20
20
  uniqueId?: string;
21
21
  isCollatingErrors: boolean;
22
+ isIconOnLeftSide?: boolean;
22
23
  }
23
24
  export interface SelectButtonProps {
24
25
  active: SelectItem;
@@ -36,6 +37,7 @@ export interface SelectButtonProps {
36
37
  toggleList: (e: Event) => void;
37
38
  id?: string;
38
39
  ariaDescribedBy: string;
40
+ isIconOnLeftSide: boolean;
39
41
  }
40
42
  export interface SelectListProps {
41
43
  active: SelectItem;
@@ -46,10 +48,12 @@ export interface SelectListProps {
46
48
  selectListRef: any;
47
49
  showList: boolean;
48
50
  textFilter: string;
51
+ isIconOnLeftSide: boolean;
49
52
  }
50
53
  export interface SelectItemProps {
51
54
  item: SelectItem;
52
55
  selected: boolean;
56
+ isIconOnLeftSide: boolean;
53
57
  onKeyDown: (e: KeyboardEvent) => void;
54
58
  onSelect: (e: Event) => void;
55
59
  }
@@ -3,6 +3,8 @@ interface IconProps {
3
3
  type: string;
4
4
  className?: string;
5
5
  alt?: string;
6
+ height?: number;
7
+ width?: number;
6
8
  }
7
- declare const Icon: ({ type, className, alt }: IconProps) => h.JSX.Element;
9
+ declare const Icon: ({ type, className, alt, height, width }: IconProps) => h.JSX.Element;
8
10
  export default Icon;
@@ -1,19 +1,20 @@
1
1
  import { h } from 'preact';
2
- import { PaymentAmount } from '../../../types';
3
- import Language from '../../../language/Language';
4
- export interface PayButtonProps {
2
+ import { ButtonProps } from '../Button/types';
3
+ import { payAmountLabel } from './utils';
4
+ import { PaymentAmountExtended } from '../../../types';
5
+ export interface PayButtonProps extends ButtonProps {
5
6
  /**
6
7
  * Class name modifiers will be used as: `adyen-checkout__image--${modifier}`
7
8
  */
8
9
  classNameModifiers?: string[];
9
10
  label?: string;
10
- amount: PaymentAmount;
11
+ amount: PaymentAmountExtended;
12
+ secondaryAmount?: PaymentAmountExtended;
11
13
  status?: string;
12
14
  disabled?: boolean;
13
15
  icon?: string;
14
16
  onClick?(): void;
15
17
  }
16
- declare const payAmountLabel: (i18n: Language, amount: any) => string;
17
- declare const PayButton: ({ amount, classNameModifiers, label, ...props }: PayButtonProps) => h.JSX.Element;
18
+ declare const PayButton: ({ amount, secondaryAmount, classNameModifiers, label, ...props }: PayButtonProps) => h.JSX.Element;
18
19
  export default PayButton;
19
20
  export { payAmountLabel };
@@ -0,0 +1,6 @@
1
+ import { h } from 'preact';
2
+ import './SecondaryButtonLabel.scss';
3
+ declare const SecondaryButtonLabel: ({ label }: {
4
+ label: any;
5
+ }) => h.JSX.Element;
6
+ export default SecondaryButtonLabel;
@@ -0,0 +1,7 @@
1
+ import Language from '../../../language';
2
+ import { PaymentAmountExtended } from '../../../types';
3
+ export declare const PAY_BTN_DIVIDER = "/ ";
4
+ declare const amountLabel: (i18n: any, amount: PaymentAmountExtended) => any;
5
+ declare const payAmountLabel: (i18n: Language, amount: PaymentAmountExtended) => string;
6
+ declare const secondaryAmountLabel: (i18n: Language, secondaryAmount: PaymentAmountExtended) => string;
7
+ export { payAmountLabel, amountLabel, secondaryAmountLabel };
@@ -1,4 +1,4 @@
1
- import { Order, PaymentAction, PaymentAmount } from '../types';
1
+ import { Order, PaymentAction, PaymentAmount, PaymentAmountExtended } from '../types';
2
2
  import UIElement from './UIElement';
3
3
  import Core from '../core';
4
4
  import Analytics from '../core/Analytics';
@@ -30,6 +30,7 @@ export interface IUIElement {
30
30
  type: string;
31
31
  elementRef: any;
32
32
  submit(): void;
33
+ setElementStatus(status: UIElementStatus, props: any): UIElement;
33
34
  setStatus(status: UIElementStatus, props?: {
34
35
  message?: string;
35
36
  [key: string]: any;
@@ -56,6 +57,7 @@ export interface UIElementProps extends BaseElementProps {
56
57
  name?: string;
57
58
  icon?: string;
58
59
  amount?: PaymentAmount;
60
+ secondaryAmount?: PaymentAmountExtended;
59
61
  /**
60
62
  * Show/Hide pay button
61
63
  * @defaultValue true
@@ -1,3 +1,3 @@
1
- import { PaymentResponse, RawPaymentResponse } from './types';
1
+ import { PaymentResponse, RawPaymentResponse, UIElementStatus } from './types';
2
2
  export declare function getSanitizedResponse(response: RawPaymentResponse): PaymentResponse;
3
- export declare function resolveFinalResult(result: PaymentResponse): string[];
3
+ export declare function resolveFinalResult(result: PaymentResponse): [status: UIElementStatus, statusProps?: any];
@@ -1,5 +1,5 @@
1
1
  import { CustomTranslations, Locales } from '../language/types';
2
- import { PaymentAmount, PaymentMethods, PaymentMethodOptions, PaymentActionsType } from '../types';
2
+ import { PaymentMethods, PaymentMethodOptions, PaymentActionsType, PaymentAmountExtended } from '../types';
3
3
  import { AnalyticsOptions } from './Analytics/types';
4
4
  import { PaymentMethodsResponseObject } from './ProcessResponse/PaymentMethodsResponse/types';
5
5
  import { RiskModuleOptions } from './RiskModule/RiskModule';
@@ -32,7 +32,11 @@ export interface CoreOptions {
32
32
  /**
33
33
  * Amount of the payment
34
34
  */
35
- amount?: PaymentAmount;
35
+ amount?: PaymentAmountExtended;
36
+ /**
37
+ * Secondary amount of the payment - alternative currency & value converted according to rate
38
+ */
39
+ secondaryAmount?: PaymentAmountExtended;
36
40
  /**
37
41
  * The shopper's country code. A valid value is an ISO two-character country code (e.g. 'NL').
38
42
  */
@@ -1,4 +1,4 @@
1
- import { CoreOptions } from 'src/core/types';
1
+ import { CoreOptions } from './core/types';
2
2
  import Checkout from './core';
3
3
  declare function AdyenCheckout(props: CoreOptions): Promise<Checkout>;
4
4
  export default AdyenCheckout;
@@ -5,6 +5,7 @@ export declare const FALLBACK_LOCALE = "en-US";
5
5
  export declare const defaultTranslation: {
6
6
  payButton: string;
7
7
  "payButton.redirecting": string;
8
+ "payButton.with": string;
8
9
  storeDetails: string;
9
10
  "creditCard.holderName": string;
10
11
  "creditCard.holderName.placeholder": string;
@@ -222,4 +223,36 @@ export declare const defaultTranslation: {
222
223
  "upi.qrCodeWaitingMessage": string;
223
224
  "upi.vpaWaitingMessage": string;
224
225
  "onlineBanking.termsAndConditions": string;
226
+ "ctp.loading.poweredByCtp": string;
227
+ "ctp.loading.intro": string;
228
+ "ctp.login.title": string;
229
+ "ctp.login.subtitle": string;
230
+ "ctp.login.inputLabel": string;
231
+ "ctp.logout.notYou": string;
232
+ "ctp.logout.notYouCards": string;
233
+ "ctp.otp.fieldLabel": string;
234
+ "ctp.otp.resendCode": string;
235
+ "ctp.otp.codeResent": string;
236
+ "ctp.otp.title": string;
237
+ "ctp.otp.subtitle": string;
238
+ "ctp.emptyCardsView.title": string;
239
+ "ctp.emptyCardsView.subtitle": string;
240
+ "ctp.emptyCardsView.button": string;
241
+ "ctp.separatorText": string;
242
+ "ctp.cards.title": string;
243
+ "ctp.cards.subtitle": string;
244
+ "ctp.cards.cardSelector": string;
245
+ "ctp.manualCardEntry": string;
246
+ "ctp.errors.AUTH_INVALID": string;
247
+ "ctp.errors.NOT_FOUND": string;
248
+ "ctp.errors.ID_FORMAT_UNSUPPORTED": string;
249
+ "ctp.errors.FRAUD": string;
250
+ "ctp.errors.CONSUMER_ID_MISSING": string;
251
+ "ctp.errors.ACCT_INACCESSIBLE": string;
252
+ "ctp.errors.UNKNOWN_ERROR": string;
253
+ "ctp.errors.CODE_INVALID": string;
254
+ "ctp.errors.CODE_EXPIRED": string;
255
+ "ctp.errors.INVALID_PARAMETER": string;
256
+ "ctp.errors.RETRIES_EXCEEDED": string;
257
+ "ctp.errors.OTP_SEND_FAILED": string;
225
258
  };
@@ -2197,6 +2197,7 @@ declare const _default: {
2197
2197
  default: {
2198
2198
  payButton: string;
2199
2199
  "payButton.redirecting": string;
2200
+ "payButton.with": string;
2200
2201
  storeDetails: string;
2201
2202
  "creditCard.holderName": string;
2202
2203
  "creditCard.holderName.placeholder": string;
@@ -2414,9 +2415,42 @@ declare const _default: {
2414
2415
  "upi.qrCodeWaitingMessage": string;
2415
2416
  "upi.vpaWaitingMessage": string;
2416
2417
  "onlineBanking.termsAndConditions": string;
2418
+ "ctp.loading.poweredByCtp": string;
2419
+ "ctp.loading.intro": string;
2420
+ "ctp.login.title": string;
2421
+ "ctp.login.subtitle": string;
2422
+ "ctp.login.inputLabel": string;
2423
+ "ctp.logout.notYou": string;
2424
+ "ctp.logout.notYouCards": string;
2425
+ "ctp.otp.fieldLabel": string;
2426
+ "ctp.otp.resendCode": string;
2427
+ "ctp.otp.codeResent": string;
2428
+ "ctp.otp.title": string;
2429
+ "ctp.otp.subtitle": string;
2430
+ "ctp.emptyCardsView.title": string;
2431
+ "ctp.emptyCardsView.subtitle": string;
2432
+ "ctp.emptyCardsView.button": string;
2433
+ "ctp.separatorText": string;
2434
+ "ctp.cards.title": string;
2435
+ "ctp.cards.subtitle": string;
2436
+ "ctp.cards.cardSelector": string;
2437
+ "ctp.manualCardEntry": string;
2438
+ "ctp.errors.AUTH_INVALID": string;
2439
+ "ctp.errors.NOT_FOUND": string;
2440
+ "ctp.errors.ID_FORMAT_UNSUPPORTED": string;
2441
+ "ctp.errors.FRAUD": string;
2442
+ "ctp.errors.CONSUMER_ID_MISSING": string;
2443
+ "ctp.errors.ACCT_INACCESSIBLE": string;
2444
+ "ctp.errors.UNKNOWN_ERROR": string;
2445
+ "ctp.errors.CODE_INVALID": string;
2446
+ "ctp.errors.CODE_EXPIRED": string;
2447
+ "ctp.errors.INVALID_PARAMETER": string;
2448
+ "ctp.errors.RETRIES_EXCEEDED": string;
2449
+ "ctp.errors.OTP_SEND_FAILED": string;
2417
2450
  };
2418
2451
  payButton: string;
2419
2452
  "payButton.redirecting": string;
2453
+ "payButton.with": string;
2420
2454
  storeDetails: string;
2421
2455
  "creditCard.holderName": string;
2422
2456
  "creditCard.holderName.placeholder": string;
@@ -2634,6 +2668,38 @@ declare const _default: {
2634
2668
  "upi.qrCodeWaitingMessage": string;
2635
2669
  "upi.vpaWaitingMessage": string;
2636
2670
  "onlineBanking.termsAndConditions": string;
2671
+ "ctp.loading.poweredByCtp": string;
2672
+ "ctp.loading.intro": string;
2673
+ "ctp.login.title": string;
2674
+ "ctp.login.subtitle": string;
2675
+ "ctp.login.inputLabel": string;
2676
+ "ctp.logout.notYou": string;
2677
+ "ctp.logout.notYouCards": string;
2678
+ "ctp.otp.fieldLabel": string;
2679
+ "ctp.otp.resendCode": string;
2680
+ "ctp.otp.codeResent": string;
2681
+ "ctp.otp.title": string;
2682
+ "ctp.otp.subtitle": string;
2683
+ "ctp.emptyCardsView.title": string;
2684
+ "ctp.emptyCardsView.subtitle": string;
2685
+ "ctp.emptyCardsView.button": string;
2686
+ "ctp.separatorText": string;
2687
+ "ctp.cards.title": string;
2688
+ "ctp.cards.subtitle": string;
2689
+ "ctp.cards.cardSelector": string;
2690
+ "ctp.manualCardEntry": string;
2691
+ "ctp.errors.AUTH_INVALID": string;
2692
+ "ctp.errors.NOT_FOUND": string;
2693
+ "ctp.errors.ID_FORMAT_UNSUPPORTED": string;
2694
+ "ctp.errors.FRAUD": string;
2695
+ "ctp.errors.CONSUMER_ID_MISSING": string;
2696
+ "ctp.errors.ACCT_INACCESSIBLE": string;
2697
+ "ctp.errors.UNKNOWN_ERROR": string;
2698
+ "ctp.errors.CODE_INVALID": string;
2699
+ "ctp.errors.CODE_EXPIRED": string;
2700
+ "ctp.errors.INVALID_PARAMETER": string;
2701
+ "ctp.errors.RETRIES_EXCEEDED": string;
2702
+ "ctp.errors.OTP_SEND_FAILED": string;
2637
2703
  }>;
2638
2704
  'es-ES': () => Promise<{
2639
2705
  default: {
@@ -147,6 +147,14 @@ export interface PaymentAmount {
147
147
  value: number;
148
148
  currency: string;
149
149
  }
150
+ export interface PaymentAmountExtended extends PaymentAmount {
151
+ /**
152
+ * Adds currencyDisplay prop - as a way for the merchant to influence the final display of the amount on the pay button.
153
+ * Defaults to 'symbol'.
154
+ * see: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#currencydisplay
155
+ */
156
+ currencyDisplay?: string;
157
+ }
150
158
  export declare type AddressField = typeof ADDRESS_SCHEMA[number];
151
159
  export declare type AddressData = {
152
160
  [key in AddressField]?: string;
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.22.0",
26
+ "version": "5.23.0",
27
27
  "license": "MIT",
28
28
  "homepage": "https://docs.adyen.com/checkout",
29
29
  "repository": "github:Adyen/adyen-web",