@adyen/adyen-web 4.8.0 → 5.2.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 (108) hide show
  1. package/dist/adyen.css +5 -1
  2. package/dist/adyen.css.map +1 -1
  3. package/dist/adyen.js +1 -1
  4. package/dist/adyen.js.map +1 -1
  5. package/dist/cjs/adyen.css +5 -1
  6. package/dist/cjs/adyen.css.map +1 -1
  7. package/dist/cjs/index.js +1 -1
  8. package/dist/es/adyen.css +5 -1
  9. package/dist/es/adyen.css.map +1 -1
  10. package/dist/es/index.js +1 -1
  11. package/dist/es/it-IT.js +1 -1
  12. package/dist/types/components/ApplePay/ApplePay.d.ts +1 -4
  13. package/dist/types/components/ApplePay/defaultProps.d.ts +0 -2
  14. package/dist/types/components/ApplePay/types.d.ts +1 -4
  15. package/dist/types/components/BacsDD/components/types.d.ts +1 -1
  16. package/dist/types/components/BankTransfer/types.d.ts +1 -1
  17. package/dist/types/components/BaseElement.d.ts +2 -13
  18. package/dist/types/components/BcmcMobile/BcmcMobile.d.ts +8 -1
  19. package/dist/types/components/Blik/components/BlikInput.d.ts +1 -1
  20. package/dist/types/components/Card/Bancontact.d.ts +14 -3
  21. package/dist/types/components/Card/Card.d.ts +9 -1
  22. package/dist/types/components/Card/components/CardInput/components/CardFields.d.ts +1 -1
  23. package/dist/types/components/Card/components/CardInput/components/types.d.ts +6 -5
  24. package/dist/types/components/Card/components/CardInput/types.d.ts +4 -3
  25. package/dist/types/components/Card/components/CardInput/validate.d.ts +1 -1
  26. package/dist/types/components/Card/types.d.ts +4 -2
  27. package/dist/types/components/Dragonpay/Dragonpay.d.ts +9 -4
  28. package/dist/types/components/Dragonpay/types.d.ts +1 -1
  29. package/dist/types/components/Dropin/Dropin.d.ts +0 -3
  30. package/dist/types/components/Dropin/components/PaymentMethod/PaymentMethodIcon.d.ts +3 -3
  31. package/dist/types/components/Dropin/components/PaymentMethod/PaymentMethodItem.d.ts +1 -0
  32. package/dist/types/components/Dropin/components/utils.d.ts +2 -0
  33. package/dist/types/components/Dropin/defaultProps.d.ts +0 -2
  34. package/dist/types/components/Dropin/types.d.ts +2 -1
  35. package/dist/types/components/Econtext/Econtext.d.ts +11 -1
  36. package/dist/types/components/Econtext/components/EcontextInput/EcontextInput.d.ts +14 -2
  37. package/dist/types/components/Giftcard/Giftcard.d.ts +3 -2
  38. package/dist/types/components/GooglePay/GooglePay.d.ts +0 -4
  39. package/dist/types/components/GooglePay/defaultProps.d.ts +0 -2
  40. package/dist/types/components/GooglePay/types.d.ts +1 -1
  41. package/dist/types/components/Klarna/constants.d.ts +0 -5
  42. package/dist/types/components/Klarna/types.d.ts +9 -3
  43. package/dist/types/components/MBWay/components/MBWayInput/types.d.ts +1 -1
  44. package/dist/types/components/PayPal/Paypal.d.ts +1 -2
  45. package/dist/types/components/PayPal/types.d.ts +6 -1
  46. package/dist/types/components/Pix/Pix.d.ts +32 -2
  47. package/dist/types/components/Pix/PixInput/PixInput.d.ts +9 -0
  48. package/dist/types/components/Pix/PixInput/index.d.ts +1 -0
  49. package/dist/types/components/Pix/PixInput/utils.d.ts +3 -0
  50. package/dist/types/components/Pix/PixInput/validate.d.ts +2 -0
  51. package/dist/types/components/Pix/types.d.ts +19 -0
  52. package/dist/types/components/Redirect/components/RedirectShopper/RedirectShopper.d.ts +2 -3
  53. package/dist/types/components/Swish/Swish.d.ts +8 -1
  54. package/dist/types/components/UIElement.d.ts +34 -26
  55. package/dist/types/components/WeChat/WeChat.d.ts +8 -1
  56. package/dist/types/components/helpers/IssuerListContainer.d.ts +8 -8
  57. package/dist/types/components/helpers/QRLoaderContainer.d.ts +5 -3
  58. package/dist/types/components/index.d.ts +1 -1
  59. package/dist/types/components/internal/Await/types.d.ts +1 -1
  60. package/dist/types/components/internal/IssuerList/ContentSeparator/ContentSeparator.d.ts +4 -0
  61. package/dist/types/components/internal/IssuerList/ContentSeparator/index.d.ts +1 -0
  62. package/dist/types/components/internal/IssuerList/IssuerButtonGroup/IssuerButton.d.ts +11 -0
  63. package/dist/types/components/internal/IssuerList/IssuerButtonGroup/IssuerButtonGroup.d.ts +10 -0
  64. package/dist/types/components/internal/IssuerList/IssuerButtonGroup/index.d.ts +1 -0
  65. package/dist/types/components/internal/IssuerList/IssuerList.d.ts +2 -7
  66. package/dist/types/components/internal/IssuerList/types.d.ts +16 -0
  67. package/dist/types/components/internal/PayButton/PayButton.d.ts +2 -2
  68. package/dist/types/components/internal/QRLoader/QRLoader.d.ts +6 -6
  69. package/dist/types/components/internal/QRLoader/types.d.ts +0 -1
  70. package/dist/types/components/internal/SecuredFields/SecuredFieldsProvider.d.ts +3 -3
  71. package/dist/types/components/internal/SecuredFields/defaultProps.d.ts +2 -1
  72. package/dist/types/components/internal/SecuredFields/lib/configuration/constants.d.ts +11 -6
  73. package/dist/types/components/internal/SecuredFields/lib/core/AbstractCSF.d.ts +2 -1
  74. package/dist/types/components/internal/SecuredFields/lib/core/AbstractSecuredField.d.ts +4 -3
  75. package/dist/types/components/internal/SecuredFields/lib/core/SecuredField.d.ts +2 -2
  76. package/dist/types/components/internal/SecuredFields/lib/core/utils/handleBrandFromBinLookup.d.ts +2 -1
  77. package/dist/types/components/internal/SecuredFields/lib/core/utils/processBrand.d.ts +6 -0
  78. package/dist/types/components/internal/SecuredFields/lib/types.d.ts +9 -4
  79. package/dist/types/components/internal/SecuredFields/lib/utilities/commonUtils.d.ts +4 -1
  80. package/dist/types/components/internal/SocialSecurityNumberBrazil/BrazilPersonalDetail.d.ts +2 -0
  81. package/dist/types/components/{Boleto/components → internal}/SocialSecurityNumberBrazil/SocialSecurityNumberBrazil.d.ts +0 -0
  82. package/dist/types/components/{Boleto/components → internal}/SocialSecurityNumberBrazil/constants.d.ts +0 -0
  83. package/dist/types/components/{Boleto/components → internal}/SocialSecurityNumberBrazil/utils.d.ts +0 -0
  84. package/dist/types/components/{Boleto/components → internal}/SocialSecurityNumberBrazil/validate.d.ts +0 -0
  85. package/dist/types/components/types.d.ts +48 -0
  86. package/dist/types/components/utils.d.ts +3 -0
  87. package/dist/types/core/CheckoutSession/CheckoutSession.d.ts +47 -0
  88. package/dist/types/core/CheckoutSession/index.d.ts +1 -0
  89. package/dist/types/core/CheckoutSession/utils.d.ts +2 -0
  90. package/dist/types/core/Errors/AdyenCheckoutError.d.ts +14 -0
  91. package/dist/types/core/RiskModule/RiskModule.d.ts +2 -1
  92. package/dist/types/core/Services/{collect-id.d.ts → analytics/collect-id.d.ts} +0 -0
  93. package/dist/types/core/Services/{log-event.d.ts → analytics/log-event.d.ts} +0 -0
  94. package/dist/types/core/Services/{post-telemetry.d.ts → analytics/post-telemetry.d.ts} +0 -0
  95. package/dist/types/core/Services/sessions/check-balance.d.ts +6 -0
  96. package/dist/types/core/Services/sessions/constants.d.ts +1 -0
  97. package/dist/types/core/Services/sessions/create-order.d.ts +6 -0
  98. package/dist/types/core/Services/sessions/make-payment.d.ts +6 -0
  99. package/dist/types/core/Services/sessions/setup-session.d.ts +6 -0
  100. package/dist/types/core/Services/sessions/submit-details.d.ts +6 -0
  101. package/dist/types/core/core.d.ts +14 -1
  102. package/dist/types/core/types.d.ts +1 -0
  103. package/dist/types/index.d.ts +2 -1
  104. package/dist/types/types/index.d.ts +38 -0
  105. package/dist/types/utils/Script.d.ts +3 -1
  106. package/dist/types/utils/Storage.d.ts +10 -0
  107. package/dist/types/utils/hasOwnProperty.d.ts +1 -0
  108. package/package.json +5 -5
