@adyen/adyen-web 5.59.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.
Files changed (91) hide show
  1. package/dist/adyen.js +1 -1
  2. package/dist/adyen.js.map +1 -1
  3. package/dist/cjs/index.js +1 -1
  4. package/dist/es/index.js +1 -1
  5. package/dist/es.modern/index.js +1 -1
  6. package/dist/types/components/Ach/Ach.d.ts +2 -1
  7. package/dist/types/components/AmazonPay/AmazonPay.d.ts +2 -0
  8. package/dist/types/components/AmazonPay/types.d.ts +9 -0
  9. package/dist/types/components/ApplePay/ApplePay.d.ts +3 -0
  10. package/dist/types/components/ApplePay/defaultProps.d.ts +1 -0
  11. package/dist/types/components/ApplePay/types.d.ts +10 -8
  12. package/dist/types/components/BaseElement.d.ts +3 -0
  13. package/dist/types/components/BcmcMobile/BcmcMobile.d.ts +2 -1
  14. package/dist/types/components/Card/Bancontact.d.ts +4 -2
  15. package/dist/types/components/Card/Card.d.ts +18 -9
  16. package/dist/types/components/Card/components/CardInput/components/CardFieldsWrapper.d.ts +4 -2
  17. package/dist/types/components/Card/components/CardInput/components/CardHolderName.d.ts +1 -1
  18. package/dist/types/components/Card/components/CardInput/components/types.d.ts +4 -0
  19. package/dist/types/components/Card/components/CardInput/types.d.ts +5 -3
  20. package/dist/types/components/Card/components/CardInput/utils.d.ts +1 -1
  21. package/dist/types/components/Card/types.d.ts +13 -4
  22. package/dist/types/components/CashAppPay/CashAppPay.d.ts +2 -1
  23. package/dist/types/components/ClickToPay/ClickToPay.d.ts +2 -1
  24. package/dist/types/components/Donation/Donation.d.ts +4 -1
  25. package/dist/types/components/Donation/components/types.d.ts +2 -2
  26. package/dist/types/components/Donation/types.d.ts +17 -0
  27. package/dist/types/components/Dragonpay/Dragonpay.d.ts +2 -1
  28. package/dist/types/components/Dropin/Dropin.d.ts +2 -1
  29. package/dist/types/components/DuitNow/DuitNow.d.ts +2 -1
  30. package/dist/types/components/GooglePay/GooglePay.d.ts +3 -0
  31. package/dist/types/components/GooglePay/defaultProps.d.ts +1 -0
  32. package/dist/types/components/GooglePay/types.d.ts +9 -0
  33. package/dist/types/components/PayMe/PayMe.d.ts +2 -1
  34. package/dist/types/components/PayNow/PayNow.d.ts +2 -1
  35. package/dist/types/components/PayPal/Paypal.d.ts +2 -0
  36. package/dist/types/components/PayPal/types.d.ts +5 -1
  37. package/dist/types/components/PromptPay/PromptPay.d.ts +2 -1
  38. package/dist/types/components/Riverty/Riverty.d.ts +2 -1
  39. package/dist/types/components/SecuredFields/SecuredFields.d.ts +1 -0
  40. package/dist/types/components/Swish/Swish.d.ts +2 -1
  41. package/dist/types/components/ThreeDS2/ThreeDS2Challenge.d.ts +6 -1
  42. package/dist/types/components/ThreeDS2/ThreeDS2DeviceFingerprint.d.ts +12 -7
  43. package/dist/types/components/ThreeDS2/components/Challenge/DoChallenge3DS2.d.ts +2 -1
  44. package/dist/types/components/ThreeDS2/components/Challenge/PrepareChallenge3DS2.d.ts +4 -3
  45. package/dist/types/components/ThreeDS2/components/Challenge/types.d.ts +3 -0
  46. package/dist/types/components/ThreeDS2/components/DeviceFingerprint/DoFingerprint3DS2.d.ts +2 -1
  47. package/dist/types/components/ThreeDS2/components/DeviceFingerprint/PrepareFingerprint3DS2.d.ts +7 -4
  48. package/dist/types/components/ThreeDS2/components/DeviceFingerprint/types.d.ts +6 -1
  49. package/dist/types/components/ThreeDS2/components/Form/ThreeDS2Form.d.ts +1 -0
  50. package/dist/types/components/ThreeDS2/components/utils.d.ts +9 -3
  51. package/dist/types/components/ThreeDS2/config.d.ts +9 -0
  52. package/dist/types/components/ThreeDS2/types.d.ts +4 -0
  53. package/dist/types/components/UIElement.d.ts +11 -0
  54. package/dist/types/components/WeChat/WeChat.d.ts +3 -1
  55. package/dist/types/components/internal/Address/Address.d.ts +2 -0
  56. package/dist/types/components/internal/Address/Specifications.d.ts +0 -1
  57. package/dist/types/components/internal/Address/types.d.ts +8 -12
  58. package/dist/types/components/internal/Address/utils.d.ts +0 -2
  59. package/dist/types/components/internal/FormFields/Select/Select.d.ts +1 -1
  60. package/dist/types/components/internal/FormFields/Select/components/SelectButton.d.ts +1 -1
  61. package/dist/types/components/internal/FormFields/Select/types.d.ts +6 -4
  62. package/dist/types/components/internal/IssuerList/types.d.ts +2 -0
  63. package/dist/types/components/internal/QRLoader/types.d.ts +2 -0
  64. package/dist/types/components/internal/SecuredFields/lib/configuration/constants.d.ts +2 -1
  65. package/dist/types/components/internal/SecuredFields/utils.d.ts +3 -13
  66. package/dist/types/components/internal/SocialSecurityNumberBrazil/SocialSecurityNumberBrazil.d.ts +3 -1
  67. package/dist/types/components/types.d.ts +23 -3
  68. package/dist/types/core/Analytics/Analytics.d.ts +3 -13
  69. package/dist/types/core/Analytics/EventsQueue.d.ts +13 -5
  70. package/dist/types/core/Analytics/analyticsPreProcessor.d.ts +3 -0
  71. package/dist/types/core/Analytics/constants.d.ts +72 -0
  72. package/dist/types/core/Analytics/types.d.ts +83 -1
  73. package/dist/types/core/Analytics/utils.d.ts +22 -0
  74. package/dist/types/core/Environment/Environment.d.ts +2 -0
  75. package/dist/types/core/Environment/index.d.ts +1 -1
  76. package/dist/types/core/Errors/types.d.ts +4 -0
  77. package/dist/types/core/Errors/utils.d.ts +1 -0
  78. package/dist/types/core/Services/analytics/collect-id.d.ts +5 -4
  79. package/dist/types/core/Services/analytics/log-event.d.ts +2 -1
  80. package/dist/types/core/Services/analytics/types.d.ts +17 -7
  81. package/dist/types/core/Services/http.d.ts +1 -1
  82. package/dist/types/core/core.d.ts +1 -0
  83. package/dist/types/core/types.d.ts +3 -1
  84. package/dist/types/utils/Formatters/formatters.d.ts +1 -0
  85. package/dist/types/utils/Storage.d.ts +3 -0
  86. package/dist/types/utils/base64.d.ts +4 -1
  87. package/dist/types/utils/debounce.d.ts +2 -0
  88. package/dist/types/utils/textUtils.d.ts +1 -0
  89. package/dist/types/utils/validator-utils.d.ts +1 -1
  90. package/package.json +2 -2
  91. package/dist/types/core/Services/analytics/post-telemetry.d.ts +0 -13
