@adyen/adyen-web 4.7.5 → 5.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adyen.css +5 -1
- package/dist/adyen.css.map +1 -1
- package/dist/adyen.js +1 -1
- package/dist/adyen.js.map +1 -1
- package/dist/cjs/adyen.css +5 -1
- package/dist/cjs/adyen.css.map +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/es/adyen.css +5 -1
- package/dist/es/adyen.css.map +1 -1
- package/dist/es/ar.js +1 -1
- package/dist/es/cs-CZ.js +1 -1
- package/dist/es/da-DK.js +1 -1
- package/dist/es/de-DE.js +1 -1
- package/dist/es/el-GR.js +1 -1
- package/dist/es/es-ES.js +1 -1
- package/dist/es/fi-FI.js +1 -1
- package/dist/es/fr-FR.js +1 -1
- package/dist/es/hr-HR.js +1 -1
- package/dist/es/hu-HU.js +1 -1
- package/dist/es/index.js +1 -1
- package/dist/es/it-IT.js +1 -1
- package/dist/es/ja-JP.js +1 -1
- package/dist/es/ko-KR.js +1 -1
- package/dist/es/nl-NL.js +1 -1
- package/dist/es/no-NO.js +1 -1
- package/dist/es/pl-PL.js +1 -1
- package/dist/es/pt-BR.js +1 -1
- package/dist/es/ro-RO.js +1 -1
- package/dist/es/ru-RU.js +1 -1
- package/dist/es/sk-SK.js +1 -1
- package/dist/es/sl-SI.js +1 -1
- package/dist/es/sv-SE.js +1 -1
- package/dist/es/zh-CN.js +1 -1
- package/dist/es/zh-TW.js +1 -1
- package/dist/types/components/AmazonPay/types.d.ts +4 -0
- package/dist/types/components/ApplePay/ApplePay.d.ts +1 -4
- package/dist/types/components/ApplePay/defaultProps.d.ts +0 -2
- package/dist/types/components/ApplePay/types.d.ts +1 -4
- package/dist/types/components/BacsDD/components/types.d.ts +1 -1
- package/dist/types/components/BankTransfer/types.d.ts +1 -1
- package/dist/types/components/BaseElement.d.ts +2 -13
- package/dist/types/components/BcmcMobile/BcmcMobile.d.ts +8 -1
- package/dist/types/components/Blik/components/BlikInput.d.ts +1 -1
- package/dist/types/components/Card/Bancontact.d.ts +8 -1
- package/dist/types/components/Card/Card.d.ts +9 -1
- package/dist/types/components/Card/components/CardInput/components/DataSfSpan.d.ts +7 -0
- package/dist/types/components/Card/components/CardInput/components/types.d.ts +8 -0
- package/dist/types/components/Card/components/CardInput/validate.d.ts +1 -1
- package/dist/types/components/Card/types.d.ts +2 -1
- package/dist/types/components/Dragonpay/Dragonpay.d.ts +9 -4
- package/dist/types/components/Dragonpay/types.d.ts +1 -1
- package/dist/types/components/Dropin/Dropin.d.ts +0 -3
- package/dist/types/components/Dropin/components/PaymentMethod/PaymentMethodIcon.d.ts +3 -3
- package/dist/types/components/Dropin/components/PaymentMethod/PaymentMethodItem.d.ts +1 -0
- package/dist/types/components/Dropin/components/utils.d.ts +2 -0
- package/dist/types/components/Dropin/defaultProps.d.ts +0 -2
- package/dist/types/components/Dropin/types.d.ts +2 -1
- package/dist/types/components/Giftcard/Giftcard.d.ts +3 -2
- package/dist/types/components/GooglePay/GooglePay.d.ts +0 -4
- package/dist/types/components/GooglePay/defaultProps.d.ts +0 -2
- package/dist/types/components/GooglePay/requests.d.ts +2 -2
- package/dist/types/components/GooglePay/types.d.ts +11 -1
- package/dist/types/components/Klarna/components/KlarnaWidget/KlarnaWidget.d.ts +1 -0
- package/dist/types/components/Klarna/constants.d.ts +0 -5
- package/dist/types/components/Klarna/types.d.ts +9 -3
- package/dist/types/components/MBWay/components/MBWayInput/types.d.ts +1 -1
- package/dist/types/components/PayPal/Paypal.d.ts +1 -2
- package/dist/types/components/PayPal/types.d.ts +2 -1
- package/dist/types/components/Pix/Pix.d.ts +32 -2
- package/dist/types/components/Pix/PixInput/PixInput.d.ts +9 -0
- package/dist/types/components/Pix/PixInput/index.d.ts +1 -0
- package/dist/types/components/Pix/PixInput/utils.d.ts +3 -0
- package/dist/types/components/Pix/PixInput/validate.d.ts +2 -0
- package/dist/types/components/Pix/types.d.ts +19 -0
- package/dist/types/components/Redirect/components/RedirectShopper/RedirectShopper.d.ts +2 -3
- package/dist/types/components/Swish/Swish.d.ts +8 -1
- package/dist/types/components/Twint/Twint.d.ts +23 -0
- package/dist/types/components/Twint/index.d.ts +1 -0
- package/dist/types/components/UIElement.d.ts +34 -26
- package/dist/types/components/WeChat/WeChat.d.ts +8 -1
- package/dist/types/components/helpers/IssuerListContainer.d.ts +8 -8
- package/dist/types/components/helpers/QRLoaderContainer.d.ts +5 -3
- package/dist/types/components/index.d.ts +2 -0
- package/dist/types/components/internal/Await/types.d.ts +1 -1
- package/dist/types/components/internal/FormFields/Field/Field.d.ts +3 -1
- package/dist/types/components/internal/FormFields/Field/types.d.ts +1 -0
- package/dist/types/components/internal/FormFields/RadioGroup/types.d.ts +1 -0
- package/dist/types/components/internal/FormFields/Select/Select.d.ts +1 -1
- package/dist/types/components/internal/FormFields/Select/types.d.ts +3 -0
- package/dist/types/components/internal/IssuerList/ContentSeparator/ContentSeparator.d.ts +4 -0
- package/dist/types/components/internal/IssuerList/ContentSeparator/index.d.ts +1 -0
- package/dist/types/components/internal/IssuerList/IssuerButtonGroup/IssuerButton.d.ts +11 -0
- package/dist/types/components/internal/IssuerList/IssuerButtonGroup/IssuerButtonGroup.d.ts +10 -0
- package/dist/types/components/internal/IssuerList/IssuerButtonGroup/index.d.ts +1 -0
- package/dist/types/components/internal/IssuerList/IssuerList.d.ts +2 -7
- package/dist/types/components/internal/IssuerList/types.d.ts +16 -0
- package/dist/types/components/internal/PayButton/PayButton.d.ts +4 -1
- package/dist/types/components/internal/PayButton/index.d.ts +1 -1
- package/dist/types/components/internal/QRLoader/QRLoader.d.ts +6 -6
- package/dist/types/components/internal/QRLoader/types.d.ts +0 -1
- package/dist/types/components/internal/SecuredFields/lib/configuration/constants.d.ts +4 -1
- package/dist/types/components/internal/SecuredFields/lib/core/AbstractSecuredField.d.ts +2 -0
- package/dist/types/components/internal/SecuredFields/lib/types.d.ts +1 -0
- package/dist/types/components/internal/SocialSecurityNumberBrazil/BrazilPersonalDetail.d.ts +2 -0
- package/dist/types/components/{Boleto/components → internal}/SocialSecurityNumberBrazil/SocialSecurityNumberBrazil.d.ts +0 -0
- package/dist/types/components/{Boleto/components → internal}/SocialSecurityNumberBrazil/constants.d.ts +0 -0
- package/dist/types/components/{Boleto/components → internal}/SocialSecurityNumberBrazil/utils.d.ts +0 -0
- package/dist/types/components/{Boleto/components → internal}/SocialSecurityNumberBrazil/validate.d.ts +0 -0
- package/dist/types/components/types.d.ts +48 -0
- package/dist/types/components/utils.d.ts +3 -0
- package/dist/types/core/Analytics/Analytics.d.ts +1 -1
- package/dist/types/core/Analytics/EventsQueue.d.ts +2 -2
- package/dist/types/core/Analytics/types.d.ts +2 -2
- package/dist/types/core/CheckoutSession/CheckoutSession.d.ts +47 -0
- package/dist/types/core/CheckoutSession/index.d.ts +1 -0
- package/dist/types/core/CheckoutSession/utils.d.ts +2 -0
- package/dist/types/core/Errors/AdyenCheckoutError.d.ts +14 -0
- package/dist/types/core/Errors/constants.d.ts +1 -0
- package/dist/types/core/RiskModule/RiskModule.d.ts +2 -1
- package/dist/types/core/Services/{collect-id.d.ts → analytics/collect-id.d.ts} +0 -0
- package/dist/types/core/Services/{log-event.d.ts → analytics/log-event.d.ts} +0 -0
- package/dist/types/core/Services/{post-telemetry.d.ts → analytics/post-telemetry.d.ts} +0 -0
- package/dist/types/core/Services/sessions/check-balance.d.ts +6 -0
- package/dist/types/core/Services/sessions/constants.d.ts +1 -0
- package/dist/types/core/Services/sessions/create-order.d.ts +6 -0
- package/dist/types/core/Services/sessions/make-payment.d.ts +6 -0
- package/dist/types/core/Services/sessions/setup-session.d.ts +6 -0
- package/dist/types/core/Services/sessions/submit-details.d.ts +6 -0
- package/dist/types/core/core.d.ts +14 -1
- package/dist/types/core/types.d.ts +1 -0
- package/dist/types/index.d.ts +2 -1
- package/dist/types/language/config.d.ts +4 -0
- package/dist/types/language/locales/index.d.ts +202 -28
- package/dist/types/types/index.d.ts +38 -0
- package/dist/types/utils/Storage.d.ts +10 -0
- package/dist/types/utils/idGenerator.d.ts +1 -0
- package/package.json +7 -7
|
@@ -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
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
declare type EventItem = (
|
|
1
|
+
declare type EventItem = (checkoutAttemptId: string) => Promise<any>;
|
|
2
2
|
declare class EventsQueue {
|
|
3
3
|
events: EventItem[];
|
|
4
4
|
add(event: any): void;
|
|
5
|
-
run(
|
|
5
|
+
run(checkoutAttemptId?: string): Promise<any[]>;
|
|
6
6
|
}
|
|
7
7
|
export default EventsQueue;
|
|
@@ -17,9 +17,9 @@ export interface AnalyticsOptions {
|
|
|
17
17
|
*/
|
|
18
18
|
conversion?: boolean;
|
|
19
19
|
/**
|
|
20
|
-
* Reuse a previous
|
|
20
|
+
* Reuse a previous checkoutAttemptId from a previous page
|
|
21
21
|
*/
|
|
22
|
-
|
|
22
|
+
checkoutAttemptId?: string;
|
|
23
23
|
/**
|
|
24
24
|
* Data to be sent along with the event data
|
|
25
25
|
*/
|
|
@@ -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,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;
|
|
@@ -7,6 +7,7 @@ export declare const ERROR_MSG_UNSUPPORTED_CARD_ENTERED = "Unsupported card ente
|
|
|
7
7
|
export declare const ERROR_MSG_INVALID_FIELD = "field not valid";
|
|
8
8
|
export declare const ERROR_MSG_CLEARED = "error was cleared";
|
|
9
9
|
export declare const ERROR_MSG_MBWAY_EMAIL_INVALID = "Not valid email address";
|
|
10
|
+
export declare const ARIA_ERROR_SUFFIX = "-ariaError";
|
|
10
11
|
/**
|
|
11
12
|
* Error Codes
|
|
12
13
|
* @example error.va.sf-cc-num.01
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { h } from 'preact';
|
|
2
|
-
import 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;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const API_VERSION = "v1";
|
|
@@ -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
|
*/
|
package/dist/types/index.d.ts
CHANGED
|
@@ -163,6 +163,9 @@ export declare const defaultTranslation: {
|
|
|
163
163
|
"error.va.sf-cc-dat.01": string;
|
|
164
164
|
"error.va.sf-cc-dat.02": string;
|
|
165
165
|
"error.va.sf-cc-dat.03": string;
|
|
166
|
+
"error.va.sf-ach-num.01": string;
|
|
167
|
+
"error.va.sf-ach-loc.01": string;
|
|
168
|
+
"error.va.sf-kcp-pwd.01": string;
|
|
166
169
|
"error.giftcard.no-balance": string;
|
|
167
170
|
"error.giftcard.card-error": string;
|
|
168
171
|
"error.giftcard.currency-error": string;
|
|
@@ -208,4 +211,5 @@ export declare const defaultTranslation: {
|
|
|
208
211
|
"ach.encryptedBankLocationId.aria.iframeTitle": string;
|
|
209
212
|
"ach.encryptedBankLocationId.aria.label": string;
|
|
210
213
|
"pix.instructions": string;
|
|
214
|
+
"twint.saved": string;
|
|
211
215
|
};
|