@adyen/adyen-web 5.60.0 → 5.61.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.
- package/dist/adyen.js +1 -1
- package/dist/adyen.js.map +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/es/index.js +1 -1
- package/dist/es.modern/index.js +1 -1
- package/dist/types/components/AmazonPay/AmazonPay.d.ts +2 -0
- package/dist/types/components/AmazonPay/types.d.ts +9 -0
- package/dist/types/components/ApplePay/ApplePay.d.ts +3 -0
- package/dist/types/components/ApplePay/defaultProps.d.ts +1 -0
- package/dist/types/components/ApplePay/types.d.ts +9 -0
- package/dist/types/components/GooglePay/GooglePay.d.ts +3 -0
- package/dist/types/components/GooglePay/defaultProps.d.ts +1 -0
- package/dist/types/components/GooglePay/types.d.ts +9 -0
- package/dist/types/components/PayPal/Paypal.d.ts +2 -0
- package/dist/types/components/PayPal/types.d.ts +5 -1
- package/dist/types/components/internal/Address/Specifications.d.ts +0 -1
- package/dist/types/components/internal/FormFields/Select/components/SelectButton.d.ts +1 -1
- package/dist/types/core/Analytics/types.d.ts +29 -0
- package/dist/types/core/Analytics/utils.d.ts +2 -1
- package/dist/types/utils/validator-utils.d.ts +1 -1
- package/package.json +1 -1
|
@@ -2,9 +2,11 @@ import { h } from 'preact';
|
|
|
2
2
|
import UIElement from '../UIElement';
|
|
3
3
|
import { AmazonPayElementData, AmazonPayElementProps } from './types';
|
|
4
4
|
import './AmazonPay.scss';
|
|
5
|
+
import { SendAnalyticsObject } from '../../core/Analytics/types';
|
|
5
6
|
export declare class AmazonPayElement extends UIElement<AmazonPayElementProps> {
|
|
6
7
|
static type: string;
|
|
7
8
|
protected static defaultProps: Partial<AmazonPayElementProps>;
|
|
9
|
+
protected submitAnalytics(analyticsObj: SendAnalyticsObject): void;
|
|
8
10
|
formatProps(props: any): any;
|
|
9
11
|
/**
|
|
10
12
|
* Formats the component data output
|
|
@@ -63,6 +63,15 @@ export interface AmazonPayElementProps extends UIElementProps {
|
|
|
63
63
|
onClick: (resolve: any, reject: any) => Promise<void>;
|
|
64
64
|
onError: (error: any, component: any) => void;
|
|
65
65
|
onSignOut: (resolve: any, reject: any) => Promise<void>;
|
|
66
|
+
/**
|
|
67
|
+
* Used for analytics
|
|
68
|
+
*/
|
|
69
|
+
expressPage?: 'cart' | 'minicart' | 'pdp' | 'checkout';
|
|
70
|
+
/**
|
|
71
|
+
* Used for analytics
|
|
72
|
+
* @defaultValue false
|
|
73
|
+
*/
|
|
74
|
+
isExpress?: boolean;
|
|
66
75
|
}
|
|
67
76
|
export interface AmazonPayComponentProps extends AmazonPayElementProps {
|
|
68
77
|
ref: any;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { h } from 'preact';
|
|
2
2
|
import UIElement from '../UIElement';
|
|
3
3
|
import { ApplePayElementProps, ApplePayElementData } from './types';
|
|
4
|
+
import { SendAnalyticsObject } from '../../core/Analytics/types';
|
|
4
5
|
declare class ApplePayElement extends UIElement<ApplePayElementProps> {
|
|
5
6
|
protected static type: string;
|
|
6
7
|
protected static defaultProps: {
|
|
@@ -16,6 +17,7 @@ declare class ApplePayElement extends UIElement<ApplePayElementProps> {
|
|
|
16
17
|
merchantId: string;
|
|
17
18
|
};
|
|
18
19
|
initiative: string;
|
|
20
|
+
isExpress: boolean;
|
|
19
21
|
lineItems: any;
|
|
20
22
|
merchantCapabilities: string[];
|
|
21
23
|
shippingMethods: any;
|
|
@@ -37,6 +39,7 @@ declare class ApplePayElement extends UIElement<ApplePayElementProps> {
|
|
|
37
39
|
showPayButton: boolean;
|
|
38
40
|
};
|
|
39
41
|
constructor(props: any);
|
|
42
|
+
protected submitAnalytics(analyticsObj: SendAnalyticsObject): void;
|
|
40
43
|
/**
|
|
41
44
|
* Formats the component props
|
|
42
45
|
*/
|
|
@@ -14,6 +14,7 @@ declare const defaultProps: {
|
|
|
14
14
|
merchantId: string;
|
|
15
15
|
};
|
|
16
16
|
initiative: string;
|
|
17
|
+
isExpress: boolean;
|
|
17
18
|
/**
|
|
18
19
|
* https://developer.apple.com/documentation/apple_pay_on_the_web/applepaypaymentrequest/1916120-lineitems
|
|
19
20
|
* A set of line items that explain recurring payments and additional charges and discounts.
|
|
@@ -9,6 +9,15 @@ type Initiative = 'web' | 'messaging';
|
|
|
9
9
|
export type ApplePayButtonType = 'plain' | 'buy' | 'donate' | 'check-out' | 'book' | 'subscribe' | 'add-money' | 'contribute' | 'order' | 'reload' | 'rent' | 'support' | 'tip' | 'top-up';
|
|
10
10
|
export type OnAuthorizedCallback = (resolve: (result?: ApplePayJS.ApplePayPaymentAuthorizationResult) => void, reject: (result?: ApplePayJS.ApplePayPaymentAuthorizationResult) => void, event: ApplePayJS.ApplePayPaymentAuthorizedEvent) => void;
|
|
11
11
|
export interface ApplePayElementProps extends UIElementProps {
|
|
12
|
+
/**
|
|
13
|
+
* Used for analytics
|
|
14
|
+
* @defaultValue false
|
|
15
|
+
*/
|
|
16
|
+
isExpress?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Used for analytics
|
|
19
|
+
*/
|
|
20
|
+
expressPage?: 'cart' | 'minicart' | 'pdp' | 'checkout';
|
|
12
21
|
/**
|
|
13
22
|
* The Apple Pay version number your website supports.
|
|
14
23
|
* @default highest supported version by the shopper device
|
|
@@ -3,10 +3,12 @@ import { h } from 'preact';
|
|
|
3
3
|
import UIElement from '../UIElement';
|
|
4
4
|
import GooglePayService from './GooglePayService';
|
|
5
5
|
import { GooglePayProps } from './types';
|
|
6
|
+
import { SendAnalyticsObject } from '../../core/Analytics/types';
|
|
6
7
|
declare class GooglePay extends UIElement<GooglePayProps> {
|
|
7
8
|
static type: string;
|
|
8
9
|
static defaultProps: {
|
|
9
10
|
environment: string;
|
|
11
|
+
isExpress: boolean;
|
|
10
12
|
existingPaymentMethodRequired: boolean;
|
|
11
13
|
buttonColor: google.payments.api.ButtonColor;
|
|
12
14
|
buttonType: google.payments.api.ButtonType;
|
|
@@ -40,6 +42,7 @@ declare class GooglePay extends UIElement<GooglePayProps> {
|
|
|
40
42
|
paymentMethods: any[];
|
|
41
43
|
};
|
|
42
44
|
protected googlePay: GooglePayService;
|
|
45
|
+
protected submitAnalytics(analyticsObj: SendAnalyticsObject): void;
|
|
43
46
|
/**
|
|
44
47
|
* Formats the component data input
|
|
45
48
|
* For legacy support - maps configuration.merchantIdentifier to configuration.merchantId
|
|
@@ -82,6 +82,15 @@ export interface GooglePayProps extends UIElementProps {
|
|
|
82
82
|
* @defaultValue false
|
|
83
83
|
*/
|
|
84
84
|
emailRequired?: boolean;
|
|
85
|
+
/**
|
|
86
|
+
* Used for analytics
|
|
87
|
+
*/
|
|
88
|
+
expressPage?: 'cart' | 'minicart' | 'pdp' | 'checkout';
|
|
89
|
+
/**
|
|
90
|
+
* Used for analytics
|
|
91
|
+
* @defaultValue false
|
|
92
|
+
*/
|
|
93
|
+
isExpress?: boolean;
|
|
85
94
|
/**
|
|
86
95
|
* Set to true to request a full shipping address.
|
|
87
96
|
* @defaultValue false
|
|
@@ -3,6 +3,7 @@ import UIElement from '../UIElement';
|
|
|
3
3
|
import { PaymentAction } from '../../types';
|
|
4
4
|
import { PayPalElementProps } from './types';
|
|
5
5
|
import './Paypal.scss';
|
|
6
|
+
import { SendAnalyticsObject } from '../../core/Analytics/types';
|
|
6
7
|
declare class PaypalElement extends UIElement<PayPalElementProps> {
|
|
7
8
|
static type: string;
|
|
8
9
|
static subtype: string;
|
|
@@ -11,6 +12,7 @@ declare class PaypalElement extends UIElement<PayPalElementProps> {
|
|
|
11
12
|
private reject;
|
|
12
13
|
protected static defaultProps: PayPalElementProps;
|
|
13
14
|
constructor(props: any);
|
|
15
|
+
protected submitAnalytics(analyticsObj: SendAnalyticsObject): void;
|
|
14
16
|
formatProps(props: PayPalElementProps): PayPalElementProps;
|
|
15
17
|
submit: () => void;
|
|
16
18
|
/**
|
|
@@ -133,10 +133,14 @@ interface PayPalCommonProps {
|
|
|
133
133
|
reject: (reason?: string) => Promise<void>;
|
|
134
134
|
}) => Promise<void>;
|
|
135
135
|
/**
|
|
136
|
-
* Identifies if the payment is Express.
|
|
136
|
+
* Identifies if the payment is Express. Also used for analytics.
|
|
137
137
|
* @defaultValue false
|
|
138
138
|
*/
|
|
139
139
|
isExpress?: boolean;
|
|
140
|
+
/**
|
|
141
|
+
* Used for analytics
|
|
142
|
+
*/
|
|
143
|
+
expressPage?: 'cart' | 'minicart' | 'pdp' | 'checkout';
|
|
140
144
|
}
|
|
141
145
|
export interface PayPalConfig {
|
|
142
146
|
/**
|
|
@@ -50,7 +50,6 @@ declare class Specifications {
|
|
|
50
50
|
* Returns an array with the address schema of the selected country or the default address schema
|
|
51
51
|
* Flat version of getAddressSchemaForCountry
|
|
52
52
|
* @param country - The selected country
|
|
53
|
-
* @param mode - Address schema mode, can be 'full', 'partial' or 'none'
|
|
54
53
|
* @returns Array
|
|
55
54
|
*/
|
|
56
55
|
getAddressSchemaForCountryFlat(country: string): AddressField[];
|
|
@@ -5,6 +5,29 @@ export interface Experiment {
|
|
|
5
5
|
experimentId: string;
|
|
6
6
|
experimentName?: string;
|
|
7
7
|
}
|
|
8
|
+
export interface AnalyticsData {
|
|
9
|
+
/**
|
|
10
|
+
* Relates to PMs used within Plugins
|
|
11
|
+
* https://docs.adyen.com/development-resources/application-information/?tab=integrator_built_2#application-information-fields
|
|
12
|
+
* @internal
|
|
13
|
+
*/
|
|
14
|
+
applicationInfo?: {
|
|
15
|
+
externalPlatform: {
|
|
16
|
+
name: string;
|
|
17
|
+
version: string;
|
|
18
|
+
integrator: string;
|
|
19
|
+
};
|
|
20
|
+
merchantApplication: {
|
|
21
|
+
name: string;
|
|
22
|
+
version: string;
|
|
23
|
+
};
|
|
24
|
+
merchantDevice?: {
|
|
25
|
+
os: string;
|
|
26
|
+
osVersion: string;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
export declare const ALLOWED_ANALYTICS_DATA: string[];
|
|
8
31
|
export interface AnalyticsOptions {
|
|
9
32
|
/**
|
|
10
33
|
* Enable/Disable all analytics
|
|
@@ -26,6 +49,10 @@ export interface AnalyticsOptions {
|
|
|
26
49
|
* List of experiments to be sent in the collectId call // TODO - still used?
|
|
27
50
|
*/
|
|
28
51
|
experiments?: Experiment[];
|
|
52
|
+
/**
|
|
53
|
+
* A wrapper to pass data needed when analytics is setup
|
|
54
|
+
*/
|
|
55
|
+
analyticsData?: AnalyticsData;
|
|
29
56
|
}
|
|
30
57
|
export type AnalyticsProps = Pick<CoreOptions, 'loadingContext' | 'locale' | 'clientKey' | 'analytics' | 'amount'> & {
|
|
31
58
|
analyticsContext?: string;
|
|
@@ -46,6 +73,8 @@ export interface AnalyticsObject {
|
|
|
46
73
|
validationErrorCode?: string;
|
|
47
74
|
validationErrorMessage?: string;
|
|
48
75
|
issuer?: string;
|
|
76
|
+
isExpress?: boolean;
|
|
77
|
+
expressPage?: string;
|
|
49
78
|
}
|
|
50
79
|
export type ANALYTICS_EVENT = 'log' | 'error' | 'info';
|
|
51
80
|
export type CreateAnalyticsObject = Omit<AnalyticsObject, 'timestamp' | 'id'> & {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AnalyticsObject, CreateAnalyticsObject } from './types';
|
|
1
|
+
import { AnalyticsData, AnalyticsObject, CreateAnalyticsObject } from './types';
|
|
2
2
|
export declare const getUTCTimestamp: () => number;
|
|
3
3
|
/**
|
|
4
4
|
* All objects for the /checkoutanalytics endpoint have base props:
|
|
@@ -19,3 +19,4 @@ export declare const getUTCTimestamp: () => number;
|
|
|
19
19
|
* All objects can also have a "metadata" object of key-value pairs
|
|
20
20
|
*/
|
|
21
21
|
export declare const createAnalyticsObject: (aObj: CreateAnalyticsObject) => AnalyticsObject;
|
|
22
|
+
export declare const processAnalyticsData: (analyticsData: AnalyticsData) => {};
|
|
@@ -3,7 +3,7 @@ export declare const getMaxLengthByFieldAndCountry: (formattingRules: CountryFor
|
|
|
3
3
|
export declare const isEmpty: (input: any) => boolean;
|
|
4
4
|
export declare const isString: (input: any) => boolean;
|
|
5
5
|
export declare const hasText: (input: any) => boolean;
|
|
6
|
-
export declare const SPECIAL_CHARS = "?\\+_=!@#$%^&*(){}~<>\\[\\]
|
|
6
|
+
export declare const SPECIAL_CHARS = "?\\+_=!@#$%^&*(){}~<>\\[\\]\\\\";
|
|
7
7
|
export declare const getFormattingRegEx: (specChars: string, flags?: string) => RegExp;
|
|
8
8
|
export declare const getValidatingRegEx: (specChars: string, exclude: boolean) => RegExp;
|
|
9
9
|
export declare const CHARACTER_PATTERNS: {
|
package/package.json
CHANGED