@@ -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
  /**
@@ -31,6 +31,7 @@ declare class PromptPayElement extends QRLoaderContainer {
31
31
  icon?: string;
32
32
  amount?: import("../../types").PaymentAmount;
33
33
  secondaryAmount?: import("../../types").PaymentAmountExtended;
34
+ brand?: string;
34
35
  showPayButton?: boolean;
35
36
  setStatusAutomatically?: boolean;
36
37
  payButton?: (options: import("../types").PayButtonFunctionProps) => import("preact").JSX.Element;
@@ -44,7 +45,7 @@ declare class PromptPayElement extends QRLoaderContainer {
44
45
  order?: import("../../types").Order;
45
46
  modules?: {
46
47
  srPanel?: import("../../core/Errors/SRPanel").SRPanel;
47
- analytics?: import("../../core/Analytics/Analytics").default;
48
+ analytics?: import("../types").AnalyticsModule;
48
49
  resources?: import("../../core/Context/Resources").Resources;
49
50
  risk?: import("../../core/RiskModule").default;
50
51
  };
@@ -42,6 +42,7 @@ export default class Riverty extends OpenInvoiceContainer {
42
42
  icon?: string;
43
43
  amount?: import("../../types").PaymentAmount;
44
44
  secondaryAmount?: import("../../types").PaymentAmountExtended;
45
+ brand?: string;
45
46
  setStatusAutomatically?: boolean;
46
47
  loadingContext?: string;
47
48
  createFromAction?: (action: import("../../types").PaymentAction, props: object) => import("../UIElement").UIElement<any>;
@@ -53,7 +54,7 @@ export default class Riverty extends OpenInvoiceContainer {
53
54
  order?: import("../../types").Order;
54
55
  modules?: {
55
56
  srPanel?: import("../../core/Errors/SRPanel").SRPanel;
56
- analytics?: import("../../core/Analytics/Analytics").default;
57
+ analytics?: import("../types").AnalyticsModule;
57
58
  resources?: import("../../core/Context/Resources").Resources;
58
59
  risk?: import("../../core/RiskModule").default;
59
60
  };
@@ -25,6 +25,7 @@ export declare class SecuredFieldsElement extends UIElement {
25
25
  onBinValue: (callbackObj: import("../internal/SecuredFields/lib/types").CbObjOnBinValue) => void;
26
26
  get isValid(): boolean;
27
27
  get browserInfo(): import("../../types").BrowserInfo;
28
+ private onFocus;
28
29
  render(): h.JSX.Element;
29
30
  }
30
31
  export default SecuredFieldsElement;
@@ -31,6 +31,7 @@ declare class SwishElement extends QRLoaderContainer {
31
31
  icon?: string;
32
32
  amount?: import("../../types").PaymentAmount;
33
33
  secondaryAmount?: import("../../types").PaymentAmountExtended;
34
+ brand?: string;
34
35
  showPayButton?: boolean;
35
36
  setStatusAutomatically?: boolean;
36
37
  payButton?: (options: import("../types").PayButtonFunctionProps) => import("preact").JSX.Element;
@@ -44,7 +45,7 @@ declare class SwishElement extends QRLoaderContainer {
44
45
  order?: import("../../types").Order;
45
46
  modules?: {
46
47
  srPanel?: import("../../core/Errors/SRPanel").SRPanel;
47
- analytics?: import("../../core/Analytics/Analytics").default;
48
+ analytics?: import("../types").AnalyticsModule;
48
49
  resources?: import("../../core/Context/Resources").Resources;
49
50
  risk?: import("../../core/RiskModule").default;
50
51
  };
@@ -2,7 +2,8 @@ import { h } from 'preact';
2
2
  import UIElement from '../UIElement';
3
3
  import { ErrorCodeObject } from './components/utils';
4
4
  import Language from '../../language';
5
- import { ActionHandledReturnObject } from '../types';
5
+ import { ActionHandledReturnObject, AnalyticsModule } from '../types';
6
+ import { SendAnalyticsObject } from '../../core/Analytics/types';
6
7
  export interface ThreeDS2ChallengeProps {
7
8
  token?: string;
8
9
  dataKey?: string;
@@ -16,6 +17,9 @@ export interface ThreeDS2ChallengeProps {
16
17
  useOriginalFlow?: boolean;
17
18
  i18n?: Language;
18
19
  onActionHandled: (rtnObj: ActionHandledReturnObject) => void;
20
+ modules?: {
21
+ analytics: AnalyticsModule;
22
+ };
19
23
  }
20
24
  declare class ThreeDS2Challenge extends UIElement<ThreeDS2ChallengeProps> {
21
25
  static type: string;
@@ -24,6 +28,7 @@ declare class ThreeDS2Challenge extends UIElement<ThreeDS2ChallengeProps> {
24
28
  size: string;
25
29
  type: string;
26
30
  };
31
+ protected submitAnalytics: (aObj: SendAnalyticsObject) => void;
27
32
  onComplete(state: any): void;
28
33
  render(): h.JSX.Element;
29
34
  }
@@ -1,20 +1,24 @@
1
1
  import { h } from 'preact';
2
2
  import UIElement from '../UIElement';
3
3
  import { ErrorCodeObject } from './components/utils';
4
- import { ActionHandledReturnObject } from '../types';
4
+ import { ActionHandledReturnObject, AnalyticsModule } from '../types';
5
+ import { SendAnalyticsObject } from '../../core/Analytics/types';
5
6
  export interface ThreeDS2DeviceFingerprintProps {
6
- dataKey: string;
7
- token: string;
8
- notificationURL: string;
9
- onError: (error?: string | ErrorCodeObject) => void;
10
- paymentData: string;
7
+ dataKey?: string;
8
+ token?: string;
9
+ notificationURL?: string;
10
+ onError?: (error?: string | ErrorCodeObject) => void;
11
+ paymentData?: string;
11
12
  showSpinner: boolean;
12
- type: string;
13
+ type?: string;
13
14
  useOriginalFlow?: boolean;
14
15
  loadingContext?: string;
15
16
  clientKey?: string;
16
17
  elementRef?: UIElement;
17
18
  onActionHandled: (rtnObj: ActionHandledReturnObject) => void;
19
+ modules?: {
20
+ analytics: AnalyticsModule;
21
+ };
18
22
  }
19
23
  declare class ThreeDS2DeviceFingerprint extends UIElement<ThreeDS2DeviceFingerprintProps> {
20
24
  static type: string;
@@ -23,6 +27,7 @@ declare class ThreeDS2DeviceFingerprint extends UIElement<ThreeDS2DeviceFingerpr
23
27
  type: string;
24
28
  };
25
29
  private callSubmit3DS2Fingerprint;
30
+ protected submitAnalytics: (aObj: SendAnalyticsObject) => void;
26
31
  onComplete(state: any): void;
27
32
  render(): h.JSX.Element;
28
33
  }
@@ -8,10 +8,11 @@ declare class DoChallenge3DS2 extends Component<DoChallenge3DS2Props, DoChalleng
8
8
  private get3DS2ChallengePromise;
9
9
  componentDidMount(): void;
10
10
  componentWillUnmount(): void;
11
- render({ acsURL, cReqData, iframeSizeArr }: {
11
+ render({ acsURL, cReqData, iframeSizeArr, onFormSubmit }: {
12
12
  acsURL: any;
13
13
  cReqData: any;
14
14
  iframeSizeArr: any;
15
+ onFormSubmit: any;
15
16
  }, { base64URLencodedData, status }: {
16
17
  base64URLencodedData: any;
17
18
  status: any;
@@ -2,6 +2,7 @@ import { Component, h } from 'preact';
2
2
  import { PrepareChallenge3DS2Props, PrepareChallenge3DS2State } from './types';
3
3
  import '../../ThreeDS2.scss';
4
4
  import './challenge.scss';
5
+ import { ActionHandledReturnObject } from '../../../types';
5
6
  declare class PrepareChallenge3DS2 extends Component<PrepareChallenge3DS2Props, PrepareChallenge3DS2State> {
6
7
  static defaultProps: {
7
8
  onComplete: () => void;
@@ -9,11 +10,11 @@ declare class PrepareChallenge3DS2 extends Component<PrepareChallenge3DS2Props,
9
10
  onActionHandled: () => void;
10
11
  };
11
12
  constructor(props: any);
13
+ onActionHandled: (rtnObj: ActionHandledReturnObject) => void;
14
+ onFormSubmit: (msg: string) => void;
12
15
  setStatusComplete(resultObj: any): void;
13
16
  setStatusError(errorInfoObj: any): void;
14
- render({ onActionHandled }: {
15
- onActionHandled: any;
16
- }, { challengeData }: {
17
+ render(_: any, { challengeData }: {
17
18
  challengeData: any;
18
19
  }): h.JSX.Element;
19
20
  }
@@ -2,10 +2,12 @@ import { ChallengeData, ThreeDS2FlowObject } from '../../types';
2
2
  import { ChallengeResolveData } from '../utils';
3
3
  import { ThreeDS2ChallengeProps } from '../../ThreeDS2Challenge';
4
4
  import { ActionHandledReturnObject } from '../../../types';
5
+ import { SendAnalyticsObject } from '../../../../core/Analytics/types';
5
6
  export interface DoChallenge3DS2Props extends ChallengeData {
6
7
  onCompleteChallenge: (resolveObject: ThreeDS2FlowObject) => void;
7
8
  onErrorChallenge: (rejectObject: ThreeDS2FlowObject) => void;
8
9
  onActionHandled: (rtnObj: ActionHandledReturnObject) => void;
10
+ onFormSubmit: (msg: string) => void;
9
11
  }
10
12
  export interface DoChallenge3DS2State {
11
13
  base64URLencodedData?: string;
@@ -13,6 +15,7 @@ export interface DoChallenge3DS2State {
13
15
  }
14
16
  export interface PrepareChallenge3DS2Props extends ThreeDS2ChallengeProps {
15
17
  onComplete?: (data: ChallengeResolveData) => void;
18
+ onSubmitAnalytics: (aObj: SendAnalyticsObject) => void;
16
19
  }
17
20
  export interface PrepareChallenge3DS2State {
18
21
  challengeData?: ChallengeData;
@@ -19,9 +19,10 @@ declare class DoFingerprint3DS2 extends Component<DoFingerprint3DS2Props, DoFing
19
19
  get3DS2MethodPromise(): Promise<unknown>;
20
20
  componentDidMount(): void;
21
21
  componentWillUnmount(): void;
22
- render({ threeDSMethodURL, onActionHandled }: {
22
+ render({ threeDSMethodURL, onActionHandled, onFormSubmit }: {
23
23
  threeDSMethodURL: any;
24
24
  onActionHandled: any;
25
+ onFormSubmit: any;
25
26
  }, { base64URLencodedData }: {
26
27
  base64URLencodedData: any;
27
28
  }): h.JSX.Element;
@@ -1,9 +1,9 @@
1
1
  import { Component, h } from 'preact';
2
2
  import { PrepareFingerprint3DS2Props, PrepareFingerprint3DS2State } from './types';
3
3
  import { ResultObject } from '../../types';
4
+ import { ActionHandledReturnObject } from '../../../types';
4
5
  declare class PrepareFingerprint3DS2 extends Component<PrepareFingerprint3DS2Props, PrepareFingerprint3DS2State> {
5
6
  static type: string;
6
- constructor(props: any);
7
7
  static defaultProps: {
8
8
  onComplete: () => void;
9
9
  onError: () => void;
@@ -11,12 +11,15 @@ declare class PrepareFingerprint3DS2 extends Component<PrepareFingerprint3DS2Pro
11
11
  showSpinner: boolean;
12
12
  onActionHandled: () => void;
13
13
  };
14
+ constructor(props: any);
15
+ onActionHandled: (rtnObj: ActionHandledReturnObject) => void;
16
+ onFormSubmit: (msg: string) => void;
14
17
  componentDidMount(): void;
15
18
  setStatusComplete(resultObj: ResultObject): void;
16
- render({ showSpinner, onActionHandled }: {
19
+ render({ showSpinner }: {
17
20
  showSpinner: any;
18
- onActionHandled: any;
19
- }, { fingerPrintData }: {
21
+ }, { status, fingerPrintData }: {
22
+ status: any;
20
23
  fingerPrintData: any;
21
24
  }): h.JSX.Element;
22
25
  }
@@ -2,19 +2,24 @@ import { ThreeDS2FlowObject, FingerPrintData } from '../../types';
2
2
  import { ThreeDS2DeviceFingerprintProps } from '../../ThreeDS2DeviceFingerprint';
3
3
  import { FingerprintResolveData } from '../utils';
4
4
  import { ActionHandledReturnObject } from '../../../types';
5
+ import { SendAnalyticsObject } from '../../../../core/Analytics/types';
6
+ import { ErrorObject } from '../../../../core/Errors/types';
5
7
  export interface DoFingerprint3DS2Props extends FingerPrintData {
6
8
  onCompleteFingerprint: (resolveObject: ThreeDS2FlowObject) => void;
7
9
  onErrorFingerprint: (rejectObject: ThreeDS2FlowObject) => void;
8
10
  showSpinner: boolean;
9
11
  onActionHandled: (rtnObj: ActionHandledReturnObject) => void;
12
+ onFormSubmit: (msg: string) => void;
10
13
  }
11
14
  export interface DoFingerprint3DS2State {
12
15
  base64URLencodedData: string;
13
16
  }
14
17
  export interface PrepareFingerprint3DS2Props extends ThreeDS2DeviceFingerprintProps {
15
18
  onComplete: (data: FingerprintResolveData) => void;
19
+ onSubmitAnalytics: (aObj: SendAnalyticsObject) => void;
20
+ isMDFlow: boolean;
16
21
  }
17
22
  export interface PrepareFingerprint3DS2State {
18
23
  status?: string;
19
- fingerPrintData?: FingerPrintData;
24
+ fingerPrintData?: FingerPrintData | ErrorObject;
20
25
  }
@@ -5,6 +5,7 @@ interface ThreeDS2FormProps {
5
5
  target: string;
6
6
  inputName: string;
7
7
  inputValue: string;
8
+ onFormSubmit: (msg: string) => void;
8
9
  }
9
10
  export default class ThreeDS2Form extends Component<ThreeDS2FormProps> {
10
11
  protected formEl: any;
@@ -1,4 +1,5 @@
1
1
  import { ChallengeData, ThreeDS2Token, FingerPrintData, ResultObject } from '../types';
2
+ import { ErrorObject } from '../../../core/Errors/types';
2
3
  export interface FingerprintResolveData {
3
4
  data: {
4
5
  [key: string]: string;
@@ -16,7 +17,12 @@ export interface ErrorCodeObject {
16
17
  errorCode: string;
17
18
  message: string;
18
19
  }
19
- export declare const decodeAndParseToken: (token: string) => ThreeDS2Token;
20
+ /**
21
+ * Check if we have been passed an ErrorObject because either base64 decoding or JSON.parse failed
22
+ * @param obj -
23
+ */
24
+ export declare const isErrorObject: (obj: ErrorObject | ThreeDS2Token) => boolean;
25
+ export declare const decodeAndParseToken: (token: string) => ThreeDS2Token | ErrorObject;
20
26
  /**
21
27
  * Performs JSON.stringify on passed object & and base64 encodes result
22
28
  * @param obj -
@@ -45,7 +51,7 @@ export declare const getChallengeWindowSize: (sizeStr: string) => string[];
45
51
  export declare const prepareChallengeData: ({ token, size }: {
46
52
  token: any;
47
53
  size: any;
48
- }) => ChallengeData;
54
+ }) => ChallengeData | ErrorObject;
49
55
  /**
50
56
  * prepareFingerPrintData
51
57
  *
@@ -62,7 +68,7 @@ export declare const prepareChallengeData: ({ token, size }: {
62
68
  export declare const prepareFingerPrintData: ({ token, notificationURL }: {
63
69
  token: any;
64
70
  notificationURL: any;
65
- }) => FingerPrintData;
71
+ }) => FingerPrintData | ErrorObject;
66
72
  export declare const createFingerprintResolveData: (dataKey: string, resultObj: ResultObject, paymentData: string) => FingerprintResolveData;
67
73
  export declare const createOldFingerprintResolveData: (dataKey: string, resultObj: ResultObject, paymentData: string) => any;
68
74
  export declare const createChallengeResolveData: (dataKey: string, transStatus: string, authorisationToken: string) => ChallengeResolveData;
@@ -1,4 +1,13 @@
1
1
  import { ThreeDS2FlowObject } from './types';
2
+ export declare const THREEDS2_FINGERPRINT = "threeDS2Fingerprint";
3
+ export declare const THREEDS2_FINGERPRINT_ERROR = "3DS2Fingerprint_Error";
4
+ export declare const THREEDS2_FINGERPRINT_SUBMIT = "callSubmit3DS2Fingerprint_Response";
5
+ export declare const THREEDS2_CHALLENGE = "threeDS2Challenge";
6
+ export declare const THREEDS2_CHALLENGE_ERROR = "3DS2Challenge_Error";
7
+ export declare const THREEDS2_ERROR = "threeDS2Error";
8
+ export declare const THREEDS2_FULL = "threeDS2";
9
+ export declare const THREEDS2_NUM = "3DS2";
10
+ export declare const MISSING_TOKEN_IN_ACTION_MSG = "Missing \"token\" property from threeDS2 action";
2
11
  export declare const DEFAULT_CHALLENGE_WINDOW_SIZE = "02";
3
12
  export declare const THREEDS_METHOD_TIMEOUT = 10000;
4
13
  export declare const CHALLENGE_TIMEOUT = 600000;
@@ -1,3 +1,4 @@
1
+ import { ANALYTICS_EVENT, AnalyticsObject } from '../../core/Analytics/types';
1
2
  /**
2
3
  * See
3
4
  * https://docs.adyen.com/checkout/3d-secure/api-reference#threeds2result
@@ -67,4 +68,7 @@ type CheckoutThreeDS2Action = {
67
68
  subtype: string;
68
69
  authorisationToken: string;
69
70
  };
71
+ export type ThreeDS2AnalyticsObject = Pick<AnalyticsObject, 'code' | 'errorType' | 'message' | 'type' | 'metadata'> & {
72
+ event: ANALYTICS_EVENT;
73
+ };
70
74
  export {};
@@ -7,12 +7,23 @@ import AdyenCheckoutError from '../core/Errors/AdyenCheckoutError';
7
7
  import { UIElementStatus } from './types';
8
8
  import { CoreOptions } from '../core/types';
9
9
  import Core from '../core';
10
+ import { AnalyticsInitialEvent, SendAnalyticsObject } from '../core/Analytics/types';
10
11
  export declare class UIElement<P extends UIElementProps = any> extends BaseElement<P> implements IUIElement {
11
12
  protected componentRef: any;
12
13
  elementRef: UIElement;
13
14
  constructor(props: P);
14
15
  setState(newState: object): void;
15
16
  protected onChange(): object;
17
+ protected setUpAnalytics(setUpAnalyticsObj: AnalyticsInitialEvent): Promise<any>;
18
+ /**
19
+ * A function for all UIElements, or BaseElement, to use to create an analytics action for when it's been:
20
+ * - mounted,
21
+ * - a PM has been selected
22
+ * - onSubmit has been called (as a result of the pay button being pressed)
23
+ *
24
+ * In some other cases e.g. 3DS2 components, this function is overridden to allow more specific analytics actions to be created
25
+ */
26
+ protected submitAnalytics(analyticsObj: SendAnalyticsObject): void;
16
27
  private onSubmit;