@@ -4,7 +4,7 @@ export declare type RtnType_noParamVoidFn = () => void;
4
4
  export declare type RtnType_postMessageListener = (event: Event) => void;
5
5
  export declare type RtnType_callbackFn = (feedbackObj: SFFeedbackObj) => void;
6
6
  export declare type CVCPolicyType = 'required' | 'optional' | 'hidden';
7
- export declare type DatePolicyType = 'required' | 'hidden';
7
+ export declare type DatePolicyType = 'required' | 'optional' | 'hidden';
8
8
  /**
9
9
  * Base interface, props common to both SFSetupObject & IframeConfigObject
10
10
  */
@@ -19,6 +19,7 @@ export interface SFInternalConfig {
19
19
  isCreditCardType: boolean;
20
20
  showWarnings: boolean;
21
21
  cvcPolicy: CVCPolicyType;
22
+ expiryDatePolicy: DatePolicyType;
22
23
  legacyInputMode: boolean;
23
24
  minimumExpiryDate: string;
24
25
  uid: string;
@@ -28,7 +29,7 @@ export interface SFInternalConfig {
28
29
  * The object passed from createSecuredFields to a new instance of SecuredField.ts
29
30
  */
30
31
  export interface SFSetupObject extends SFInternalConfig {
31
- datePolicy: DatePolicyType;
32
+ expiryDatePolicy: DatePolicyType;
32
33
  iframeSrc: string;
33
34
  loadingContext: string;
34
35
  holderEl: HTMLElement;
@@ -76,7 +77,7 @@ declare abstract class AbstractSecuredField {
76
77
  protected _hasError: boolean;
77
78
  protected _isValid: boolean;
78
79
  protected _cvcPolicy: CVCPolicyType;
79
- protected _datePolicy: DatePolicyType;
80
+ protected _expiryDatePolicy: DatePolicyType;
80
81
  protected _iframeContentWindow: Window;
81
82
  protected _isEncrypted: boolean;
82
83
  protected _numKey: number;
@@ -23,8 +23,8 @@ declare class SecuredField extends AbstractSecuredField {
23
23
  set isValid(value: boolean);
24
24
  get cvcPolicy(): CVCPolicyType;
25
25
  set cvcPolicy(value: CVCPolicyType);
26
- get datePolicy(): DatePolicyType;
27
- set datePolicy(value: DatePolicyType);
26
+ get expiryDatePolicy(): DatePolicyType;
27
+ set expiryDatePolicy(value: DatePolicyType);
28
28
  get iframeContentWindow(): Window;
29
29
  set iframeContentWindow(value: Window);
30
30
  get isEncrypted(): boolean;
@@ -1,4 +1,5 @@
1
- import { SendBrandObject } from '../../types';
1
+ import { SendBrandObject, SendExpiryDateObject } from '../../types';
2
2
  import { BinLookupResponse } from '../../../../../Card/types';
3
3
  export declare function sendBrandToCardSF(brandObj: SendBrandObject): void;
4
+ export declare function sendExpiryDatePolicyToSF(expiryDateObj: SendExpiryDateObject): void;
4
5
  export declare function handleBrandFromBinLookup(binLookupResponse: BinLookupResponse): void;
@@ -1,2 +1,8 @@
1
1
  import { SFFeedbackObj } from '../../types';
2
+ /**
3
+ * - If generic card type AND passed brand doesn't equal stored brand - send the new brand to the cvc input
4
+ * (so it can reassess what length it should be and if any value it contains is now valid)
5
+ *
6
+ * - Create object for onBrand callback aka SFPHandlers.handleOnBrand
7
+ */
2
8
  export declare function handleProcessBrand(pFeedbackObj: SFFeedbackObj): boolean;
@@ -4,11 +4,13 @@ import { BrandObject } from '../../../Card/types';
4
4
  declare global {
5
5
  interface Window {
6
6
  _b$dl: boolean;
7
+ mockBinCount: number;
7
8
  }
8
9
  }
9
10
  export interface BrandStorageObject {
10
11
  brand: string;
11
- cvcPolicy: string;
12
+ cvcPolicy: CVCPolicyType;
13
+ expiryDatePolicy: DatePolicyType;
12
14
  showSocialSecurityNumber?: boolean;
13
15
  }
14
16
  /**
@@ -136,14 +138,14 @@ export interface CardObject {
136
138
  pattern: RegExp;
137
139
  securityCode?: string;
138
140
  displayName?: string;
139
- cvcPolicy?: string;
141
+ cvcPolicy?: CVCPolicyType;
140
142
  }
141
143
  export interface CbObjOnBrand {
142
144
  type: string;
143
145
  rootNode: HTMLElement;
144
146
  brand: string;
145
147
  cvcPolicy: CVCPolicyType;
146
- datePolicy?: DatePolicyType;
148
+ expiryDatePolicy?: DatePolicyType;
147
149
  cvcText: string;
148
150
  showSocialSecurityNumber?: boolean;
149
151
  brandImageUrl?: string;
@@ -224,7 +226,7 @@ export interface SFFeedbackObj {
224
226
  code?: string;
225
227
  cvcText?: string;
226
228
  cvcPolicy?: CVCPolicyType;
227
- datePolicy?: DatePolicyType;
229
+ expiryDatePolicy?: DatePolicyType;
228
230
  showSocialSecurityNumber?: boolean;
229
231
  maxLength?: number;
230
232
  error?: string;
@@ -254,4 +256,7 @@ export interface SendBrandObject {
254
256
  brand: string;
255
257
  enableLuhnCheck: boolean;
256
258
  }
259
+ export interface SendExpiryDateObject {
260
+ expiryDatePolicy: DatePolicyType;
261
+ }
257
262
  export {};
@@ -4,7 +4,10 @@
4
4
  * @returns Number
5
5
  */
6
6
  declare function generateRandomNumber(): number;
7
- declare function objectsDeepEqual(obj1?: {}, obj2?: {}): boolean;
7
+ /**
8
+ * Recursively compare 2 objects
9
+ */
10
+ declare function objectsDeepEqual(x: any, y: any): any;
8
11
  /**
9
12
  * Returns true if x is:
10
13
  * null, undefined, false, 0, NaN, empty object or array, empty string
@@ -0,0 +1,2 @@
1
+ import { h } from 'preact';
2
+ export declare function BrazilPersonalDetail(props: any): h.JSX.Element;
@@ -0,0 +1,48 @@
1
+ import { Order, PaymentAction, PaymentAmount } from '../types';
2
+ import UIElement from './UIElement';
3
+ import Core from '../core';
4
+ import Analytics from '../core/Analytics';
5
+ import RiskElement from '../core/RiskModule';
6
+ export interface PaymentResponse {
7
+ action?: PaymentAction;
8
+ resultCode: string;
9
+ sessionData?: string;
10
+ order?: Order;
11
+ }
12
+ export interface RawPaymentResponse extends PaymentResponse {
13
+ [key: string]: any;
14
+ }
15
+ export interface BaseElementProps {
16
+ _parentInstance?: Core;
17
+ order?: Order;
18
+ modules?: {
19
+ analytics: Analytics;
20
+ risk: RiskElement;
21
+ };
22
+ isDropin?: boolean;
23
+ }
24
+ export interface UIElementProps extends BaseElementProps {
25
+ session?: {
26
+ id: string;
27
+ data: string;
28
+ };
29
+ onChange?: (state: any, element: UIElement) => void;
30
+ onValid?: (state: any, element: UIElement) => void;
31
+ beforeSubmit?: (state: any, element: UIElement, actions: any) => Promise<void>;
32
+ onSubmit?: (state: any, element: UIElement) => void;
33
+ onComplete?: (state: any, element: UIElement) => void;
34
+ onAdditionalDetails?: (state: any, element: UIElement) => void;
35
+ onError?: (error: any, element?: UIElement) => void;
36
+ onPaymentCompleted?: (result: any, element: UIElement) => void;
37
+ beforeRedirect?: (resolve: any, reject: any, redirectData: any, element: UIElement) => void;
38
+ type?: string;
39
+ name?: string;
40
+ icon?: string;
41
+ amount?: PaymentAmount;
42
+ /**
43
+ * Show/Hide pay button
44
+ * @defaultValue true
45
+ */
46
+ showPayButton?: boolean;
47
+ setStatusAutomatically?: boolean;
48
+ }
@@ -0,0 +1,3 @@
1
+ import { PaymentResponse, RawPaymentResponse } from './types';
2
+ export declare function getSanitizedResponse(response: RawPaymentResponse): PaymentResponse;
3
+ export declare function resolveFinalResult(result: PaymentResponse): string[];
@@ -0,0 +1,47 @@
1
+ import { CheckoutSession, CheckoutSessionBalanceResponse, CheckoutSessionDetailsResponse, CheckoutSessionOrdersResponse, CheckoutSessionPaymentResponse, CheckoutSessionSetupResponse } from '../../types';
2
+ declare class Session {
3
+ private readonly session;
4
+ private readonly storage;
5
+ readonly clientKey: string;
6
+ readonly loadingContext: string;
7
+ constructor(rawSession: CheckoutSession, clientKey: string, loadingContext: string);
8
+ get id(): string;
9
+ get data(): string;
10
+ /**
11
+ * Updates the session.data with the latest data blob
12
+ */
13
+ private updateSessionData;
14
+ /**
15
+ * Fetches data from a session
16
+ */
17
+ setupSession(options: any): Promise<CheckoutSessionSetupResponse>;
18
+ /**
19
+ * Submits a session payment
20
+ */
21
+ submitPayment(data: any): Promise<CheckoutSessionPaymentResponse>;
22
+ /**
23
+ * Submits session payment additional details
24
+ */
25
+ submitDetails(data: any): Promise<CheckoutSessionDetailsResponse>;
26
+ /**
27
+ * Checks the balance for a payment method
28
+ */
29
+ checkBalance(data: any): Promise<CheckoutSessionBalanceResponse>;
30
+ /**
31
+ * Creates an order for the current session
32
+ */
33
+ createOrder(): Promise<CheckoutSessionOrdersResponse>;
34
+ /**
35
+ * Gets the stored session but only if the current id and the stored id match
36
+ */
37
+ getStoredSession(): CheckoutSession;
38
+ /**
39
+ * Stores the session
40
+ */
41
+ storeSession(): void;
42
+ /**
43
+ * Clears the stored session
44
+ */
45
+ removeStoredSession(): void;
46
+ }
47
+ export default Session;
@@ -0,0 +1 @@
1
+ export { default } from './CheckoutSession';
@@ -0,0 +1,2 @@
1
+ import { CheckoutSession } from '../../types';
2
+ export declare function sanitizeSession(session: any): Partial<CheckoutSession>;
@@ -0,0 +1,14 @@
1
+ declare class AdyenCheckoutError extends Error {
2
+ protected static errorTypes: {
3
+ /** Network error. */
4
+ NETWORK_ERROR: string;
5
+ /** Shopper canceled the current transaction. */
6
+ CANCEL: string;
7
+ /** Implementation error. The method or parameter are incorrect or are not supported. */
8
+ IMPLEMENTATION_ERROR: string;
9
+ /** Generic error. */
10
+ ERROR: string;
11
+ };
12
+ constructor(type: keyof typeof AdyenCheckoutError.errorTypes, message?: string);
13
+ }
14
+ export default AdyenCheckoutError;
@@ -1,5 +1,6 @@
1
1
  import { h } from 'preact';
2
- import BaseElement, { BaseElementProps } from '../../components/BaseElement';
2
+ import BaseElement from '../../components/BaseElement';
3
+ import { BaseElementProps } from '../../components/types';
3
4
  export interface RiskModuleOptions {
4
5
  enabled: boolean;
5
6
  onComplete: (data: any) => void;
@@ -0,0 +1,6 @@
1
+ import Session from '../../CheckoutSession';
2
+ import { CheckoutSessionBalanceResponse } from '../../../types';
3
+ /**
4
+ */
5
+ declare function checkBalance(paymentRequest: any, session: Session): Promise<CheckoutSessionBalanceResponse>;
6
+ export default checkBalance;
@@ -0,0 +1 @@
1
+ export declare const API_VERSION = "v1";
@@ -0,0 +1,6 @@
1
+ import Session from '../../CheckoutSession';
2
+ import { CheckoutSessionOrdersResponse } from '../../../types';
3
+ /**
4
+ */
5
+ declare function createOrder(session: Session): Promise<CheckoutSessionOrdersResponse>;
6
+ export default createOrder;
@@ -0,0 +1,6 @@
1
+ import Session from '../../CheckoutSession';
2
+ import { CheckoutSessionPaymentResponse } from '../../../types';
3
+ /**
4
+ */
5
+ declare function makePayment(paymentRequest: any, session: Session): Promise<CheckoutSessionPaymentResponse>;
6
+ export default makePayment;
@@ -0,0 +1,6 @@
1
+ import Session from '../../CheckoutSession';
2
+ import { CheckoutSessionSetupResponse } from '../../../types';
3
+ /**
4
+ */
5
+ declare function setupSession(session: Session, options: any): Promise<CheckoutSessionSetupResponse>;
6
+ export default setupSession;
@@ -0,0 +1,6 @@
1
+ import Session from '../../CheckoutSession';
2
+ import { CheckoutSessionDetailsResponse } from '../../../types';
3
+ /**
4
+ */
5
+ declare function submitDetails(details: any, session: Session): Promise<CheckoutSessionDetailsResponse>;
6
+ export default submitDetails;
@@ -2,7 +2,9 @@ import UIElement from '../components/UIElement';
2
2
  import { PaymentAction } from '../types';
3
3
  import { CoreOptions } from './types';
4
4
  import { PaymentMethods, PaymentMethodOptions } from '../types';
5
+ import Session from './CheckoutSession';
5
6
  declare class Core {
7
+ session: Session;
6
8
  private paymentMethodsResponse;
7
9
  modules: any;
8
10
  options: CoreOptions;
@@ -14,6 +16,17 @@ declare class Core {
14
16
  buildId: string;
15
17
  };
16
18
  constructor(options: CoreOptions);
19
+ initialize(): Promise<this>;
20
+ /**
21
+ * Submit data to payments using the onSubmit event or the session flow if available
22
+ * @param data -
23
+ */
24
+ submitPayment(data: any): void;
25
+ /**
26
+ * Submits details using onAdditionalDetails or the session flow if available
27
+ * @param details -
28
+ */
29
+ submitDetails(details: any): void;
17
30
  /**
18
31
  * Instantiates a new UIElement component ready to be mounted
19
32
  * @param paymentMethod - name or class of the paymentMethod
@@ -34,7 +47,7 @@ declare class Core {
34
47
  * @param options - props to update
35
48
  * @returns this - the element instance
36
49
  */
37
- update: (options?: CoreOptions) => this;
50
+ update: (options?: CoreOptions) => Promise<this>;
38
51
  /**
39
52
  * Remove the reference of a component
40
53
  * @param component - reference to the component to be removed
@@ -4,6 +4,7 @@ import { AnalyticsOptions } from './Analytics/types';
4
4
  import { PaymentMethodsResponseObject } from './ProcessResponse/PaymentMethodsResponse/types';
5
5
  import { RiskModuleOptions } from './RiskModule/RiskModule';
6
6
  export interface CoreOptions {
7
+ session?: any;
7
8
  /**
8
9
  * Use test. When you're ready to accept live payments, change the value to one of our {@link https://docs.adyen.com/checkout/drop-in-web#testing-your-integration | live environments}.
9
10
  */
@@ -1,3 +1,4 @@
1
1
  import './polyfills';
2
2
  import Checkout from './core';
3
- export default Checkout;
3
+ declare function AdyenCheckout(props: any): Promise<Checkout>;
4
+ export default AdyenCheckout;
@@ -134,6 +134,10 @@ export interface Order {
134
134
  * The pspReference that belongs to the order.
135
135
  */
136
136
  pspReference: string;
137
+ /**
138
+ * The remaining amount to complete the order.
139
+ */
140
+ remainingAmount?: PaymentAmount;
137
141
  }
138
142
  export interface OrderStatus {
139
143
  expiresAt: string;
@@ -170,3 +174,37 @@ export declare type PaymentMethodOptions<P extends keyof PaymentMethods> = Insta
170
174
  * Visibility options for a fieldset
171
175
  */
172
176
  export declare type FieldsetVisibility = 'editable' | 'hidden' | 'readOnly';
177
+ export declare type CheckoutSession = {
178
+ id: string;
179
+ sessionData: string;
180
+ };
181
+ export declare type CheckoutSessionSetupResponse = {
182
+ id: string;
183
+ sessionData: string;
184
+ amount: PaymentAmount;
185
+ expiresAt: string;
186
+ paymentMethods: any;
187
+ returnUrl: string;
188
+ };
189
+ export declare type CheckoutSessionPaymentResponse = {
190
+ sessionData: string;
191
+ status?: string;
192
+ resultCode?: string;
193
+ action?: PaymentAction;
194
+ };
195
+ export declare type CheckoutSessionDetailsResponse = {
196
+ sessionData: string;
197
+ status?: string;
198
+ resultCode?: string;
199
+ action?: PaymentAction;
200
+ };
201
+ export declare type CheckoutSessionBalanceResponse = {
202
+ sessionData: string;
203
+ balance?: PaymentAmount;
204
+ transactionLimit?: PaymentAmount;
205
+ };
206
+ export declare type CheckoutSessionOrdersResponse = {
207
+ sessionData: string;
208
+ orderData: string;
209
+ pspReference: string;
210
+ };
@@ -15,7 +15,9 @@ declare class Script {
15
15
  private readonly script;
16
16
  private readonly src;
17
17
  private readonly node;
18
- constructor(src: any, node?: string);
18
+ private readonly attributes;
19
+ private readonly dataAttributes;
20
+ constructor(src: any, node?: string, attributes?: Partial<HTMLScriptElement>, dataAttributes?: Record<string, string | undefined>);
19
21
  load: () => Promise<any>;
20
22
  remove: () => void;
21
23
  }
@@ -0,0 +1,10 @@
1
+ declare class Storage {
2
+ private readonly prefix;
3
+ private readonly key;
4
+ private storage;
5
+ constructor(key: string, storage?: globalThis.Storage);
6
+ get(): any;
7
+ set(value: any): void;
8
+ remove(): void;
9
+ }
10
+ export default Storage;
@@ -0,0 +1 @@
1
+ export declare function hasOwnProperty(obj: any, prop: any): any;
package/package.json CHANGED
@@ -22,7 +22,7 @@
22
22
  "./dist/adyen.css": "./dist/adyen.css",
23
23
  "./package.json": "./package.json"
24
24
  },
25
- "version": "4.8.0",
25
+ "version": "5.2.0",
26
26
  "license": "MIT",
27
27
  "homepage": "https://docs.adyen.com/checkout",
28
28
  "repository": "github:Adyen/adyen-web",
@@ -50,20 +50,20 @@
50
50
  "@rollup/plugin-eslint": "^8.0.1",
51
51
  "@rollup/plugin-json": "^4.1.0",
52
52
  "@rollup/plugin-node-resolve": "^13.0.0",
53
- "@rollup/plugin-replace": "^2.4.2",
53
+ "@rollup/plugin-replace": "^3.0.0",
54
54
  "@testing-library/preact": "^2.0.1",
55
55
  "@testing-library/preact-hooks": "^1.1.0",
56
56
  "@types/jest": "^26.0.23",
57
57
  "@typescript-eslint/eslint-plugin": "^4.28.3",
58
58
  "@typescript-eslint/parser": "^4.28.3",
59
- "autoprefixer": "^10.2.6",
59
+ "autoprefixer": "^10.3.6",
60
60
  "cross-env": "^7.0.3",
61
61
  "cssnano": "^5.0.6",
62
62
  "dotenv": "^10.0.0",
63
63
  "enzyme": "^3.11.0",
64
64
  "enzyme-adapter-preact-pure": "^3.1.0",
65
65
  "esbuild": "^0.12.15",
66
- "eslint": "^7.29.0",
66
+ "eslint": "^7.32.0",
67
67
  "eslint-plugin-import": "^2.23.4",
68
68
  "eslint-plugin-jsx-a11y": "^6.4.1",
69
69
  "eslint-plugin-react": "^7.20.3",
@@ -90,7 +90,7 @@
90
90
  "@types/applepayjs": "^3.0.2",
91
91
  "@types/googlepay": "^0.6.2",
92
92
  "classnames": "^2.3.1",
93
- "core-js": "^3.14.0",
93
+ "core-js": "^3.18.1",
94
94
  "preact": "^10.5.13"
95
95
  },
96
96
  "files": [