@adyen/adyen-web 5.58.0 → 5.60.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 (82) 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/ApplePay/types.d.ts +1 -8
  8. package/dist/types/components/BaseElement.d.ts +3 -0
  9. package/dist/types/components/BcmcMobile/BcmcMobile.d.ts +2 -1
  10. package/dist/types/components/Card/Bancontact.d.ts +4 -2
  11. package/dist/types/components/Card/Card.d.ts +23 -9
  12. package/dist/types/components/Card/components/CardInput/components/CardFieldsWrapper.d.ts +4 -2
  13. package/dist/types/components/Card/components/CardInput/components/CardHolderName.d.ts +1 -1
  14. package/dist/types/components/Card/components/CardInput/components/types.d.ts +4 -0
  15. package/dist/types/components/Card/components/CardInput/types.d.ts +5 -3
  16. package/dist/types/components/Card/components/CardInput/utils.d.ts +1 -1
  17. package/dist/types/components/Card/types.d.ts +13 -4
  18. package/dist/types/components/CashAppPay/CashAppPay.d.ts +2 -1
  19. package/dist/types/components/ClickToPay/ClickToPay.d.ts +2 -1
  20. package/dist/types/components/Donation/Donation.d.ts +4 -1
  21. package/dist/types/components/Donation/components/types.d.ts +2 -2
  22. package/dist/types/components/Donation/types.d.ts +17 -0
  23. package/dist/types/components/Dragonpay/Dragonpay.d.ts +2 -1
  24. package/dist/types/components/Dropin/Dropin.d.ts +2 -1
  25. package/dist/types/components/DuitNow/DuitNow.d.ts +2 -1
  26. package/dist/types/components/PayMe/PayMe.d.ts +2 -1
  27. package/dist/types/components/PayNow/PayNow.d.ts +2 -1
  28. package/dist/types/components/PayPal/Paypal.d.ts +25 -1
  29. package/dist/types/components/PayPal/components/PaypalButtons.d.ts +1 -1
  30. package/dist/types/components/PayPal/types.d.ts +44 -1
  31. package/dist/types/components/PromptPay/PromptPay.d.ts +2 -1
  32. package/dist/types/components/Riverty/Riverty.d.ts +2 -1
  33. package/dist/types/components/SecuredFields/SecuredFields.d.ts +1 -0
  34. package/dist/types/components/Swish/Swish.d.ts +2 -1
  35. package/dist/types/components/ThreeDS2/ThreeDS2Challenge.d.ts +6 -1
  36. package/dist/types/components/ThreeDS2/ThreeDS2DeviceFingerprint.d.ts +12 -7
  37. package/dist/types/components/ThreeDS2/components/Challenge/DoChallenge3DS2.d.ts +2 -1
  38. package/dist/types/components/ThreeDS2/components/Challenge/PrepareChallenge3DS2.d.ts +4 -3
  39. package/dist/types/components/ThreeDS2/components/Challenge/types.d.ts +3 -0
  40. package/dist/types/components/ThreeDS2/components/DeviceFingerprint/DoFingerprint3DS2.d.ts +2 -1
  41. package/dist/types/components/ThreeDS2/components/DeviceFingerprint/PrepareFingerprint3DS2.d.ts +7 -4
  42. package/dist/types/components/ThreeDS2/components/DeviceFingerprint/types.d.ts +6 -1
  43. package/dist/types/components/ThreeDS2/components/Form/ThreeDS2Form.d.ts +1 -0
  44. package/dist/types/components/ThreeDS2/components/utils.d.ts +9 -3
  45. package/dist/types/components/ThreeDS2/config.d.ts +9 -0
  46. package/dist/types/components/ThreeDS2/types.d.ts +4 -0
  47. package/dist/types/components/UIElement.d.ts +11 -0
  48. package/dist/types/components/WeChat/WeChat.d.ts +3 -1
  49. package/dist/types/components/internal/Address/Address.d.ts +2 -0
  50. package/dist/types/components/internal/Address/types.d.ts +8 -12
  51. package/dist/types/components/internal/Address/utils.d.ts +0 -2
  52. package/dist/types/components/internal/FormFields/Select/Select.d.ts +1 -1
  53. package/dist/types/components/internal/FormFields/Select/types.d.ts +6 -4
  54. package/dist/types/components/internal/IssuerList/types.d.ts +2 -0
  55. package/dist/types/components/internal/QRLoader/types.d.ts +2 -0
  56. package/dist/types/components/internal/SecuredFields/lib/configuration/constants.d.ts +2 -1
  57. package/dist/types/components/internal/SecuredFields/utils.d.ts +3 -13
  58. package/dist/types/components/internal/SocialSecurityNumberBrazil/SocialSecurityNumberBrazil.d.ts +3 -1
  59. package/dist/types/components/types.d.ts +23 -3
  60. package/dist/types/core/Analytics/Analytics.d.ts +3 -13
  61. package/dist/types/core/Analytics/EventsQueue.d.ts +13 -5
  62. package/dist/types/core/Analytics/analyticsPreProcessor.d.ts +3 -0
  63. package/dist/types/core/Analytics/constants.d.ts +72 -0
  64. package/dist/types/core/Analytics/types.d.ts +54 -1
  65. package/dist/types/core/Analytics/utils.d.ts +21 -0
  66. package/dist/types/core/Environment/Environment.d.ts +2 -0
  67. package/dist/types/core/Environment/index.d.ts +1 -1
  68. package/dist/types/core/Errors/types.d.ts +4 -0
  69. package/dist/types/core/Errors/utils.d.ts +1 -0
  70. package/dist/types/core/Services/analytics/collect-id.d.ts +5 -4
  71. package/dist/types/core/Services/analytics/log-event.d.ts +2 -1
  72. package/dist/types/core/Services/analytics/types.d.ts +17 -7
  73. package/dist/types/core/Services/http.d.ts +1 -1
  74. package/dist/types/core/core.d.ts +1 -0
  75. package/dist/types/core/types.d.ts +3 -1
  76. package/dist/types/utils/Formatters/formatters.d.ts +1 -0
  77. package/dist/types/utils/Storage.d.ts +3 -0
  78. package/dist/types/utils/base64.d.ts +4 -1
  79. package/dist/types/utils/debounce.d.ts +2 -0
  80. package/dist/types/utils/textUtils.d.ts +1 -0
  81. package/package.json +2 -2
  82. package/dist/types/core/Services/analytics/post-telemetry.d.ts +0 -13