17
28
  private onValid;
18
29
  onComplete(state: any): void;
@@ -1,6 +1,7 @@
1
1
  import QRLoaderContainer from '../helpers/QRLoaderContainer';
2
2
  declare class WeChatPayElement extends QRLoaderContainer {
3
3
  static type: string;
4
+ static analyticsType: string;
4
5
  formatProps(props: any): {
5
6
  delay: number;
6
7
  countdownTime: number;
@@ -31,6 +32,7 @@ declare class WeChatPayElement extends QRLoaderContainer {
31
32
  icon?: string;
32
33
  amount?: import("../../types").PaymentAmount;
33
34
  secondaryAmount?: import("../../types").PaymentAmountExtended;
35
+ brand?: string;
34
36
  showPayButton?: boolean;
35
37
  setStatusAutomatically?: boolean;
36
38
  payButton?: (options: import("../types").PayButtonFunctionProps) => import("preact").JSX.Element;
@@ -44,7 +46,7 @@ declare class WeChatPayElement extends QRLoaderContainer {
44
46
  order?: import("../../types").Order;
45
47
  modules?: {
46
48
  srPanel?: import("../../core/Errors/SRPanel").SRPanel;
47
- analytics?: import("../../core/Analytics/Analytics").default;
49
+ analytics?: import("../types").AnalyticsModule;
48
50
  resources?: import("../../core/Context/Resources").Resources;
49
51
  risk?: import("../../core/RiskModule").default;
50
52
  };
@@ -10,6 +10,8 @@ declare namespace Address {
10
10
  visibility: string;
11
11
  requiredFields: readonly ["street", "houseNumberOrName", "postalCode", "city", "stateOrProvince", "country", "firstName", "lastName"];
12
12
  specifications: {};
13
+ onFieldFocusAnalytics: () => void;
14
+ onFieldBlurAnalytics: () => void;
13
15
  };
14
16
  }
15
17
  export default Address;
@@ -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[];
@@ -3,6 +3,7 @@ import Specifications from './Specifications';
3
3
  import { ValidatorRules } from '../../../utils/Validator/types';
4
4
  import { ValidationRuleResult } from '../../../utils/Validator/ValidationRuleResult';
5
5
  import { OnAddressLookupType, OnAddressSelectedType } from './components/AddressSearch';
6
+ import { SelectTargetObject } from '../FormFields/Select/types';
6
7
  export type StringObject = {
7
8
  [key: string]: string;
8
9
  };
@@ -25,6 +26,8 @@ export interface AddressProps {
25
26
  payButton?: (obj: any) => {};
26
27
  showPayButton?: boolean;
27
28
  setComponentRef?: (ref: any) => void;
29
+ onFieldFocusAnalytics?: (who: string, event: Event) => void;
30
+ onFieldBlurAnalytics?: (who: string, event: Event) => void;
28
31
  }
29
32
  export interface AddressLookupItem extends AddressData {
30
33
  id: string;
@@ -49,16 +52,15 @@ export interface FieldContainerProps {
49
52
  onInput?: (e: Event) => void;
50
53
  onBlur?: (e: Event) => void;
51
54
  onDropdownChange: (e: {
52
- target: {
53
- value: string | number;
54
- name: string;
55
- };
55
+ target: SelectTargetObject;
56
56
  }) => void;
57
57
  readOnly?: boolean;
58
58
  specifications: Specifications;
59
59
  maxLength?: number;
60
60
  trimOnBlur?: boolean;
61
61
  disabled?: boolean;
62
+ onFieldFocusAnalytics?: (who: string, event: Event) => void;
63
+ onFieldBlurAnalytics?: (who: string, event: Event) => void;
62
64
  }
63
65
  export interface ReadOnlyAddressProps {
64
66
  data: AddressData;
@@ -70,10 +72,7 @@ export interface CountryFieldProps {
70
72
  label: string;
71
73
  errorMessage: boolean | string;
72
74
  onDropdownChange: (e: {
73
- target: {
74
- value: string | number;
75
- name: string;
76
- };
75
+ target: SelectTargetObject;
77
76
  }) => void;
78
77
  readOnly?: boolean;
79
78
  value: string;
@@ -87,10 +86,7 @@ export interface StateFieldProps {
87
86
  label: string;
88
87
  errorMessage: boolean | string;
89
88
  onDropdownChange: (e: {
90
- target: {
91
- value: string | number;
92
- name: string;
93
- };
89
+ target: SelectTargetObject;
94
90
  }) => void;
95
91
  readOnly?: boolean;
96
92
  selectedCountry: string;
@@ -1,10 +1,8 @@
1
1
  import Language from '../../../language';
2
2
  import { StringObject } from './types';
3
- export declare const DEFAULT_DEBOUNCE_TIME_MS = 300;
4
3
  /**
5
4
  * Used by the SRPanel sorting function to tell it whether we need to prepend the field type to the SR panel message, and, if so, we retrieve the correct translation for the field type.
6
5
  * (Whether we need to prepend the field type depends on whether we know that the error message correctly reflects the label of the field. Ultimately all error messages should do this
7
6
  * and this mapping fn will become redundant)
8
7
  */
9
8
  export declare const mapFieldKey: (key: string, i18n: Language, countrySpecificLabels: StringObject) => string;
10
- export declare const debounce: (fn: Function, ms?: number) => (this: any, ...args: any[]) => void;
@@ -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, onInput, selectedValue, name, isInvalid, isValid, placeholder, uniqueId, disabled, disableTextFilter, clearOnSelect, blurOnClose }: SelectProps): h.JSX.Element;
4
+ declare function Select({ items, className, classNameModifiers, filterable, readonly, onChange, onInput, selectedValue, name, isInvalid, isValid, placeholder, uniqueId, disabled, disableTextFilter, clearOnSelect, blurOnClose, onListToggle }: 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 { SelectButtonProps } from '../types';
3
- declare function SelectButton(props: SelectButtonProps): h.JSX.Element;
3
+ declare function SelectButton(props: Readonly<SelectButtonProps>): h.JSX.Element;
4
4
  export default SelectButton;
@@ -7,6 +7,10 @@ export interface SelectItem {
7
7
  secondaryText?: string;
8
8
  selectedOptionName?: string;
9
9
  }
10
+ export interface SelectTargetObject {
11
+ value?: string | number;
12
+ name?: string;
13
+ }
10
14
  export interface SelectProps {
11
15
  className: string;
12
16
  classNameModifiers: string[];
@@ -16,10 +20,7 @@ export interface SelectProps {
16
20
  items: SelectItem[];
17
21
  name?: string;
18
22
  onChange: (e: {
19
- target: {
20
- value: string | number;
21
- name: string;
22
- };
23
+ target: SelectTargetObject;
23
24
  } | Partial<h.JSX.TargetedKeyboardEvent<HTMLInputElement>>) => void;
24
25
  onInput?: (value: string) => void;
25
26
  placeholder?: string;
@@ -30,6 +31,7 @@ export interface SelectProps {
30
31
  disableTextFilter?: boolean;
31
32
  clearOnSelect?: boolean;
32
33
  blurOnClose?: boolean;
34
+ onListToggle?: (isOpen: boolean) => void;
33
35
  }
34
36
  export interface SelectButtonProps {
35
37
  inputText: string;
@@ -1,5 +1,6 @@
1
1
  import { PayButtonProps } from '../PayButton/PayButton';
2
2
  import { ComponentChildren } from 'preact';
3
+ import { SendAnalyticsObject } from '../../../core/Analytics/types';
3
4
  export interface IssuerListProps {
4
5
  items: IssuerItem[];
5
6
  showPayButton: boolean;
@@ -9,6 +10,7 @@ export interface IssuerListProps {
9
10
  placeholder?: string;
10
11
  issuer?: string;
11
12
  termsAndConditions?: TermsAndConditions;
13
+ onSubmitAnalytics: (aObj: SendAnalyticsObject) => void;
12
14
  }
13
15
  export interface IssuerItem {
14
16
  id: string;
@@ -2,6 +2,7 @@ import { PaymentAmount } from '../../../types';
2
2
  import Language from '../../../language/Language';
3
3
  import { ActionHandledReturnObject } from '../../types';
4
4
  import { h } from 'preact';
5
+ import { SendAnalyticsObject } from '../../../core/Analytics/types';
5
6
  export interface QRLoaderProps {
6
7
  delay?: number;
7
8
  countdownTime?: number;
@@ -28,6 +29,7 @@ export interface QRLoaderProps {
28
29
  instructions?: string | (() => h.JSX.Element);
29
30
  copyBtn?: boolean;
30
31
  onActionHandled?: (rtnObj: ActionHandledReturnObject) => void;
32
+ onSubmitAnalytics?: (aObj: SendAnalyticsObject) => void;
31
33
  }
32
34
  export interface QRLoaderState {
33
35
  buttonStatus: string;
@@ -1,4 +1,5 @@
1
1
  import { CVCPolicyType, DatePolicyType } from '../types';
2
+ export declare const ENCRYPTED = "encrypted";
2
3
  export declare const ENCRYPTED_CARD_NUMBER = "encryptedCardNumber";
3
4
  export declare const ENCRYPTED_EXPIRY_DATE = "encryptedExpiryDate";
4
5
  export declare const ENCRYPTED_EXPIRY_MONTH = "encryptedExpiryMonth";
@@ -11,7 +12,7 @@ export declare const ENCRYPTED_BANK_LOCATION_FIELD = "encryptedBankLocationId";
11
12
  export declare const ENCRYPTED_SECURITY_CODE_3_DIGITS = "encryptedSecurityCode3digits";
12
13
  export declare const ENCRYPTED_SECURITY_CODE_4_DIGITS = "encryptedSecurityCode4digits";
13
14
  export declare const GIFT_CARD = "giftcard";
14
- export declare const SF_VERSION = "4.8.0";
15
+ export declare const SF_VERSION = "4.8.2";
15
16
  export declare const DEFAULT_CARD_GROUP_TYPES: string[];
16
17
  export declare const NON_CREDIT_CARD_TYPE_SECURED_FIELDS: string[];
17
18
  export declare const CREDIT_CARD_SF_FIELDS: string[];
@@ -11,20 +11,10 @@ export declare const resolvePlaceholders: (i18n?: Language) => SFPlaceholdersObj
11
11
  */
12
12
  export declare const getCardImageUrl: (brand: any, resources: Resources) => string;
13
13
  /**
14
- * Checks if `prop` is classified as an `Array` primitive or object.
15
- * @internal
16
- * @param prop - The value to check.
17
- * @returns Returns `true` if `prop` is correctly classified, else `false`.
18
- * @example
19
- * ```
20
- * isArray([1, 2, 3]);
21
- * // => true
22
- *
23
- * isArray(1);
24
- * // => false
25
- * ```
14
+ * Used by Card.tsx & SecuredFields.tsx
15
+ * @param fieldType -
26
16
  */
27
- export declare function isArray(prop: any): boolean;
17
+ export declare const fieldTypeToSnakeCase: (fieldType: string) => any;
28
18
  /**
29
19
  * 'Destructures' properties from object - returns a new object only containing those properties that were asked for (including if those properties
30
20
  * have values that are falsy: null, undefined, false, '').
@@ -1,5 +1,5 @@
1
1
  import { h } from 'preact';
2
- export default function ({ onBlur, onInput, valid, error, data, required, disabled }: {
2
+ export default function ({ onBlur, onInput, valid, error, data, required, disabled, onFieldFocusAnalytics, onFieldBlurAnalytics }: {
3
3
  onBlur: any;
4
4
  onInput: any;
5
5
  valid?: boolean;
@@ -7,4 +7,6 @@ export default function ({ onBlur, onInput, valid, error, data, required, disabl
7
7
  data?: string;
8
8
  required?: boolean;
9
9
  disabled?: boolean;
10
+ onFieldFocusAnalytics?: any;
11
+ onFieldBlurAnalytics?: any;
10
12
  }): h.JSX.Element;