@adyen/adyen-web 4.9.0 → 5.2.1
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 +4 -0
- 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 +4 -0
- package/dist/cjs/adyen.css.map +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/es/adyen.css +4 -0
- package/dist/es/adyen.css.map +1 -1
- package/dist/es/index.js +1 -1
- package/dist/es/it-IT.js +1 -1
- 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 +14 -3
- package/dist/types/components/Card/Card.d.ts +8 -1
- package/dist/types/components/Card/components/CardInput/components/CardFields.d.ts +1 -1
- package/dist/types/components/Card/components/CardInput/components/types.d.ts +6 -5
- package/dist/types/components/Card/components/CardInput/types.d.ts +4 -3
- package/dist/types/components/Card/types.d.ts +4 -2
- 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/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/Econtext/Econtext.d.ts +11 -1
- package/dist/types/components/Econtext/components/EcontextInput/EcontextInput.d.ts +14 -2
- 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/types.d.ts +1 -1
- package/dist/types/components/Klarna/types.d.ts +3 -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 +6 -1
- package/dist/types/components/Pix/Pix.d.ts +8 -1
- 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/UIElement.d.ts +30 -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 +2 -1
- package/dist/types/components/index.d.ts +1 -1
- package/dist/types/components/internal/Await/types.d.ts +1 -1
- 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 +2 -2
- 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/SecuredFieldsProvider.d.ts +3 -3
- package/dist/types/components/internal/SecuredFields/defaultProps.d.ts +2 -1
- package/dist/types/components/internal/SecuredFields/lib/configuration/constants.d.ts +11 -6
- package/dist/types/components/internal/SecuredFields/lib/core/AbstractCSF.d.ts +2 -1
- package/dist/types/components/internal/SecuredFields/lib/core/AbstractSecuredField.d.ts +4 -3
- package/dist/types/components/internal/SecuredFields/lib/core/SecuredField.d.ts +2 -2
- package/dist/types/components/internal/SecuredFields/lib/core/utils/handleBrandFromBinLookup.d.ts +2 -1
- package/dist/types/components/internal/SecuredFields/lib/core/utils/processBrand.d.ts +6 -0
- package/dist/types/components/internal/SecuredFields/lib/types.d.ts +9 -4
- package/dist/types/components/internal/SecuredFields/lib/utilities/commonUtils.d.ts +4 -1
- package/dist/types/components/types.d.ts +48 -0
- package/dist/types/components/utils.d.ts +3 -0
- 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/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/types/index.d.ts +38 -0
- package/dist/types/utils/Script.d.ts +3 -1
- package/dist/types/utils/Storage.d.ts +10 -0
- package/dist/types/utils/hasOwnProperty.d.ts +1 -0
- package/package.json +1 -1
|
@@ -23,17 +23,24 @@ declare class PixElement extends QRLoaderContainer<PixProps> {
|
|
|
23
23
|
qrCodeImage?: string;
|
|
24
24
|
paymentData?: string;
|
|
25
25
|
instructions?: string;
|
|
26
|
+
session?: {
|
|
27
|
+
id: string;
|
|
28
|
+
data: string;
|
|
29
|
+
};
|
|
26
30
|
onChange?: (state: any, element: import("../UIElement").UIElement<any>) => void;
|
|
27
31
|
onValid?: (state: any, element: import("../UIElement").UIElement<any>) => void;
|
|
32
|
+
beforeSubmit?: (state: any, element: import("../UIElement").UIElement<any>, actions: any) => Promise<void>;
|
|
28
33
|
onSubmit?: (state: any, element: import("../UIElement").UIElement<any>) => void;
|
|
29
34
|
onComplete?: (state: any, element: import("../UIElement").UIElement<any>) => void;
|
|
30
35
|
onAdditionalDetails?: (state: any, element: import("../UIElement").UIElement<any>) => void;
|
|
31
36
|
onError?: (error: any, element?: import("../UIElement").UIElement<any>) => void;
|
|
32
|
-
|
|
37
|
+
onPaymentCompleted?: (result: any, element: import("../UIElement").UIElement<any>) => void;
|
|
38
|
+
beforeRedirect?: (resolve: any, reject: any, redirectData: any, element: import("../UIElement").UIElement<any>) => void;
|
|
33
39
|
name?: string;
|
|
34
40
|
icon?: string;
|
|
35
41
|
amount?: import("../../types").PaymentAmount;
|
|
36
42
|
showPayButton?: boolean;
|
|
43
|
+
setStatusAutomatically?: boolean;
|
|
37
44
|
payButton?: (options: any) => any;
|
|
38
45
|
loadingContext?: string;
|
|
39
46
|
createFromAction?: (action: import("../../types").PaymentAction, props: object) => import("../UIElement").UIElement<any>;
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import { Component, h } from 'preact';
|
|
2
2
|
interface RedirectShopperProps {
|
|
3
|
-
beforeRedirect: (resolve: any, reject: any, url: any) => Promise<
|
|
3
|
+
beforeRedirect: (resolve: any, reject: any, url: any) => Promise<void>;
|
|
4
4
|
url: string;
|
|
5
5
|
method: 'GET' | 'POST';
|
|
6
6
|
data?: any;
|
|
7
7
|
}
|
|
8
8
|
declare class RedirectShopper extends Component<RedirectShopperProps> {
|
|
9
|
+
private postForm;
|
|
9
10
|
static defaultProps: {
|
|
10
11
|
beforeRedirect: (resolve: any) => any;
|
|
11
12
|
method: string;
|
|
12
|
-
data: {};
|
|
13
13
|
};
|
|
14
|
-
private postForm;
|
|
15
14
|
componentDidMount(): void;
|
|
16
15
|
render({ url, method, data }: {
|
|
17
16
|
url: any;
|
|
@@ -11,17 +11,24 @@ declare class SwishElement extends QRLoaderContainer {
|
|
|
11
11
|
qrCodeImage?: string;
|
|
12
12
|
paymentData?: string;
|
|
13
13
|
instructions: string;
|
|
14
|
+
session?: {
|
|
15
|
+
id: string;
|
|
16
|
+
data: string;
|
|
17
|
+
};
|
|
14
18
|
onChange?: (state: any, element: import("../UIElement").UIElement<any>) => void;
|
|
15
19
|
onValid?: (state: any, element: import("../UIElement").UIElement<any>) => void;
|
|
20
|
+
beforeSubmit?: (state: any, element: import("../UIElement").UIElement<any>, actions: any) => Promise<void>;
|
|
16
21
|
onSubmit?: (state: any, element: import("../UIElement").UIElement<any>) => void;
|
|
17
22
|
onComplete?: (state: any, element: import("../UIElement").UIElement<any>) => void;
|
|
18
23
|
onAdditionalDetails?: (state: any, element: import("../UIElement").UIElement<any>) => void;
|
|
19
24
|
onError?: (error: any, element?: import("../UIElement").UIElement<any>) => void;
|
|
20
|
-
|
|
25
|
+
onPaymentCompleted?: (result: any, element: import("../UIElement").UIElement<any>) => void;
|
|
26
|
+
beforeRedirect?: (resolve: any, reject: any, redirectData: any, element: import("../UIElement").UIElement<any>) => void;
|
|
21
27
|
name?: string;
|
|
22
28
|
icon?: string;
|
|
23
29
|
amount?: import("../../types").PaymentAmount;
|
|
24
30
|
showPayButton?: boolean;
|
|
31
|
+
setStatusAutomatically?: boolean;
|
|
25
32
|
payButton?: (options: any) => any;
|
|
26
33
|
loadingContext?: string;
|
|
27
34
|
createFromAction?: (action: import("../../types").PaymentAction, props: object) => import("../UIElement").UIElement<any>;
|
|
@@ -1,47 +1,48 @@
|
|
|
1
1
|
import { h } from 'preact';
|
|
2
|
-
import BaseElement
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
onValid?: (state: any, element: UIElement) => void;
|
|
7
|
-
onSubmit?: (state: any, element: UIElement) => void;
|
|
8
|
-
onComplete?: (state: any, element: UIElement) => void;
|
|
9
|
-
onAdditionalDetails?: (state: any, element: UIElement) => void;
|
|
10
|
-
onError?: (error: any, element?: UIElement) => void;
|
|
11
|
-
/** Automatically set status through the payment flow */
|
|
12
|
-
setStatusAutomatically?: boolean;
|
|
13
|
-
type?: string;
|
|
14
|
-
name?: string;
|
|
15
|
-
icon?: string;
|
|
16
|
-
amount?: PaymentAmount;
|
|
17
|
-
/**
|
|
18
|
-
* Show/Hide pay button
|
|
19
|
-
* @defaultValue true
|
|
20
|
-
*/
|
|
21
|
-
showPayButton?: boolean;
|
|
22
|
-
}
|
|
2
|
+
import BaseElement from './BaseElement';
|
|
3
|
+
import { Order, PaymentAction } from '../types';
|
|
4
|
+
import { UIElementProps } from './types';
|
|
5
|
+
import AdyenCheckoutError from '../core/Errors/AdyenCheckoutError';
|
|
23
6
|
export declare class UIElement<P extends UIElementProps = any> extends BaseElement<P> {
|
|
24
7
|
protected componentRef: any;
|
|
25
8
|
elementRef: any;
|
|
26
9
|
constructor(props: P);
|
|
27
10
|
setState(newState: object): void;
|
|
28
11
|
onChange(): object;
|
|
12
|
+
onSubmit(): void;
|
|
29
13
|
onValid(): {
|
|
30
14
|
data: any;
|
|
31
15
|
};
|
|
32
|
-
startPayment(): Promise<any>;
|
|
33
|
-
submit(): void;
|
|
34
16
|
onComplete(state: any): void;
|
|
17
|
+
/**
|
|
18
|
+
* Submit payment method data. If the form is not valid, it will trigger validation.
|
|
19
|
+
*/
|
|
20
|
+
submit(): void;
|
|
35
21
|
showValidation(): this;
|
|
36
|
-
setStatus(status: any): this;
|
|
37
|
-
|
|
22
|
+
setStatus(status: any, props?: any): this;
|
|
23
|
+
submitPayment(data: any): Promise<void>;
|
|
24
|
+
submitAdditionalDetails(data: any): Promise<void>;
|
|
25
|
+
protected handleError: (error: AdyenCheckoutError) => void;
|
|
26
|
+
protected handleAdditionalDetails: (state: any) => any;
|
|
27
|
+
handleAction(action: PaymentAction, props?: {}): UIElement;
|
|
28
|
+
protected handleOrder: (order: Order) => void;
|
|
29
|
+
protected handleFinalResult: (result: any) => any;
|
|
30
|
+
/**
|
|
31
|
+
* Handles a session /payments or /payments/details response.
|
|
32
|
+
* The component will handle automatically actions, orders, and final results.
|
|
33
|
+
* @param rawResponse -
|
|
34
|
+
*/
|
|
35
|
+
protected handleResponse(rawResponse: any): void;
|
|
36
|
+
/**
|
|
37
|
+
* Get the current validation status of the element
|
|
38
|
+
*/
|
|
38
39
|
get isValid(): boolean;
|
|
39
40
|
/**
|
|
40
41
|
* Get the element icon URL for the current environment
|
|
41
42
|
*/
|
|
42
43
|
get icon(): string;
|
|
43
44
|
/**
|
|
44
|
-
* Get the element displayable name
|
|
45
|
+
* Get the element's displayable name
|
|
45
46
|
*/
|
|
46
47
|
get displayName(): string;
|
|
47
48
|
/**
|
|
@@ -52,6 +53,9 @@ export declare class UIElement<P extends UIElementProps = any> extends BaseEleme
|
|
|
52
53
|
* Return the type of an element
|
|
53
54
|
*/
|
|
54
55
|
get type(): string;
|
|
56
|
+
/**
|
|
57
|
+
* Get the payButton component for the current element
|
|
58
|
+
*/
|
|
55
59
|
payButton: (props: any) => h.JSX.Element;
|
|
56
60
|
}
|
|
57
61
|
export default UIElement;
|
|
@@ -11,17 +11,24 @@ declare class WeChatPayElement extends QRLoaderContainer {
|
|
|
11
11
|
qrCodeImage?: string;
|
|
12
12
|
paymentData?: string;
|
|
13
13
|
instructions?: string;
|
|
14
|
+
session?: {
|
|
15
|
+
id: string;
|
|
16
|
+
data: string;
|
|
17
|
+
};
|
|
14
18
|
onChange?: (state: any, element: import("../UIElement").UIElement<any>) => void;
|
|
15
19
|
onValid?: (state: any, element: import("../UIElement").UIElement<any>) => void;
|
|
20
|
+
beforeSubmit?: (state: any, element: import("../UIElement").UIElement<any>, actions: any) => Promise<void>;
|
|
16
21
|
onSubmit?: (state: any, element: import("../UIElement").UIElement<any>) => void;
|
|
17
22
|
onComplete?: (state: any, element: import("../UIElement").UIElement<any>) => void;
|
|
18
23
|
onAdditionalDetails?: (state: any, element: import("../UIElement").UIElement<any>) => void;
|
|
19
24
|
onError?: (error: any, element?: import("../UIElement").UIElement<any>) => void;
|
|
20
|
-
|
|
25
|
+
onPaymentCompleted?: (result: any, element: import("../UIElement").UIElement<any>) => void;
|
|
26
|
+
beforeRedirect?: (resolve: any, reject: any, redirectData: any, element: import("../UIElement").UIElement<any>) => void;
|
|
21
27
|
name?: string;
|
|
22
28
|
icon?: string;
|
|
23
29
|
amount?: import("../../types").PaymentAmount;
|
|
24
30
|
showPayButton?: boolean;
|
|
31
|
+
setStatusAutomatically?: boolean;
|
|
25
32
|
payButton?: (options: any) => any;
|
|
26
33
|
loadingContext?: string;
|
|
27
34
|
createFromAction?: (action: import("../../types").PaymentAction, props: object) => import("../UIElement").UIElement<any>;
|
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
import { h } from 'preact';
|
|
2
|
-
import UIElement
|
|
2
|
+
import UIElement from '../UIElement';
|
|
3
|
+
import { UIElementProps } from '../types';
|
|
3
4
|
import Language from '../../language/Language';
|
|
4
|
-
|
|
5
|
+
import { IssuerItem } from '../internal/IssuerList/types';
|
|
6
|
+
interface IssuerListContainerProps extends UIElementProps {
|
|
5
7
|
showImage?: boolean;
|
|
6
8
|
placeholder?: string;
|
|
7
9
|
issuers?: IssuerItem[];
|
|
10
|
+
highlightedIssuers: string[];
|
|
8
11
|
i18n: Language;
|
|
9
12
|
loadingContext: string;
|
|
10
13
|
}
|
|
11
|
-
interface IssuerItem {
|
|
12
|
-
id: string;
|
|
13
|
-
name: string;
|
|
14
|
-
}
|
|
15
14
|
interface IssuerListData {
|
|
16
15
|
paymentMethod: {
|
|
17
16
|
type: string;
|
|
18
17
|
issuer: string;
|
|
19
18
|
};
|
|
20
19
|
}
|
|
21
|
-
declare class IssuerListContainer extends UIElement<
|
|
22
|
-
constructor(props:
|
|
20
|
+
declare class IssuerListContainer extends UIElement<IssuerListContainerProps> {
|
|
21
|
+
constructor(props: IssuerListContainerProps);
|
|
23
22
|
protected static defaultProps: {
|
|
24
23
|
showImage: boolean;
|
|
25
24
|
onValid: () => void;
|
|
26
25
|
issuers: any[];
|
|
26
|
+
highlightedIssuers: any[];
|
|
27
27
|
loadingContext: string;
|
|
28
28
|
};
|
|
29
29
|
formatProps(props: any): any;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { h } from 'preact';
|
|
2
|
-
import UIElement
|
|
2
|
+
import UIElement from '../UIElement';
|
|
3
|
+
import { UIElementProps } from '../types';
|
|
3
4
|
export interface QRLoaderContainerProps extends UIElementProps {
|
|
4
5
|
/**
|
|
5
6
|
* Number of miliseconds that the component will wait in between status calls
|
|
@@ -44,7 +44,7 @@ import BacsDD from './BacsDD';
|
|
|
44
44
|
import Address from './Address';
|
|
45
45
|
import PersonalDetails from './PersonalDetails';
|
|
46
46
|
import Klarna from './Klarna';
|
|
47
|
-
import Twint from
|
|
47
|
+
import Twint from './Twint';
|
|
48
48
|
/**
|
|
49
49
|
* Maps each component with a Component element.
|
|
50
50
|
*/
|
|
@@ -19,7 +19,7 @@ export interface AwaitComponentProps {
|
|
|
19
19
|
shouldRedirectOnMobile?: boolean;
|
|
20
20
|
classNameModifiers?: string[];
|
|
21
21
|
clientKey: string;
|
|
22
|
-
onError: (error: any
|
|
22
|
+
onError: (error: any) => void;
|
|
23
23
|
onComplete: (status: any, component: any) => void;
|
|
24
24
|
brandLogo: string;
|
|
25
25
|
messageText: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './ContentSeparator';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { h } from 'preact';
|
|
2
|
+
import './IssuerButton.scss';
|
|
3
|
+
interface IssuerButtonProps {
|
|
4
|
+
name: string;
|
|
5
|
+
id: string;
|
|
6
|
+
selected: boolean;
|
|
7
|
+
onClick: (event: UIEvent) => void;
|
|
8
|
+
icon?: string;
|
|
9
|
+
}
|
|
10
|
+
declare function IssuerButton({ name, id, icon, onClick, selected }: IssuerButtonProps): h.JSX.Element;
|
|
11
|
+
export default IssuerButton;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { h } from 'preact';
|
|
2
|
+
import './IssuerButtonGroup.scss';
|
|
3
|
+
import { IssuerItem } from '../types';
|
|
4
|
+
interface IssuerButtonGroupProps {
|
|
5
|
+
items: IssuerItem[];
|
|
6
|
+
selectedIssuerId: string;
|
|
7
|
+
onChange: (event: UIEvent) => void;
|
|
8
|
+
}
|
|
9
|
+
declare const IssuerButtonGroup: ({ items, selectedIssuerId, onChange }: IssuerButtonGroupProps) => h.JSX.Element;
|
|
10
|
+
export default IssuerButtonGroup;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './IssuerButtonGroup';
|
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
import { h } from 'preact';
|
|
2
|
+
import { IssuerListProps } from './types';
|
|
2
3
|
import './IssuerList.scss';
|
|
3
|
-
declare function IssuerList({ items, placeholder, issuer, ...props }:
|
|
4
|
-
[x: string]: any;
|
|
5
|
-
items: any;
|
|
6
|
-
placeholder: any;
|
|
7
|
-
issuer: any;
|
|
8
|
-
}): h.JSX.Element;
|
|
4
|
+
declare function IssuerList({ items, placeholder, issuer, highlightedIds, ...props }: IssuerListProps): h.JSX.Element;
|
|
9
5
|
declare namespace IssuerList {
|
|
10
6
|
var defaultProps: {
|
|
11
7
|
onChange: () => void;
|
|
12
|
-
placeholder: string;
|
|
13
8
|
};
|
|
14
9
|
}
|
|
15
10
|
export default IssuerList;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { PayButtonProps } from '../PayButton/PayButton';
|
|
2
|
+
import { ComponentChildren } from 'preact';
|
|
3
|
+
export interface IssuerListProps {
|
|
4
|
+
items: IssuerItem[];
|
|
5
|
+
showPayButton: boolean;
|
|
6
|
+
payButton(props: Partial<PayButtonProps>): ComponentChildren;
|
|
7
|
+
onChange(payload: any): void;
|
|
8
|
+
highlightedIds?: string[];
|
|
9
|
+
placeholder?: string;
|
|
10
|
+
issuer?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface IssuerItem {
|
|
13
|
+
id: string;
|
|
14
|
+
name: string;
|
|
15
|
+
icon?: string;
|
|
16
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { h } from 'preact';
|
|
2
2
|
import { PaymentAmount } from '../../../types';
|
|
3
|
-
import Language from
|
|
4
|
-
interface PayButtonProps {
|
|
3
|
+
import Language from '../../../language/Language';
|
|
4
|
+
export interface PayButtonProps {
|
|
5
5
|
/**
|
|
6
6
|
* Class name modifiers will be used as: `adyen-checkout__image--${modifier}`
|
|
7
7
|
*/
|
|
@@ -19,12 +19,12 @@ declare class QRLoader extends Component<QRLoaderProps, QRLoaderState> {
|
|
|
19
19
|
redirectToApp: (url: any, fallback?: () => void) => void;
|
|
20
20
|
componentDidUpdate(prevProps: any, prevState: any): void;
|
|
21
21
|
componentWillUnmount(): void;
|
|
22
|
-
onTick
|
|
23
|
-
onTimeUp
|
|
24
|
-
onComplete
|
|
25
|
-
onError
|
|
26
|
-
checkStatus
|
|
27
|
-
render({ amount, url, brandLogo, countdownTime,
|
|
22
|
+
private onTick;
|
|
23
|
+
private onTimeUp;
|
|
24
|
+
private onComplete;
|
|
25
|
+
private onError;
|
|
26
|
+
private checkStatus;
|
|
27
|
+
render({ amount, url, brandLogo, countdownTime, type }: QRLoaderProps, { expired, completed, loading }: {
|
|
28
28
|
expired: any;
|
|
29
29
|
completed: any;
|
|
30
30
|
loading: any;
|
|
@@ -3,7 +3,7 @@ import { SFPProps } from './defaultProps';
|
|
|
3
3
|
import { StylesObject, CbObjOnError } from './lib/types';
|
|
4
4
|
import { AddressData } from '../../../types';
|
|
5
5
|
import { BinLookupResponse } from '../../Card/types';
|
|
6
|
-
import { CVCPolicyType } from './lib/core/AbstractSecuredField';
|
|
6
|
+
import { CVCPolicyType, DatePolicyType } from './lib/core/AbstractSecuredField';
|
|
7
7
|
export interface SFPState {
|
|
8
8
|
status?: string;
|
|
9
9
|
brand?: string;
|
|
@@ -17,7 +17,7 @@ export interface SFPState {
|
|
|
17
17
|
hasUnsupportedCard?: boolean;
|
|
18
18
|
hasKoreanFields?: boolean;
|
|
19
19
|
showSocialSecurityNumber?: boolean;
|
|
20
|
-
|
|
20
|
+
expiryDatePolicy?: DatePolicyType;
|
|
21
21
|
socialSecurityNumber?: string;
|
|
22
22
|
}
|
|
23
23
|
export interface SingleBrandResetObject {
|
|
@@ -31,7 +31,7 @@ export interface SingleBrandResetObject {
|
|
|
31
31
|
declare class SecuredFieldsProvider extends Component<SFPProps, SFPState> {
|
|
32
32
|
private originKeyErrorTimeout;
|
|
33
33
|
private originKeyTimeoutMS;
|
|
34
|
-
private
|
|
34
|
+
private numCharsInField;
|
|
35
35
|
private rootNode;
|
|
36
36
|
private numDateFields;
|
|
37
37
|
private csf;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Language } from '../../../language/Language';
|
|
2
|
+
import { CVCPolicyType } from './lib/core/AbstractSecuredField';
|
|
2
3
|
export interface SFPProps {
|
|
3
4
|
/**
|
|
4
5
|
* CSF RELATED (±22)
|
|
@@ -44,7 +45,7 @@ export interface SFPProps {
|
|
|
44
45
|
billingAddressRequiredFields: string[];
|
|
45
46
|
brand: string;
|
|
46
47
|
createFromAction: () => {};
|
|
47
|
-
cvcPolicy:
|
|
48
|
+
cvcPolicy: CVCPolicyType;
|
|
48
49
|
data: object;
|
|
49
50
|
details: object[];
|
|
50
51
|
enableStoreDetails: boolean;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { CVCPolicyType, DatePolicyType } from '../core/AbstractSecuredField';
|
|
1
2
|
export declare const ENCRYPTED_CARD_NUMBER = "encryptedCardNumber";
|
|
2
3
|
export declare const ENCRYPTED_EXPIRY_DATE = "encryptedExpiryDate";
|
|
3
4
|
export declare const ENCRYPTED_EXPIRY_MONTH = "encryptedExpiryMonth";
|
|
@@ -10,15 +11,19 @@ export declare const ENCRYPTED_PIN_FIELD = "encryptedPin";
|
|
|
10
11
|
export declare const GIFT_CARD = "giftcard";
|
|
11
12
|
export declare const ENCRYPTED_BANK_ACCNT_NUMBER_FIELD = "encryptedBankAccountNumber";
|
|
12
13
|
export declare const ENCRYPTED_BANK_LOCATION_FIELD = "encryptedBankLocationId";
|
|
13
|
-
export declare const SF_VERSION = "3.
|
|
14
|
+
export declare const SF_VERSION = "3.7.2";
|
|
14
15
|
export declare const DEFAULT_CARD_GROUP_TYPES: string[];
|
|
15
16
|
export declare const NON_CREDIT_CARD_TYPE_SECURED_FIELDS: string[];
|
|
16
17
|
export declare const CSF_FIELDS_ARRAY: string[];
|
|
17
|
-
export declare const
|
|
18
|
-
export declare const
|
|
19
|
-
export declare const
|
|
20
|
-
export declare const
|
|
21
|
-
export declare const
|
|
18
|
+
export declare const REQUIRED = "required";
|
|
19
|
+
export declare const OPTIONAL = "optional";
|
|
20
|
+
export declare const HIDDEN = "hidden";
|
|
21
|
+
export declare const CVC_POLICY_REQUIRED: CVCPolicyType;
|
|
22
|
+
export declare const CVC_POLICY_OPTIONAL: CVCPolicyType;
|
|
23
|
+
export declare const CVC_POLICY_HIDDEN: CVCPolicyType;
|
|
24
|
+
export declare const DATE_POLICY_REQUIRED: DatePolicyType;
|
|
25
|
+
export declare const DATE_POLICY_OPTIONAL: DatePolicyType;
|
|
26
|
+
export declare const DATE_POLICY_HIDDEN: DatePolicyType;
|
|
22
27
|
export declare const DATA_ENCRYPTED_FIELD_ATTR = "data-cse";
|
|
23
28
|
export declare const DATA_INFO = "data-info";
|
|
24
29
|
export declare const DATA_UID = "data-uid";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CSFSetupObject, CSFConfigObject, CSFCallbacksConfig, CSFStateObject, SFFeedbackObj, SendBrandObject } from '../types';
|
|
1
|
+
import { CSFSetupObject, CSFConfigObject, CSFCallbacksConfig, CSFStateObject, SFFeedbackObj, SendBrandObject, SendExpiryDateObject } from '../types';
|
|
2
2
|
import { createSecuredFields } from './createSecuredFields';
|
|
3
3
|
import { handleProcessBrand } from './utils/processBrand';
|
|
4
4
|
import { handleBrandFromBinLookup } from './utils/handleBrandFromBinLookup';
|
|
@@ -29,6 +29,7 @@ declare abstract class AbstractCSF {
|
|
|
29
29
|
protected processAutoComplete: (pFeedbackObj: SFFeedbackObj) => void;
|
|
30
30
|
protected processBrand: typeof handleProcessBrand;
|
|
31
31
|
protected sendBrandToCardSF: (brandObj: SendBrandObject) => void;
|
|
32
|
+
protected sendExpiryDatePolicyToSF: (dateObj: SendExpiryDateObject) => void;
|
|
32
33
|
protected setFocusOnFrame: (pFieldType: string, doLog?: boolean) => void;
|
|
33
34
|
protected setupSecuredField: (pItem: HTMLElement) => void;
|
|
34
35
|
protected touchendListener: (e: Event) => void;
|
|
@@ -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
|
-
|
|
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
|
|
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
|
|
27
|
-
set
|
|
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;
|
package/dist/types/components/internal/SecuredFields/lib/core/utils/handleBrandFromBinLookup.d.ts
CHANGED
|
@@ -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:
|
|
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?:
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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,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
|
+
}
|