@@ -28,6 +28,7 @@ export declare class AchElement extends UIElement<AchElementProps> {
28
28
  icon?: string;
29
29
  amount?: import("../../types").PaymentAmount;
30
30
  secondaryAmount?: import("../../types").PaymentAmountExtended;
31
+ brand?: string;
31
32
  showPayButton?: boolean;
32
33
  setStatusAutomatically?: boolean;
33
34
  payButton?: (options: import("../types").PayButtonFunctionProps) => h.JSX.Element;
@@ -41,7 +42,7 @@ export declare class AchElement extends UIElement<AchElementProps> {
41
42
  order?: import("../../types").Order;
42
43
  modules?: {
43
44
  srPanel?: import("../../core/Errors/SRPanel").SRPanel;
44
- analytics?: import("../../core/Analytics/Analytics").default;
45
+ analytics?: import("../types").AnalyticsModule;
45
46
  resources?: import("../../core/Context/Resources").Resources;
46
47
  risk?: import("../../core/RiskModule").default;
47
48
  };
@@ -67,14 +67,7 @@ export interface ApplePayElementProps extends UIElementProps {
67
67
  * ApplePayRecurringPaymentRequest - Represents a request to set up a recurring payment, typically a subscription.
68
68
  * {@link https://developer.apple.com/documentation/apple_pay_on_the_web/applepayrecurringpaymentrequest}
69
69
  */
70
- recurringPaymentRequest?: {
71
- paymentDescription: string;
72
- regularBilling: ApplePayJS.ApplePayLineItem;
73
- trialBilling?: ApplePayJS.ApplePayLineItem;
74
- billingAgreement?: string;
75
- managementURL: string;
76
- tokenNotificationURL?: string;
77
- };
70
+ recurringPaymentRequest?: ApplePayJS.ApplePayRecurringPaymentRequest;
78
71
  /**
79
72
  * The billing information that you require from the user in order to process the transaction.
80
73
  */
@@ -4,6 +4,7 @@ import Core from '../core';
4
4
  import { BaseElementProps, PaymentData } from './types';
5
5
  import { RiskData } from '../core/RiskModule/RiskModule';
6
6
  import { Resources } from '../core/Context/Resources';
7
+ import { AnalyticsInitialEvent, SendAnalyticsObject } from '../core/Analytics/types';
7
8
  declare class BaseElement<P extends BaseElementProps> {
8
9
  readonly _id: string;
9
10
  props: P;
@@ -28,6 +29,8 @@ declare class BaseElement<P extends BaseElementProps> {
28
29
  * properly adding the type of the formatData function
29
30
  */
30
31
  protected formatData(): any;
32
+ protected setUpAnalytics(setUpAnalyticsObj: AnalyticsInitialEvent): any;
33
+ protected submitAnalytics(analyticsObj?: SendAnalyticsObject): any;
31
34
  protected setState(newState: object): void;
32
35
  /**
33
36
  * Returns the component payment data ready to submit to the Checkout API
@@ -31,6 +31,7 @@ declare class BCMCMobileElement 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 BCMCMobileElement 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
  };
@@ -46,6 +46,7 @@ declare class BancontactElement extends CardElement {
46
46
  icon: string;
47
47
  installmentOptions: any;
48
48
  enableStoreDetails: boolean;
49
+ showStoreDetailsCheckbox: boolean;
49
50
  clickToPayConfiguration: {
50
51
  disableOtpAutoFocus: boolean;
51
52
  shopperEmail: any;
@@ -69,7 +70,8 @@ declare class BancontactElement extends CardElement {
69
70
  onFieldValid?: (event: import("../internal/SecuredFields/lib/types").CbObjOnFieldValid) => void;
70
71
  onBrand?: (event: import("../internal/SecuredFields/lib/types").CbObjOnBrand) => void;
71
72
  onError?: (event: import("../internal/SecuredFields/lib/types").CbObjOnError) => void;
72
- onFocus?: (event: import("../internal/SecuredFields/lib/types").CbObjOnFocus) => void;
73
+ onFocus?: (event: import("../internal/SecuredFields/lib/types").CbObjOnFocus | import("../types").ComponentFocusObject) => void;
74
+ onBlur?: (event: import("../internal/SecuredFields/lib/types").CbObjOnFocus | import("../types").ComponentFocusObject) => void;
73
75
  onBinValue?: (event: import("../internal/SecuredFields/lib/types").CbObjOnBinValue) => void;
74
76
  onBinLookup?: (event: import("../internal/SecuredFields/lib/types").CbObjOnBinLookup) => void;
75
77
  environment?: string;
@@ -100,7 +102,7 @@ declare class BancontactElement extends CardElement {
100
102
  order?: import("../../types").Order;
101
103
  modules?: {
102
104
  srPanel?: import("../../core/Errors/SRPanel").SRPanel;
103
- analytics?: import("../../core/Analytics/Analytics").default;
105
+ analytics?: import("../types").AnalyticsModule;
104
106
  resources?: import("../../core/Context/Resources").Resources;
105
107
  risk?: import("../../core/RiskModule").default;
106
108
  };
@@ -1,8 +1,9 @@
1
1
  import { h } from 'preact';
2
2
  import { UIElement } from '../UIElement';
3
3
  import { BinLookupResponse, CardElementData, CardElementProps } from './types';
4
- import { CbObjOnBinLookup } from '../internal/SecuredFields/lib/types';
5
- import { PayButtonFunctionProps, UIElementStatus } from '../types';
4
+ import { CbObjOnBinLookup, CbObjOnConfigSuccess, CbObjOnFocus } from '../internal/SecuredFields/lib/types';
5
+ import { ComponentFocusObject, PayButtonFunctionProps, UIElementStatus } from '../types';
6
+ import { SendAnalyticsObject } from '../../core/Analytics/types';
6
7
  export declare class CardElement extends UIElement<CardElementProps> {
7
8
  static type: string;
8
9
  private readonly clickToPayService;
@@ -27,6 +28,10 @@ export declare class CardElement extends UIElement<CardElementProps> {
27
28
  countryCode: any;
28
29
  configuration: {
29
30
  socialSecurityNumberMode: import("./types").SocialSecurityMode;
31
+ /**
32
+ * Click to Pay configuration
33
+ * - If email is set explicitly in the configuration, then it can override the one used in the session creation
34
+ */
30
35
  visaSrciDpaId?: string;
31
36
  visaSrcInitiatorId?: string;
32
37
  mcSrcClientId?: string;
@@ -47,6 +52,7 @@ export declare class CardElement extends UIElement<CardElementProps> {
47
52
  icon: string;
48
53
  installmentOptions: any;
49
54
  enableStoreDetails: boolean;
55
+ showStoreDetailsCheckbox: boolean;
50
56
  /**
51
57
  * Click to Pay configuration
52
58
  * - If email is set explicitly in the configuration, then it can override the one used in the session creation
@@ -70,16 +76,14 @@ export declare class CardElement extends UIElement<CardElementProps> {
70
76
  hideCVC?: boolean;
71
77
  hasHolderName?: boolean;
72
78
  onLoad?: (event: import("../internal/SecuredFields/lib/types").CbObjOnLoad) => void;
73
- onConfigSuccess?: (event: import("../internal/SecuredFields/lib/types").CbObjOnConfigSuccess) => void;
79
+ onConfigSuccess?: (event: CbObjOnConfigSuccess) => void;
74
80
  onFieldValid?: (event: import("../internal/SecuredFields/lib/types").CbObjOnFieldValid) => void;
75
81
  onBrand?: (event: import("../internal/SecuredFields/lib/types").CbObjOnBrand) => void;
76
82
  onError?: (event: import("../internal/SecuredFields/lib/types").CbObjOnError) => void;
77
- onFocus?: (event: import("../internal/SecuredFields/lib/types").CbObjOnFocus) => void;
83
+ onFocus?: (event: CbObjOnFocus | ComponentFocusObject) => void;
84
+ onBlur?: (event: CbObjOnFocus | ComponentFocusObject) => void;
78
85
  onBinValue?: (event: import("../internal/SecuredFields/lib/types").CbObjOnBinValue) => void;
79
- onBinLookup?: (event: CbObjOnBinLookup) => void; /**
80
- * Click to Pay configuration
81
- * - If email is set explicitly in the configuration, then it can override the one used in the session creation
82
- */
86
+ onBinLookup?: (event: CbObjOnBinLookup) => void;
83
87
  environment?: string;
84
88
  session?: import("../../core/CheckoutSession/CheckoutSession").default;
85
89
  onChange?: (state: any, element: UIElement<any>) => void;
@@ -108,7 +112,7 @@ export declare class CardElement extends UIElement<CardElementProps> {
108
112
  order?: import("../../types").Order;
109
113
  modules?: {
110
114
  srPanel?: import("../../core/Errors/SRPanel").SRPanel;
111
- analytics?: import("../../core/Analytics/Analytics").default;
115
+ analytics?: import("../types").AnalyticsModule;
112
116
  resources?: import("../../core/Context/Resources").Resources;
113
117
  risk?: import("../../core/RiskModule").default;
114
118
  };
@@ -125,7 +129,17 @@ export declare class CardElement extends UIElement<CardElementProps> {
125
129
  handleUnsupportedCard(errObj: any): this;
126
130
  private handleClickToPaySubmit;
127
131
  onBinLookup(obj: CbObjOnBinLookup): void;
132
+ protected submitAnalytics(analyticsObj: SendAnalyticsObject): void;
133
+ private onConfigSuccess;
134
+ private onFocus;
135
+ private onBlur;
136
+ private onErrorAnalytics;
128
137
  onBinValue: (callbackObj: import("../internal/SecuredFields/lib/types").CbObjOnBinValue) => void;
138
+ get storePaymentMethodPayload(): {
139
+ storePaymentMethod?: undefined;
140
+ } | {
141
+ storePaymentMethod: boolean;
142
+ };
129
143
  get isValid(): boolean;
130
144
  get icon(): string;
131
145
  get brands(): {
@@ -1,5 +1,5 @@
1
1
  import { h } from 'preact';
2
- export declare const CardFieldsWrapper: ({ data, valid, errors, handleChangeFor, sfpState, setFocusOn, cvcPolicy, focusedElement, hasInstallments, handleInstallments, showAmountsInInstallments, brandsIcons, formData, formErrors, formValid, expiryDatePolicy, dualBrandSelectElements, extensions, selectedBrandValue, showKCP, showBrazilianSSN, socialSecurityNumber, handleOnStoreDetails, billingAddress, handleAddress, setAddressRef, partialAddressSchema, onAddressLookup, onAddressSelected, addressSearchDebounceMs, amount, billingAddressRequired, billingAddressRequiredFields, billingAddressAllowedCountries, billingAddressValidationRules, brandsConfiguration, enableStoreDetails, hasCVC, hasHolderName, holderNameRequired, installmentOptions, placeholders, positionHolderNameOnTop, showBrandIcon, showBrandsUnderCardNumber, iOSFocusedField, disclaimerMessage }: {
2
+ export declare const CardFieldsWrapper: ({ data, valid, errors, handleChangeFor, sfpState, setFocusOn, cvcPolicy, focusedElement, hasInstallments, handleInstallments, showAmountsInInstallments, brandsIcons, formData, formErrors, formValid, expiryDatePolicy, dualBrandSelectElements, extensions, selectedBrandValue, showKCP, showBrazilianSSN, socialSecurityNumber, handleOnStoreDetails, billingAddress, handleAddress, setAddressRef, partialAddressSchema, onAddressLookup, onAddressSelected, addressSearchDebounceMs, amount, billingAddressRequired, billingAddressRequiredFields, billingAddressAllowedCountries, billingAddressValidationRules, brandsConfiguration, showStoreDetailsCheckbox, hasCVC, hasHolderName, holderNameRequired, installmentOptions, placeholders, positionHolderNameOnTop, showBrandIcon, showBrandsUnderCardNumber, iOSFocusedField, disclaimerMessage, onFieldFocusAnalytics, onFieldBlurAnalytics }: {
3
3
  data: any;
4
4
  valid: any;
5
5
  errors: any;
@@ -36,7 +36,7 @@ export declare const CardFieldsWrapper: ({ data, valid, errors, handleChangeFor,
36
36
  billingAddressAllowedCountries: any;
37
37
  billingAddressValidationRules?: any;
38
38
  brandsConfiguration: any;
39
- enableStoreDetails: any;
39
+ showStoreDetailsCheckbox: any;
40
40
  hasCVC: any;
41
41
  hasHolderName: any;
42
42
  holderNameRequired: any;
@@ -47,4 +47,6 @@ export declare const CardFieldsWrapper: ({ data, valid, errors, handleChangeFor,
47
47
  showBrandsUnderCardNumber: any;
48
48
  iOSFocusedField: any;
49
49
  disclaimerMessage: any;
50
+ onFieldFocusAnalytics: any;
51
+ onFieldBlurAnalytics: any;
50
52
  }) => h.JSX.Element;
@@ -1,3 +1,3 @@
1
1
  import { h } from 'preact';
2
2
  import { CardHolderNameProps } from './types';
3
- export default function CardHolderName({ onBlur, onInput, placeholder, value, required, error, isValid, disabled }: CardHolderNameProps): h.JSX.Element;
3
+ export default function CardHolderName({ onBlur, onInput, placeholder, value, required, error, isValid, disabled, onFieldFocusAnalytics, onFieldBlurAnalytics }: CardHolderNameProps): h.JSX.Element;
@@ -32,6 +32,8 @@ export interface CardHolderNameProps {
32
32
  required?: boolean;
33
33
  value?: string;
34
34
  disabled?: boolean;
35
+ onFieldFocusAnalytics?: (who: string, event: Event) => void;
36
+ onFieldBlurAnalytics?: (who: string, event: Event) => void;
35
37
  }
36
38
  export interface CardNumberProps {
37
39
  brand: string;
@@ -118,6 +120,8 @@ export interface KCPProps {
118
120
  isValid: boolean;
119
121
  value: string;
120
122
  disabled?: boolean;
123
+ onFieldFocusAnalytics?: (who: string, event: Event) => void;
124
+ onFieldBlurAnalytics?: (who: string, event: Event) => void;
121
125
  }
122
126
  export type RtnType_ParamBooleanFn = (tn: any) => boolean;
123
127
  export type RtnType_ParamVoidFn = (e: any) => void;
@@ -9,11 +9,11 @@ import { AddressSchema } from '../../../internal/Address/types';
9
9
  import { CbObjOnError, StylesObject } from '../../../internal/SecuredFields/lib/types';
10
10
  import { Resources } from '../../../../core/Context/Resources';
11
11
  import { SRPanel } from '../../../../core/Errors/SRPanel';
12
- import Analytics from '../../../../core/Analytics';
13
12
  import RiskElement from '../../../../core/RiskModule';
14
- import { ComponentMethodsRef } from '../../../types';
13
+ import { AnalyticsModule, ComponentMethodsRef } from '../../../types';
15
14
  import { DisclaimerMsgObject } from '../../../internal/DisclaimerMessage/DisclaimerMessage';
16
15
  import { OnAddressLookupType, OnAddressSelectedType } from '../../../internal/Address/components/AddressSearch';
16
+ import { FieldErrorAnalyticsObject } from '../../../../core/Analytics/types';
17
17
  export interface CardInputValidState {
18
18
  holderName?: boolean;
19
19
  billingAddress?: boolean;
@@ -85,7 +85,7 @@ export interface CardInputProps {
85
85
  minimumExpiryDate?: string;
86
86
  modules?: {
87
87
  srPanel: SRPanel;
88
- analytics: Analytics;
88
+ analytics: AnalyticsModule;
89
89
  risk: RiskElement;
90
90
  resources: Resources;
91
91
  };
@@ -115,6 +115,7 @@ export interface CardInputProps {
115
115
  showFormInstruction?: boolean;
116
116
  showInstallmentAmounts?: boolean;
117
117
  showPayButton?: boolean;
118
+ showStoreDetailsCheckbox?: boolean;
118
119
  showWarnings?: boolean;
119
120
  specifications?: Specifications;
120
121
  storedPaymentMethodId?: string;
@@ -123,6 +124,7 @@ export interface CardInputProps {
123
124
  type?: string;
124
125
  maskSecurityCode?: boolean;
125
126
  disclaimerMessage?: DisclaimerMsgObject;
127
+ onErrorAnalytics?: (obj: FieldErrorAnalyticsObject) => {};
126
128
  }
127
129
  export interface CardInputState {
128
130
  dualBrandSelectElements: DualBrandSelectElement[];
@@ -21,7 +21,7 @@ export declare const extractPropsForCardFields: (props: CardInputProps) => {
21
21
  billingAddressRequiredFields: string[];
22
22
  billingAddressAllowedCountries: string[];
23
23
  brandsConfiguration: import("../../types").CardBrandsConfiguration;
24
- enableStoreDetails: boolean;
24
+ showStoreDetailsCheckbox: boolean;
25
25
  hasCVC: boolean;
26
26
  hasHolderName: boolean;
27
27
  holderNameRequired: boolean;
@@ -1,4 +1,4 @@
1
- import { UIElementProps } from '../types';
1
+ import { ComponentFocusObject, UIElementProps } from '../types';
2
2
  import { AddressData, BrowserInfo } from '../../types';
3
3
  import { CbObjOnBinValue, CbObjOnBrand, CbObjOnConfigSuccess, CbObjOnError, CbObjOnFieldValid, CbObjOnFocus, CbObjOnLoad, CbObjOnBinLookup } from '../internal/SecuredFields/lib/types';
4
4
  import { CVCPolicyType, DatePolicyType } from '../internal/SecuredFields/lib/types';
@@ -50,8 +50,13 @@ export interface CardElementProps extends UIElementProps {
50
50
  * @defaultValue `true`
51
51
  */
52
52
  showFormInstruction?: boolean;
53
- /** Show/hide the "store details" checkbox */
53
+ /** Config option related to whether we set storePaymentMethod in the card data, and showing/hiding the "store details" checkbox */
54
54
  enableStoreDetails?: boolean;
55
+ /**
56
+ * Show/hide the "store details" checkbox
57
+ * @internal
58
+ */
59
+ showStoreDetailsCheckbox?: boolean;
55
60
  /** Show/hide the CVC field - merchant set config option */
56
61
  hideCVC?: boolean;
57
62
  /**
@@ -88,9 +93,13 @@ export interface CardElementProps extends UIElementProps {
88
93
  */
89
94
  onError?: (event: CbObjOnError) => void;
90
95
  /**
91
- * Called when a field gains or loses focus.
96
+ * Called when a field gains focus.
97
+ */
98
+ onFocus?: (event: CbObjOnFocus | ComponentFocusObject) => void;
99
+ /**
100
+ * Called when a field gains loses focus.
92
101
  */
93
- onFocus?: (event: CbObjOnFocus) => void;
102
+ onBlur?: (event: CbObjOnFocus | ComponentFocusObject) => void;
94
103
  /**
95
104
  * Provides the BIN Number of the card (up to 6 digits), called as the user types in the PAN.
96
105
  */
@@ -50,6 +50,7 @@ export declare class CashAppPay extends UIElement<CashAppPayElementProps> {
50
50
  icon?: string;
51
51
  amount?: import("../../types").PaymentAmount;
52
52
  secondaryAmount?: import("../../types").PaymentAmountExtended;
53
+ brand?: string;
53
54
  showPayButton?: boolean;
54
55
  setStatusAutomatically?: boolean;
55
56
  payButton?: (options: import("../types").PayButtonFunctionProps) => h.JSX.Element;
@@ -63,7 +64,7 @@ export declare class CashAppPay extends UIElement<CashAppPayElementProps> {
63
64
  order?: import("../../types").Order;
64
65
  modules?: {
65
66
  srPanel?: import("../../core/Errors/SRPanel").SRPanel;
66
- analytics?: import("../../core/Analytics/Analytics").default;
67
+ analytics?: import("../types").AnalyticsModule;
67
68
  resources?: import("../../core/Context/Resources").Resources;
68
69
  risk?: import("../../core/RiskModule").default;
69
70
  };
@@ -32,6 +32,7 @@ export declare class ClickToPayElement extends UIElement<ClickToPayElementProps>
32
32
  icon?: string;
33
33
  amount?: import("../../types").PaymentAmount;
34
34
  secondaryAmount?: import("../../types").PaymentAmountExtended;
35
+ brand?: string;
35
36
  showPayButton?: boolean;
36
37
  setStatusAutomatically?: boolean;
37
38
  payButton?: (options: import("../types").PayButtonFunctionProps) => h.JSX.Element;
@@ -45,7 +46,7 @@ export declare class ClickToPayElement extends UIElement<ClickToPayElementProps>
45
46
  order?: import("../../types").Order;
46
47
  modules?: {
47
48
  srPanel?: import("../../core/Errors/SRPanel").SRPanel;
48
- analytics?: import("../../core/Analytics/Analytics").default;
49
+ analytics?: import("../types").AnalyticsModule;
49
50
  resources?: import("../../core/Context/Resources").Resources;
50
51
  risk?: import("../../core/RiskModule").default;
51
52
  };
@@ -1,15 +1,18 @@
1
1
  import { h } from 'preact';
2
2
  import UIElement from '../UIElement';
3
+ import { DonationElementProps } from './types';
3
4
  /**
4
5
  * DonationElement
5
6
  */
6
- declare class DonationElement extends UIElement {
7
+ declare class DonationElement extends UIElement<DonationElementProps> {
7
8
  static type: string;
8
9
  constructor(props: any);
9
10
  static defaultProps: {
10
11
  onCancel: () => void;
11
12
  onDonate: () => void;
12
13
  };
14
+ protected formatProps(props: DonationElementProps): DonationElementProps;
15
+ isNewDonation(prop: DonationElementProps): boolean;
13
16
  /**
14
17
  * Returns the component payment data ready to submit to the Checkout API
15
18
  */
@@ -1,5 +1,5 @@
1
1
  import { DisclaimerMsgObject } from '../../internal/DisclaimerMessage/DisclaimerMessage';
2
- interface DonationAmounts {
2
+ export interface DonationAmounts {
3
3
  currency: string;
4
4
  values: Array<number>;
5
5
  }
@@ -7,7 +7,7 @@ interface DonationAmount {
7
7
  currency: string;
8
8
  value: number;
9
9
  }
10
- interface DonationPayload {
10
+ export interface DonationPayload {
11
11
  data: {
12
12
  amount: DonationAmount;
13
13
  };
@@ -0,0 +1,17 @@
1
+ import { DonationAmounts, DonationComponentProps, DonationPayload } from './components/types';
2
+ import { UIElementProps } from '../types';
3
+ export interface NewDonationComponentProps {
4
+ amounts: DonationAmounts;
5
+ bannerUrl: string;
6
+ logoUrl: string;
7
+ nonprofitDescription: string;
8
+ nonprofitName: string;
9
+ nonprofitUrl: string;
10
+ termsAndConditionsUrl: string;
11
+ causeName?: string;
12
+ showCancelButton?: boolean;
13
+ onDonate: (payload: DonationPayload) => void;
14
+ onCancel?: (payload: DonationPayload) => void;
15
+ onChange?: (payload: DonationPayload) => void;
16
+ }
17
+ export type DonationElementProps = UIElementProps & (NewDonationComponentProps | DonationComponentProps);
@@ -38,6 +38,7 @@ export declare class DragonpayElement extends UIElement<DragonpayElementProps> {
38
38
  icon?: string;
39
39
  amount?: import("../../types").PaymentAmount;
40
40
  secondaryAmount?: import("../../types").PaymentAmountExtended;
41
+ brand?: string;
41
42
  showPayButton?: boolean;
42
43
  setStatusAutomatically?: boolean;
43
44
  payButton?: (options: import("../types").PayButtonFunctionProps) => h.JSX.Element;
@@ -49,7 +50,7 @@ export declare class DragonpayElement extends UIElement<DragonpayElementProps> {
49
50
  order?: import("../../types").Order;
50
51
  modules?: {
51
52
  srPanel?: import("../../core/Errors/SRPanel").SRPanel;
52
- analytics?: import("../../core/Analytics/Analytics").default;
53
+ analytics?: import("../types").AnalyticsModule;
53
54
  resources?: import("../../core/Context/Resources").Resources;
54
55
  risk?: import("../../core/RiskModule").default;
55
56
  };
@@ -63,6 +63,7 @@ declare class DropinElement extends UIElement<DropinElementProps> {
63
63
  icon?: string;
64
64
  amount?: import("../../types").PaymentAmount;
65
65
  secondaryAmount?: import("../../types").PaymentAmountExtended;
66
+ brand?: string;
66
67
  showPayButton?: boolean;
67
68
  setStatusAutomatically?: boolean;
68
69
  payButton?: (options: import("../types").PayButtonFunctionProps) => h.JSX.Element;
@@ -75,7 +76,7 @@ declare class DropinElement extends UIElement<DropinElementProps> {
75
76
  _parentInstance?: import("../../core/core").default;
76
77
  modules?: {
77
78
  srPanel?: import("../../core/Errors/SRPanel").SRPanel;
78
- analytics?: import("../../core/Analytics/Analytics").default;
79
+ analytics?: import("../types").AnalyticsModule;
79
80
  resources?: import("../../core/Context/Resources").Resources;
80
81
  risk?: import("../../core/RiskModule").default;
81
82
  };
@@ -31,6 +31,7 @@ declare class DuitNowElement 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 DuitNowElement 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
  };
@@ -33,6 +33,7 @@ declare class PayMeElement extends QRLoaderContainer {
33
33
  icon?: string;
34
34
  amount?: import("../../types").PaymentAmount;
35
35
  secondaryAmount?: import("../../types").PaymentAmountExtended;
36
+ brand?: string;
36
37
  showPayButton?: boolean;
37
38
  setStatusAutomatically?: boolean;
38
39
  payButton?: (options: import("../types").PayButtonFunctionProps) => import("preact").JSX.Element;
@@ -46,7 +47,7 @@ declare class PayMeElement extends QRLoaderContainer {
46
47
  order?: import("../../types").Order;
47
48
  modules?: {
48
49
  srPanel?: import("../../core/Errors/SRPanel").SRPanel;
49
- analytics?: import("../../core/Analytics/Analytics").default;
50
+ analytics?: import("../types").AnalyticsModule;
50
51
  resources?: import("../../core/Context/Resources").Resources;
51
52
  risk?: import("../../core/RiskModule").default;
52
53
  };
@@ -31,6 +31,7 @@ declare class PayNowElement 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 PayNowElement 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
  };
@@ -6,19 +6,25 @@ import './Paypal.scss';
6
6
  declare class PaypalElement extends UIElement<PayPalElementProps> {
7
7
  static type: string;
8
8
  static subtype: string;
9
- private paymentData;
9
+ paymentData: string;
10
10
  private resolve;
11
11
  private reject;
12
12
  protected static defaultProps: PayPalElementProps;
13
13
  constructor(props: any);
14
14
  formatProps(props: PayPalElementProps): PayPalElementProps;
15
15
  submit: () => void;
16
+ /**
17
+ * Updates the paymentData value. It must be used in the PayPal Express flow, when patching the amount
18
+ * @param paymentData - Payment data value
19
+ */
20
+ updatePaymentData(paymentData: string): void;
16
21
  /**
17
22
  * Formats the component data output
18
23
  */
19
24
  protected formatData(): {
20
25
  paymentMethod: {
21
26
  type: string;
27
+ userAction: "continue" | "pay";
22
28
  subtype: string;
23
29
  };
24
30
  };
@@ -36,6 +42,24 @@ declare class PaypalElement extends UIElement<PayPalElementProps> {
36
42
  handleResolve(token: string): void;
37
43
  handleReject(errorMessage: string): void;
38
44
  private handleSubmit;
45
+ /**
46
+ * If the merchant provides the 'onShippingAddressChange' callback, then this method is used as a wrapper to it, in order
47
+ * to expose to the merchant the 'component' instance. The merchant needs the 'component' in order to manipulate the
48
+ * paymentData
49
+ *
50
+ * @param data - PayPal data
51
+ * @param actions - PayPal actions.
52
+ */
53
+ private handleOnShippingAddressChange;
54
+ /**
55
+ * If the merchant provides the 'onShippingOptionsChange' callback, then this method is used as a wrapper to it, in order
56
+ * to expose to the merchant the 'component' instance. The merchant needs the 'component' in order to manipulate the
57
+ * paymentData
58
+ *
59
+ * @param data - PayPal data
60
+ * @param actions - PayPal actions.
61
+ */
62
+ private handleOnShippingOptionsChange;
39
63
  render(): h.JSX.Element;
40
64
  }
41
65
  export default PaypalElement;
@@ -1,3 +1,3 @@
1
1
  import { h } from 'preact';
2
2
  import { PayPalButtonsProps } from '../types';
3
- export default function PaypalButtons({ onInit, onApprove, onClick, onCancel, onError, onShippingChange, onSubmit, isProcessingPayment, paypalRef, style, ...props }: PayPalButtonsProps): h.JSX.Element;
3
+ export default function PaypalButtons({ onInit, onApprove, onClick, onCancel, onError, onShippingChange, onShippingAddressChange, onShippingOptionsChange, onSubmit, isProcessingPayment, paypalRef, style, ...props }: PayPalButtonsProps): h.JSX.Element;
@@ -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;