@adyen/adyen-web 5.57.0 → 5.59.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 (78) hide show
  1. package/README.md +1 -1
  2. package/dist/adyen.js +1 -1
  3. package/dist/adyen.js.map +1 -1
  4. package/dist/cjs/index.js +1 -1
  5. package/dist/es/ar.js +1 -1
  6. package/dist/es/cs-CZ.js +1 -1
  7. package/dist/es/da-DK.js +1 -1
  8. package/dist/es/de-DE.js +1 -1
  9. package/dist/es/el-GR.js +1 -1
  10. package/dist/es/es-ES.js +1 -1
  11. package/dist/es/fi-FI.js +1 -1
  12. package/dist/es/fr-FR.js +1 -1
  13. package/dist/es/hr-HR.js +1 -1
  14. package/dist/es/hu-HU.js +1 -1
  15. package/dist/es/index.js +1 -1
  16. package/dist/es/it-IT.js +1 -1
  17. package/dist/es/ja-JP.js +1 -1
  18. package/dist/es/ko-KR.js +1 -1
  19. package/dist/es/nl-NL.js +1 -1
  20. package/dist/es/no-NO.js +1 -1
  21. package/dist/es/pl-PL.js +1 -1
  22. package/dist/es/pt-BR.js +1 -1
  23. package/dist/es/pt-PT.js +1 -1
  24. package/dist/es/ro-RO.js +1 -1
  25. package/dist/es/ru-RU.js +1 -1
  26. package/dist/es/sk-SK.js +1 -1
  27. package/dist/es/sl-SI.js +1 -1
  28. package/dist/es/sv-SE.js +1 -1
  29. package/dist/es/zh-CN.js +1 -1
  30. package/dist/es/zh-TW.js +1 -1
  31. package/dist/es.modern/ar.js +1 -1
  32. package/dist/es.modern/cs-CZ.js +1 -1
  33. package/dist/es.modern/da-DK.js +1 -1
  34. package/dist/es.modern/de-DE.js +1 -1
  35. package/dist/es.modern/el-GR.js +1 -1
  36. package/dist/es.modern/es-ES.js +1 -1
  37. package/dist/es.modern/fi-FI.js +1 -1
  38. package/dist/es.modern/fr-FR.js +1 -1
  39. package/dist/es.modern/hr-HR.js +1 -1
  40. package/dist/es.modern/hu-HU.js +1 -1
  41. package/dist/es.modern/index.js +1 -1
  42. package/dist/es.modern/it-IT.js +1 -1
  43. package/dist/es.modern/ja-JP.js +1 -1
  44. package/dist/es.modern/ko-KR.js +1 -1
  45. package/dist/es.modern/nl-NL.js +1 -1
  46. package/dist/es.modern/no-NO.js +1 -1
  47. package/dist/es.modern/pl-PL.js +1 -1
  48. package/dist/es.modern/pt-BR.js +1 -1
  49. package/dist/es.modern/pt-PT.js +1 -1
  50. package/dist/es.modern/ro-RO.js +1 -1
  51. package/dist/es.modern/ru-RU.js +1 -1
  52. package/dist/es.modern/sk-SK.js +1 -1
  53. package/dist/es.modern/sl-SI.js +1 -1
  54. package/dist/es.modern/sv-SE.js +1 -1
  55. package/dist/es.modern/zh-CN.js +1 -1
  56. package/dist/es.modern/zh-TW.js +1 -1
  57. package/dist/types/components/Atome/config.d.ts +1 -1
  58. package/dist/types/components/Card/Card.d.ts +5 -0
  59. package/dist/types/components/OnlineBankingFI/OnlineBankingFI.d.ts +5 -0
  60. package/dist/types/components/OnlineBankingFI/index.d.ts +1 -0
  61. package/dist/types/components/PayPal/Paypal.d.ts +25 -1
  62. package/dist/types/components/PayPal/components/PaypalButtons.d.ts +1 -1
  63. package/dist/types/components/PayPal/types.d.ts +44 -1
  64. package/dist/types/components/Riverty/Riverty.d.ts +63 -0
  65. package/dist/types/components/Riverty/config.d.ts +20 -0
  66. package/dist/types/components/Riverty/index.d.ts +1 -0
  67. package/dist/types/components/index.d.ts +4 -0
  68. package/dist/types/components/internal/Address/Address.d.ts +1 -1
  69. package/dist/types/components/internal/Address/constants.d.ts +2 -2
  70. package/dist/types/components/internal/OpenInvoice/types.d.ts +7 -1
  71. package/dist/types/components/utils.d.ts +1 -0
  72. package/dist/types/language/config.d.ts +2 -0
  73. package/dist/types/language/locales/index.d.ts +104 -0
  74. package/dist/types/utils/getConsentUrl.d.ts +7 -0
  75. package/package.json +2 -2
  76. package/dist/types/components/AfterPay/utils.d.ts +0 -2
  77. /package/dist/types/components/{AfterPay/components → internal}/ConsentCheckboxLabel/ConsentCheckboxLabel.d.ts +0 -0
  78. /package/dist/types/components/{AfterPay/components → internal}/ConsentCheckboxLabel/index.d.ts +0 -0
