@adyen/adyen-web 5.8.0 → 5.9.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.
@@ -10,9 +10,21 @@ declare global {
10
10
  declare type ButtonColor = 'Gold' | 'LightGray' | 'DarkGray';
11
11
  declare type Placement = 'Home' | 'Product' | 'Cart' | 'Checkout' | 'Other';
12
12
  declare type ProductType = 'PayOnly' | 'PayAndShip';
13
+ declare type ChargePermissionType = 'OneTime' | 'Recurring';
14
+ declare type FrequencyUnit = 'Year' | 'Month' | 'Week' | 'Day' | 'Variable';
13
15
  export declare type Currency = 'EUR' | 'GBP' | 'USD';
14
16
  export declare type Region = 'EU' | 'UK' | 'US';
15
17
  export declare type SupportedLocale = typeof SUPPORTED_LOCALES_EU[number] | typeof SUPPORTED_LOCALES_US[number];
18
+ export interface RecurringMetadata {
19
+ frequency: {
20
+ unit: string;
21
+ value: FrequencyUnit;
22
+ };
23
+ amount: {
24
+ amount: string;
25
+ currencyCode: Currency;
26
+ };
27
+ }
16
28
  export interface AmazonPayConfiguration {
17
29
  merchantId?: string;
18
30
  publicKeyId?: string;
@@ -26,6 +38,7 @@ export interface AmazonPayElementProps {
26
38
  amount?: PaymentAmount;
27
39
  buttonColor?: ButtonColor;
28
40
  cancelUrl?: string;
41
+ chargePermissionType?: ChargePermissionType;
29
42
  clientKey?: string;
30
43
  configuration?: AmazonPayConfiguration;
31
44
  currency?: Currency;
@@ -40,6 +53,7 @@ export interface AmazonPayElementProps {
40
53
  payButton?: any;
41
54
  placement?: Placement;
42
55
  productType?: ProductType;
56
+ recurringMetadata?: RecurringMetadata;
43
57
  region?: Region;
44
58
  returnUrl?: string;
45
59
  showChangePaymentDetailsButton: boolean;
@@ -59,6 +73,7 @@ export interface AmazonPayButtonProps {
59
73
  amazonRef: any;
60
74
  buttonColor?: ButtonColor;
61
75
  cancelUrl?: string;
76
+ chargePermissionType?: ChargePermissionType;
62
77
  clientKey?: string;
63
78
  configuration?: AmazonPayConfiguration;
64
79
  currency?: Currency;
@@ -69,6 +84,7 @@ export interface AmazonPayButtonProps {
69
84
  onError: (error: any, component: any) => void;
70
85
  placement?: Placement;
71
86
  productType?: ProductType;
87
+ recurringMetadata?: RecurringMetadata;
72
88
  ref: any;
73
89
  region?: Region;
74
90
  returnUrl?: string;
@@ -90,7 +106,9 @@ export interface OrderButtonProps {
90
106
  amazonCheckoutSessionId: string;
91
107
  amount: PaymentAmount;
92
108
  clientKey: string;
109
+ chargePermissionType?: ChargePermissionType;
93
110
  onError: (error: any, component: any) => void;
111
+ recurringMetadata: RecurringMetadata;
94
112
  ref: any;
95
113
  region: Region;
96
114
  returnUrl: string;
@@ -158,6 +176,7 @@ export declare type LedgerCurrencies = {
158
176
  };
159
177
  export interface PayloadJSON {
160
178
  addressDetails?: AddressDetails;
179
+ chargePermissionType?: ChargePermissionType;
161
180
  deliverySpecifications?: DeliverySpecifications;
162
181
  merchantMetadata?: MerchantMetadata;
163
182
  paymentDetails?: {
@@ -166,6 +185,7 @@ export interface PayloadJSON {
166
185
  presentmentCurrency: Currency;
167
186
  totalOrderAmount: ChargeAmount;
168
187
  };
188
+ recurringMetadata?: RecurringMetadata;
169
189
  storeId: string;
170
190
  webCheckoutDetails: {
171
191
  checkoutCancelUrl?: string;
@@ -183,10 +203,12 @@ export interface CheckoutDetailsRequest {
183
203
  }
184
204
  export interface UpdateAmazonCheckoutSessionRequest {
185
205
  amount: PaymentAmount;
206
+ chargePermissionType?: ChargePermissionType;
186
207
  checkoutCancelUrl?: string;
187
208
  checkoutResultReturnUrl: string;
188
209
  checkoutSessionId: string;
189
210
  publicKeyId: string;
211
+ recurringMetadata?: RecurringMetadata;
190
212
  region: Region;
191
213
  }
192
214
  export interface CheckoutSessionConfig {
@@ -83,7 +83,7 @@ export interface ApplePayElementProps extends UIElementProps {
83
83
  applicationData?: string;
84
84
  onClick?: (resolve: any, reject: any) => void;
85
85
  onAuthorized?: (resolve: any, reject: any, event: ApplePayJS.ApplePayPaymentAuthorizedEvent) => void;
86
- onValidateMerchant?: (resolve: any, reject: any, event: ApplePayJS.ApplePayValidateMerchantEvent) => void;
86
+ onValidateMerchant?: (resolve: any, reject: any, validationURL: string) => void;
87
87
  /**
88
88
  * {@link https://developer.apple.com/documentation/apple_pay_on_the_web/applepaysession/1778013-onpaymentmethodselected}
89
89
  * @param resolve(ApplePayPaymentMethodUpdate update) Completes the selection of a payment method with an update.
@@ -1,3 +1,3 @@
1
1
  import { h } from 'preact';
2
2
  import { CardHolderNameProps } from './types';
3
- export default function CardHolderName({ onChange, onInput, placeholder, value, required, error, isValid }: CardHolderNameProps): h.JSX.Element;
3
+ export default function CardHolderName({ onBlur, onInput, placeholder, value, required, error, isValid }: CardHolderNameProps): h.JSX.Element;
@@ -24,7 +24,7 @@ export interface CardFieldsProps {
24
24
  export interface CardHolderNameProps {
25
25
  error: boolean;
26
26
  isValid: boolean;
27
- onChange: (event: Event) => void;
27
+ onBlur: (event: Event) => void;
28
28
  onInput: (event: Event) => void;
29
29
  placeholder?: string;
30
30
  required?: boolean;
@@ -107,7 +107,7 @@ export interface KCPProps {
107
107
  filled?: boolean;
108
108
  focusedElement: any;
109
109
  onFocusField: (str: string) => {};
110
- onChange: (event: Event) => void;
110
+ onBlur: (event: Event) => void;
111
111
  onInput: (event: Event) => void;
112
112
  taxNumber?: string;
113
113
  error: boolean;
@@ -1,4 +1,10 @@
1
1
  import { h } from 'preact';
2
2
  import { FieldContainerProps } from '../types';
3
+ /**
4
+ * USAGE: Specifically defined as a util to provide a wrapper for fields created within the Address component
5
+ *
6
+ * NOT TO BE USED: if you just want to add a Country or State dropdown outside of an Address component
7
+ * - then you should implement <CountryField> or <StateField> directly
8
+ */
3
9
  declare function FieldContainer(props: FieldContainerProps): h.JSX.Element;
4
10
  export default FieldContainer;
@@ -34,11 +34,12 @@ export interface FieldContainerProps {
34
34
  key: string;
35
35
  valid?: object;
36
36
  onInput?: (e: Event) => void;
37
- onChange?: (e: Event) => void;
37
+ onBlur?: (e: Event) => void;
38
38
  onDropdownChange: (e: Event) => void;
39
39
  readOnly?: boolean;
40
40
  specifications: Specifications;
41
41
  maxlength?: number;
42
+ trimOnBlur?: boolean;
42
43
  }
43
44
  export interface ReadOnlyAddressProps {
44
45
  data: AddressData;
@@ -1,6 +1,6 @@
1
1
  import { h } from 'preact';
2
- export default function ({ onChange, onInput, valid, error, data, required }: {
3
- onChange: any;
2
+ export default function ({ onBlur, onInput, valid, error, data, required }: {
3
+ onBlur: any;
4
4
  onInput: any;
5
5
  valid?: boolean;
6
6
  error?: any;
@@ -1,11 +1,12 @@
1
1
  import UIElement from '../components/UIElement';
2
+ import PaymentMethodsResponse from './ProcessResponse/PaymentMethodsResponse';
2
3
  import { PaymentAction } from '../types';
3
4
  import { CoreOptions } from './types';
4
5
  import { PaymentMethods, PaymentMethodOptions } from '../types';
5
6
  import Session from './CheckoutSession';
6
7
  declare class Core {
7
8
  session: Session;
8
- private paymentMethodsResponse;
9
+ paymentMethodsResponse: PaymentMethodsResponse;
9
10
  modules: any;
10
11
  options: CoreOptions;
11
12
  components: any[];
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.8.0",
26
+ "version": "5.9.0",
27
27
  "license": "MIT",
28
28
  "homepage": "https://docs.adyen.com/checkout",
29
29
  "repository": "github:Adyen/adyen-web",
@@ -51,7 +51,7 @@
51
51
  "devDependencies": {
52
52
  "@babel/cli": "^7.16.0",
53
53
  "@babel/core": "^7.16.0",
54
- "@babel/plugin-transform-runtime": "^7.15.8",
54
+ "@babel/plugin-transform-runtime": "^7.17.0",
55
55
  "@babel/preset-env": "^7.16.0",
56
56
  "@babel/preset-react": "^7.14.5",
57
57
  "@babel/preset-typescript": "^7.15.0",
@@ -67,7 +67,7 @@
67
67
  "@types/jest": "^26.0.23",
68
68
  "@typescript-eslint/eslint-plugin": "^4.28.3",
69
69
  "@typescript-eslint/parser": "^4.33.0",
70
- "autoprefixer": "^10.3.6",
70
+ "autoprefixer": "^10.4.2",
71
71
  "babel-jest": "^27.3.1",
72
72
  "cross-env": "^7.0.3",
73
73
  "cssnano": "^5.0.6",