@@ -2,6 +2,7 @@ import { PaymentAmount, PaymentMethod, ShopperDetails } from '../../types';
2
2
  import UIElement from '../UIElement';
3
3
  import { UIElementProps } from '../types';
4
4
  import { SUPPORTED_LOCALES } from './config';
5
+ import PaypalElement from './Paypal';
5
6
  declare global {
6
7
  interface Window {
7
8
  paypal: object;
@@ -114,8 +115,23 @@ interface PayPalCommonProps {
114
115
  onClick?: () => void;
115
116
  /**
116
117
  * @see {@link https://developer.paypal.com/docs/business/javascript-sdk/javascript-sdk-reference/#onshippingchange}
118
+ * @deprecated - Use 'onShippingAddressChange' instead, as described in the PayPal docs
117
119
  */
118
120
  onShippingChange?: (data: any, actions: any) => void;
121
+ /**
122
+ * While the buyer is on the PayPal site, you can update their shopping cart to reflect the shipping address they chose on PayPal
123
+ * @see {@link https://developer.paypal.com/sdk/js/reference/#onshippingaddresschange}
124
+ */
125
+ onShippingAddressChange?: (data: any, actions: {
126
+ reject: (reason?: string) => Promise<void>;
127
+ }) => Promise<void>;
128
+ /**
129
+ * While the buyer is on the PayPal site, you can update their shopping cart to reflect the shipping options they chose on PayPal
130
+ * @see {@link https://developer.paypal.com/sdk/js/reference/#onshippingoptionschange}
131
+ */
132
+ onShippingOptionsChange?: (data: any, actions: {
133
+ reject: (reason?: string) => Promise<void>;
134
+ }) => Promise<void>;
119
135
  /**
120
136
  * Identifies if the payment is Express.
121
137
  * @defaultValue false
@@ -132,12 +148,39 @@ export interface PayPalConfig {
132
148
  */
133
149
  intent?: Intent;
134
150
  }
135
- export interface PayPalElementProps extends PayPalCommonProps, UIElementProps {
151
+ export interface PayPalElementProps extends Omit<PayPalCommonProps, 'onShippingAddressChange' | 'onShippingOptionsChange'>, UIElementProps {
136
152
  onSubmit?: (state: any, element: UIElement) => void;
137
153
  onComplete?: (state: any, element?: UIElement) => void;
138
154
  onAdditionalDetails?: (state: any, element: UIElement) => void;
139
155
  onCancel?: (state: any, element: UIElement) => void;
140
156
  onError?: (state: any, element?: UIElement) => void;
157
+ /**
158
+ * While the buyer is on the PayPal site, you can update their shopping cart to reflect the shipping address they chose on PayPal
159
+ * @see {@link https://developer.paypal.com/sdk/js/reference/#onshippingaddresschange}
160
+ *
161
+ * @param data - PayPal data object
162
+ * @param actions - Used to reject the address change in case the address is invalid
163
+ * @param component - Adyen instance of its PayPal implementation. It must be used to manipulate the 'paymentData' in order to apply the amount patch correctly
164
+ */
165
+ onShippingAddressChange?: (data: any, actions: {
166
+ reject: (reason?: string) => Promise<void>;
167
+ }, component: PaypalElement) => Promise<void>;
168
+ /**
169
+ * This callback is triggered any time the user selects a new shipping option.
170
+ * @see {@link https://developer.paypal.com/sdk/js/reference/#onshippingoptionschange}
171
+ *
172
+ * @param data - An PayPal object containing the payer’s selected shipping option
173
+ * @param actions - Used to indicates to PayPal that you will not support the shipping method selected by the buyer
174
+ * @param component - Adyen instance of its PayPal implementation. It must be used to manipulate the 'paymentData' in order to apply the amount patch correctly
175
+ */
176
+ onShippingOptionsChange?: (data: any, actions: {
177
+ reject: (reason?: string) => Promise<void>;
178
+ }, component: PaypalElement) => Promise<void>;
179
+ /**
180
+ * If set to 'continue' , the button inside the lightbox will display the 'Continue' button
181
+ * @default pay
182
+ */
183
+ userAction?: 'continue' | 'pay';
141
184
  onShopperDetails?(shopperDetails: ShopperDetails, rawData: any, actions: {
142
185
  resolve: () => void;
143
186
  reject: () => void;
@@ -0,0 +1,63 @@
1
+ import { h } from 'preact';
2
+ import OpenInvoiceContainer from '../helpers/OpenInvoiceContainer';
3
+ import { OpenInvoiceContainerProps } from '../helpers/OpenInvoiceContainer/OpenInvoiceContainer';
4
+ export default class Riverty extends OpenInvoiceContainer {
5
+ static readonly type = "riverty";
6
+ protected static defaultProps: {
7
+ consentCheckboxLabel?: h.JSX.Element;
8
+ billingAddressRequiredFields?: string[];
9
+ billingAddressSpecification?: import("../internal/Address/types").AddressSpecifications;
10
+ allowedCountries?: string[];
11
+ countryCode?: string;
12
+ data?: {
13
+ companyDetails?: import("../internal/CompanyDetails/types").CompanyDetailsSchema;
14
+ personalDetails?: import("../../types").PersonalDetailsSchema;
15
+ billingAddress?: import("../../types").AddressData;
16
+ deliveryAddress?: import("../../types").AddressData;
17
+ bankAccount?: import("../internal/OpenInvoice/types").BankDetailsSchema;
18
+ };
19
+ onChange?: (state: any, element?: import("../UIElement").UIElement<any>) => void;
20
+ payButton?: any;
21
+ showPayButton?: boolean;
22
+ visibility?: import("../internal/OpenInvoice/types").OpenInvoiceVisibility;
23
+ personalDetailsRequiredFields: string[];
24
+ deliveryAddressRequiredFields?: string[];
25
+ deliveryAddressSpecification: import("../internal/Address/types").AddressSpecifications;
26
+ setComponentRef?: (ref: any) => void;
27
+ showFormInstruction?: boolean;
28
+ environment?: string;
29
+ session?: import("../../core/CheckoutSession/CheckoutSession").default;
30
+ onValid?: (state: any, element: import("../UIElement").UIElement<any>) => void;
31
+ beforeSubmit?: (state: any, element: import("../UIElement").UIElement<any>, actions: any) => Promise<void>;
32
+ onSubmit?: (state: any, element: import("../UIElement").UIElement<any>) => void;
33
+ onComplete?: (state: any, element: import("../UIElement").UIElement<any>) => void;
34
+ onActionHandled?: (rtnObj: import("../types").ActionHandledReturnObject) => void;
35
+ onAdditionalDetails?: (state: any, element: import("../UIElement").UIElement<any>) => void;
36
+ onError?: (error: any, element?: import("../UIElement").UIElement<any>) => void;
37
+ onPaymentCompleted?: (result: any, element: import("../UIElement").UIElement<any>) => void;
38
+ beforeRedirect?: (resolve: any, reject: any, redirectData: any, element: import("../UIElement").UIElement<any>) => void;
39
+ isInstantPayment?: boolean;
40
+ type?: string;
41
+ name?: string;
42
+ icon?: string;
43
+ amount?: import("../../types").PaymentAmount;
44
+ secondaryAmount?: import("../../types").PaymentAmountExtended;
45
+ setStatusAutomatically?: boolean;
46
+ loadingContext?: string;
47
+ createFromAction?: (action: import("../../types").PaymentAction, props: object) => import("../UIElement").UIElement<any>;
48
+ clientKey?: string;
49
+ paymentMethodType?: string;
50
+ elementRef?: any;
51
+ i18n?: import("../../language").default;
52
+ _parentInstance?: import("../../core/core").default;
53
+ order?: import("../../types").Order;
54
+ modules?: {
55
+ srPanel?: import("../../core/Errors/SRPanel").SRPanel;
56
+ analytics?: import("../../core/Analytics/Analytics").default;
57
+ resources?: import("../../core/Context/Resources").Resources;
58
+ risk?: import("../../core/RiskModule").default;
59
+ };
60
+ isDropin?: boolean;
61
+ };
62
+ formatProps(props: OpenInvoiceContainerProps): any;
63
+ }
@@ -0,0 +1,20 @@
1
+ import { AddressSpecifications } from '../internal/Address/types';
2
+ export declare const allowedBillingCountries: string[];
3
+ export declare const allowedDeliveryCountries: string[];
4
+ export declare const personalDetailsRequiredFields: string[];
5
+ export declare const deliveryAddressSpecification: AddressSpecifications;
6
+ export declare const termsAndConditionsUrlMap: {
7
+ at: {
8
+ en: string;
9
+ de: string;
10
+ };
11
+ ch: {
12
+ en: string;
13
+ de: string;
14
+ fr: string;
15
+ };
16
+ de: {
17
+ en: string;
18
+ de: string;
19
+ };
20
+ };
@@ -0,0 +1 @@
1
+ export { default } from './Riverty';
@@ -62,6 +62,8 @@ import Duitnow from './DuitNow';
62
62
  import ANCV from './ANCV';
63
63
  import Trustly from './Trustly';
64
64
  import PayMe from './PayMe';
65
+ import OnlineBankingFI from './OnlineBankingFI';
66
+ import Riverty from './Riverty';
65
67
  /**
66
68
  * Maps each component with a Component element.
67
69
  */
@@ -108,6 +110,7 @@ declare const componentsMap: {
108
110
  facilypay_12x: typeof FacilyPay12x;
109
111
  ratepay: typeof RatePay;
110
112
  ratepay_directdebit: typeof RatePayDirectDebit;
113
+ riverty: typeof Riverty;
111
114
  /** Open Invoice */
112
115
  /** Wallets */
113
116
  amazonpay: typeof AmazonPay;
@@ -161,6 +164,7 @@ declare const componentsMap: {
161
164
  payu_IN_cashcard: typeof PayuCashcard;
162
165
  payu_IN_nb: typeof PayuNetBanking;
163
166
  wallet_IN: typeof WalletINElement;
167
+ ebanking_FI: typeof OnlineBankingFI;
164
168
  /** issuerList */
165
169
  /** Dragonpay */
166
170
  dragonpay_ebanking: typeof Dragonpay;
@@ -8,7 +8,7 @@ declare namespace Address {
8
8
  data: {};
9
9
  onChange: () => void;
10
10
  visibility: string;
11
- requiredFields: readonly ["street", "houseNumberOrName", "postalCode", "city", "stateOrProvince", "country"];
11
+ requiredFields: readonly ["street", "houseNumberOrName", "postalCode", "city", "stateOrProvince", "country", "firstName", "lastName"];
12
12
  specifications: {};
13
13
  };
14
14
  }
@@ -1,7 +1,7 @@
1
1
  import { AddressSpecifications } from './types';
2
2
  export declare const FALLBACK_VALUE = "N/A";
3
- export declare const ADDRESS_SCHEMA: readonly ["street", "houseNumberOrName", "postalCode", "city", "stateOrProvince", "country"];
4
- export declare const STREET: "street", HOUSE_NUMBER_OR_NAME: "houseNumberOrName", POSTAL_CODE: "postalCode", CITY: "city", STATE_OR_PROVINCE: "stateOrProvince", COUNTRY: "country";
3
+ export declare const ADDRESS_SCHEMA: readonly ["street", "houseNumberOrName", "postalCode", "city", "stateOrProvince", "country", "firstName", "lastName"];
4
+ export declare const STREET: "street", HOUSE_NUMBER_OR_NAME: "houseNumberOrName", POSTAL_CODE: "postalCode", CITY: "city", STATE_OR_PROVINCE: "stateOrProvince", COUNTRY: "country", FIRST_NAME: "firstName", LAST_NAME: "lastName";
5
5
  export declare const ADDRESS_SPECIFICATIONS: AddressSpecifications;
6
6
  export declare const PARTIAL_ADDRESS_SCHEMA: AddressSpecifications;
7
7
  export declare const COUNTRIES_WITH_CUSTOM_SPECIFICATION: string[];
@@ -4,6 +4,9 @@ import { AddressSpecifications } from '../Address/types';
4
4
  import { UIElementProps } from '../../types';
5
5
  import UIElement from '../../UIElement';
6
6
  import { GenericError, ValidationRuleErrorObj } from '../../../core/Errors/types';
7
+ type OpenInvoiceAddressSpecification = AddressSpecifications & {
8
+ allowedCountries?: string[];
9
+ };
7
10
  export interface OpenInvoiceVisibility {
8
11
  companyDetails?: FieldsetVisibility;
9
12
  personalDetails?: FieldsetVisibility;
@@ -33,7 +36,9 @@ export interface OpenInvoiceProps extends UIElementProps {
33
36
  visibility?: OpenInvoiceVisibility;
34
37
  personalDetailsRequiredFields?: string[];
35
38
  billingAddressRequiredFields?: string[];
36
- billingAddressSpecification?: AddressSpecifications;
39
+ billingAddressSpecification?: OpenInvoiceAddressSpecification;
40
+ deliveryAddressRequiredFields?: string[];
41
+ deliveryAddressSpecification?: OpenInvoiceAddressSpecification;
37
42
  setComponentRef?: (ref: any) => void;
38
43
  showFormInstruction?: boolean;
39
44
  }
@@ -75,3 +80,4 @@ export interface OpenInvoiceFieldsetsRefs {
75
80
  deliveryAddress?: any;
76
81
  bankAccount?: any;
77
82
  }
83
+ export {};
@@ -1,3 +1,4 @@
1
1
  import { PaymentResponse, RawPaymentResponse, UIElementStatus } from './types';
2
2
  export declare function getSanitizedResponse(response: RawPaymentResponse): PaymentResponse;
3
3
  export declare function resolveFinalResult(result: PaymentResponse): [status: UIElementStatus, statusProps?: any];
4
+ export declare function getRegulatoryDefaults(countryCode: string): Record<string, any>;
@@ -82,6 +82,8 @@ export declare const defaultTranslation: {
82
82
  houseNumberOrName: string;
83
83
  separateDeliveryAddress: string;
84
84
  deliveryAddress: string;
85
+ "deliveryAddress.firstName": string;
86
+ "deliveryAddress.lastName": string;
85
87
  zipCode: string;
86
88
  apartmentSuite: string;
87
89
  provinceOrTerritory: string;