@adyen/adyen-web 5.29.0 → 5.30.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 +9 -4
- 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 +9 -4
- package/dist/cjs/adyen.css.map +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/es/adyen.css +9 -4
- 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/pt-PT.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/es.modern/adyen.css +9 -4
- package/dist/es.modern/adyen.css.map +1 -1
- package/dist/es.modern/ar.js +1 -1
- package/dist/es.modern/cs-CZ.js +1 -1
- package/dist/es.modern/da-DK.js +1 -1
- package/dist/es.modern/de-DE.js +1 -1
- package/dist/es.modern/el-GR.js +1 -1
- package/dist/es.modern/es-ES.js +1 -1
- package/dist/es.modern/fi-FI.js +1 -1
- package/dist/es.modern/fr-FR.js +1 -1
- package/dist/es.modern/hr-HR.js +1 -1
- package/dist/es.modern/hu-HU.js +1 -1
- package/dist/es.modern/index.js +1 -1
- package/dist/es.modern/it-IT.js +1 -1
- package/dist/es.modern/ja-JP.js +1 -1
- package/dist/es.modern/ko-KR.js +1 -1
- package/dist/es.modern/nl-NL.js +1 -1
- package/dist/es.modern/no-NO.js +1 -1
- package/dist/es.modern/pl-PL.js +1 -1
- package/dist/es.modern/pt-BR.js +1 -1
- package/dist/es.modern/pt-PT.js +1 -1
- package/dist/es.modern/ro-RO.js +1 -1
- package/dist/es.modern/ru-RU.js +1 -1
- package/dist/es.modern/sk-SK.js +1 -1
- package/dist/es.modern/sl-SI.js +1 -1
- package/dist/es.modern/sv-SE.js +1 -1
- package/dist/es.modern/zh-CN.js +1 -1
- package/dist/es.modern/zh-TW.js +1 -1
- package/dist/types/components/BaseElement.d.ts +7 -3
- package/dist/types/components/Card/components/CardInput/types.d.ts +1 -0
- package/dist/types/components/Card/components/ClickToPay/ClickToPayComponent.d.ts +2 -2
- package/dist/types/components/Card/components/ClickToPay/components/CtPBrand/CtPBrand.d.ts +7 -0
- package/dist/types/components/Card/components/ClickToPay/components/CtPBrand/index.d.ts +1 -0
- package/dist/types/components/Card/components/ClickToPay/components/CtPCards/CtPCards.d.ts +2 -2
- package/dist/types/components/Card/components/ClickToPay/components/CtPCards/CtPCardsList/CtPCardsList.d.ts +2 -1
- package/dist/types/components/Card/components/ClickToPay/components/CtPCards/CtPEmptyCardsList/CtPEmptyCardsList.d.ts +2 -4
- package/dist/types/components/Card/components/ClickToPay/components/CtPCards/CtPSingleCard/CtPSingleCard.d.ts +2 -1
- package/dist/types/components/Card/components/ClickToPay/components/CtPInfo/CtPInfo.d.ts +4 -0
- package/dist/types/components/Card/components/ClickToPay/components/CtPInfo/CtPInfoModal/CtPInfoModal.d.ts +9 -0
- package/dist/types/components/Card/components/ClickToPay/components/CtPInfo/CtPInfoModal/index.d.ts +1 -0
- package/dist/types/components/Card/components/ClickToPay/components/CtPInfo/index.d.ts +1 -0
- package/dist/types/components/Card/components/ClickToPay/components/CtPOneTimePassword/CtPOneTimePassword.d.ts +4 -1
- package/dist/types/components/Card/components/ClickToPay/components/CtPOneTimePassword/CtPOneTimePasswordInput/CtPOneTimePasswordInput.d.ts +2 -0
- package/dist/types/components/Card/components/ClickToPay/components/CtPOneTimePassword/CtPOneTimePasswordInput/CtPResendOtpLink.d.ts +2 -1
- package/dist/types/components/Card/components/ClickToPay/components/CtPSection/CtPSection.d.ts +10 -1
- package/dist/types/components/Card/components/ClickToPay/components/CtPSection/CtPSectionTitle.d.ts +0 -0
- package/dist/types/components/Card/components/ClickToPay/context/ClickToPayContext.d.ts +1 -0
- package/dist/types/components/Card/components/ClickToPay/models/ShopperCard.d.ts +2 -1
- package/dist/types/components/Card/components/ClickToPay/services/ClickToPayService.d.ts +5 -7
- package/dist/types/components/Card/components/ClickToPay/services/sdks/AbstractSrcInitiator.d.ts +1 -1
- package/dist/types/components/Card/components/ClickToPay/services/sdks/SrciError.d.ts +3 -1
- package/dist/types/components/Card/components/ClickToPay/services/sdks/types.d.ts +2 -0
- package/dist/types/components/Card/components/ClickToPay/services/types.d.ts +7 -2
- package/dist/types/components/Dropin/Dropin.d.ts +6 -4
- package/dist/types/components/Dropin/types.d.ts +1 -1
- package/dist/types/components/DuitNow/DuitNow.d.ts +46 -0
- package/dist/types/components/DuitNow/config.d.ts +7 -0
- package/dist/types/components/DuitNow/index.d.ts +1 -0
- package/dist/types/components/ThreeDS2/ThreeDS2Challenge.d.ts +4 -3
- package/dist/types/components/ThreeDS2/ThreeDS2DeviceFingerprint.d.ts +3 -2
- package/dist/types/components/ThreeDS2/components/Challenge/PrepareChallenge3DS2.d.ts +1 -2
- package/dist/types/components/ThreeDS2/components/Challenge/types.d.ts +1 -1
- package/dist/types/components/ThreeDS2/components/utils.d.ts +2 -2
- package/dist/types/components/ThreeDS2/config.d.ts +3 -3
- package/dist/types/components/ThreeDS2/types.d.ts +6 -0
- package/dist/types/components/index.d.ts +2 -0
- package/dist/types/components/internal/FormFields/InputBase.d.ts +6 -1
- package/dist/types/components/internal/FormFields/index.d.ts +2 -1
- package/dist/types/components/internal/Modal/Modal.d.ts +28 -0
- package/dist/types/components/internal/Modal/index.d.ts +1 -0
- package/dist/types/components/internal/Modal/useModal.d.ts +17 -0
- package/dist/types/components/internal/Modal/useTrapFocus.d.ts +17 -0
- package/dist/types/components/internal/SecuredFields/SFP/types.d.ts +1 -0
- package/dist/types/components/internal/SecuredFields/lib/CSF/AbstractCSF.d.ts +1 -1
- package/dist/types/components/internal/SecuredFields/lib/CSF/extensions/handleConfig.d.ts +2 -1
- package/dist/types/components/internal/SecuredFields/lib/CSF/types.d.ts +21 -10
- package/dist/types/components/internal/SecuredFields/lib/securedField/AbstractSecuredField.d.ts +18 -10
- package/dist/types/components/internal/SecuredFields/lib/securedField/SecuredField.d.ts +2 -2
- package/dist/types/components/internal/SecuredFields/lib/types.d.ts +1 -0
- package/dist/types/components/types.d.ts +31 -0
- package/dist/types/core/RiskModule/RiskModule.d.ts +2 -1
- package/dist/types/language/config.d.ts +21 -7
- package/dist/types/language/locales/index.d.ts +1092 -364
- package/dist/types/utils/get-process-message-handler.d.ts +2 -1
- package/dist/types/utils/promise-util.d.ts +9 -0
- package/package.json +9 -9
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import QRLoaderContainer from '../helpers/QRLoaderContainer';
|
|
2
|
+
declare class DuitNowElement extends QRLoaderContainer {
|
|
3
|
+
static type: string;
|
|
4
|
+
formatProps(props: any): {
|
|
5
|
+
delay: number;
|
|
6
|
+
countdownTime: number;
|
|
7
|
+
type?: string;
|
|
8
|
+
brandLogo?: string;
|
|
9
|
+
buttonLabel?: string;
|
|
10
|
+
shouldRedirectOnMobile?: boolean;
|
|
11
|
+
qrCodeImage?: string;
|
|
12
|
+
paymentData?: string;
|
|
13
|
+
instructions?: string;
|
|
14
|
+
session?: import("../../core/CheckoutSession/CheckoutSession").default;
|
|
15
|
+
onChange?: (state: any, element: import("../UIElement").UIElement<any>) => void;
|
|
16
|
+
onValid?: (state: any, element: import("../UIElement").UIElement<any>) => void;
|
|
17
|
+
beforeSubmit?: (state: any, element: import("../UIElement").UIElement<any>, actions: any) => Promise<void>;
|
|
18
|
+
onSubmit?: (state: any, element: import("../UIElement").UIElement<any>) => void;
|
|
19
|
+
onComplete?: (state: any, element: import("../UIElement").UIElement<any>) => void;
|
|
20
|
+
onAdditionalDetails?: (state: any, element: import("../UIElement").UIElement<any>) => void;
|
|
21
|
+
onError?: (error: any, element?: import("../UIElement").UIElement<any>) => void;
|
|
22
|
+
onPaymentCompleted?: (result: any, element: import("../UIElement").UIElement<any>) => void;
|
|
23
|
+
beforeRedirect?: (resolve: any, reject: any, redirectData: any, element: import("../UIElement").UIElement<any>) => void;
|
|
24
|
+
isInstantPayment?: boolean;
|
|
25
|
+
name?: string;
|
|
26
|
+
icon?: string;
|
|
27
|
+
amount?: import("../../types").PaymentAmount;
|
|
28
|
+
secondaryAmount?: import("../../types").PaymentAmountExtended;
|
|
29
|
+
showPayButton?: boolean;
|
|
30
|
+
setStatusAutomatically?: boolean;
|
|
31
|
+
payButton?: (options: import("../types").PayButtonFunctionProps) => import("preact").JSX.Element;
|
|
32
|
+
loadingContext?: string;
|
|
33
|
+
createFromAction?: (action: import("../../types").PaymentAction, props: object) => import("../UIElement").UIElement<any>;
|
|
34
|
+
clientKey?: string;
|
|
35
|
+
elementRef?: any;
|
|
36
|
+
i18n?: import("../../language").default;
|
|
37
|
+
_parentInstance?: import("../../core/core").default;
|
|
38
|
+
order?: import("../../types").Order;
|
|
39
|
+
modules?: {
|
|
40
|
+
analytics: import("../../core/Analytics/Analytics").default;
|
|
41
|
+
risk: import("../../core/RiskModule").default;
|
|
42
|
+
};
|
|
43
|
+
isDropin?: boolean;
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
export default DuitNowElement;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './DuitNow';
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { h } from 'preact';
|
|
2
2
|
import UIElement from '../UIElement';
|
|
3
|
-
import {
|
|
3
|
+
import { ErrorCodeObject } from './components/utils';
|
|
4
4
|
import Language from '../../language';
|
|
5
|
+
import { ThreeDS2ChallengeRejectObject } from './types';
|
|
5
6
|
export interface ThreeDS2ChallengeProps {
|
|
6
7
|
token?: string;
|
|
7
8
|
dataKey?: string;
|
|
8
9
|
notificationURL?: string;
|
|
9
|
-
onError?: (error: string |
|
|
10
|
+
onError?: (error: string | ErrorCodeObject | ThreeDS2ChallengeRejectObject) => void;
|
|
10
11
|
paymentData?: string;
|
|
11
12
|
size?: string;
|
|
12
13
|
challengeWindowSize?: '01' | '02' | '03' | '04' | '05';
|
|
@@ -14,7 +15,6 @@ export interface ThreeDS2ChallengeProps {
|
|
|
14
15
|
loadingContext?: string;
|
|
15
16
|
useOriginalFlow?: boolean;
|
|
16
17
|
i18n?: Language;
|
|
17
|
-
threeDS2MDFlowUnloadListener?: any;
|
|
18
18
|
}
|
|
19
19
|
declare class ThreeDS2Challenge extends UIElement<ThreeDS2ChallengeProps> {
|
|
20
20
|
static type: string;
|
|
@@ -23,6 +23,7 @@ declare class ThreeDS2Challenge extends UIElement<ThreeDS2ChallengeProps> {
|
|
|
23
23
|
size: string;
|
|
24
24
|
type: string;
|
|
25
25
|
};
|
|
26
|
+
onComplete(state: any): void;
|
|
26
27
|
render(): h.JSX.Element;
|
|
27
28
|
}
|
|
28
29
|
export default ThreeDS2Challenge;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { h } from 'preact';
|
|
2
2
|
import UIElement from '../UIElement';
|
|
3
|
-
import {
|
|
3
|
+
import { ErrorCodeObject } from './components/utils';
|
|
4
4
|
export interface ThreeDS2DeviceFingerprintProps {
|
|
5
5
|
dataKey: string;
|
|
6
6
|
token: string;
|
|
7
7
|
notificationURL: string;
|
|
8
|
-
onError: (error?: string |
|
|
8
|
+
onError: (error?: string | ErrorCodeObject) => void;
|
|
9
9
|
paymentData: string;
|
|
10
10
|
showSpinner: boolean;
|
|
11
11
|
type: string;
|
|
@@ -21,6 +21,7 @@ declare class ThreeDS2DeviceFingerprint extends UIElement<ThreeDS2DeviceFingerpr
|
|
|
21
21
|
type: string;
|
|
22
22
|
};
|
|
23
23
|
private callSubmit3DS2Fingerprint;
|
|
24
|
+
onComplete(state: any): void;
|
|
24
25
|
render(): h.JSX.Element;
|
|
25
26
|
}
|
|
26
27
|
export default ThreeDS2DeviceFingerprint;
|
|
@@ -8,9 +8,8 @@ declare class PrepareChallenge3DS2 extends Component<PrepareChallenge3DS2Props,
|
|
|
8
8
|
onError: () => void;
|
|
9
9
|
};
|
|
10
10
|
constructor(props: any);
|
|
11
|
-
remove3DS2MDFlowUnloadListener(): void;
|
|
12
11
|
setStatusComplete(resultObj: any): void;
|
|
13
|
-
setStatusError(
|
|
12
|
+
setStatusError(errorInfoObj: any): void;
|
|
14
13
|
render(props: any, { challengeData }: {
|
|
15
14
|
challengeData: any;
|
|
16
15
|
}): h.JSX.Element;
|
|
@@ -4,7 +4,6 @@ import { ThreeDS2ChallengeProps } from '../../ThreeDS2Challenge';
|
|
|
4
4
|
export interface DoChallenge3DS2Props extends ChallengeData {
|
|
5
5
|
onCompleteChallenge: (resolveObject: ThreeDS2FlowObject) => void;
|
|
6
6
|
onErrorChallenge: (rejectObject: ThreeDS2FlowObject) => void;
|
|
7
|
-
threeDS2MDFlowUnloadListener?: (event: any) => any;
|
|
8
7
|
}
|
|
9
8
|
export interface DoChallenge3DS2State {
|
|
10
9
|
base64URLencodedData?: string;
|
|
@@ -16,4 +15,5 @@ export interface PrepareChallenge3DS2Props extends ThreeDS2ChallengeProps {
|
|
|
16
15
|
export interface PrepareChallenge3DS2State {
|
|
17
16
|
challengeData?: ChallengeData;
|
|
18
17
|
status?: string;
|
|
18
|
+
errorInfo?: string;
|
|
19
19
|
}
|
|
@@ -12,7 +12,7 @@ export interface ChallengeResolveData {
|
|
|
12
12
|
};
|
|
13
13
|
};
|
|
14
14
|
}
|
|
15
|
-
export interface
|
|
15
|
+
export interface ErrorCodeObject {
|
|
16
16
|
errorCode: string;
|
|
17
17
|
message: string;
|
|
18
18
|
}
|
|
@@ -67,7 +67,7 @@ export declare const createFingerprintResolveData: (dataKey: string, resultObj:
|
|
|
67
67
|
export declare const createOldFingerprintResolveData: (dataKey: string, resultObj: ResultObject, paymentData: string) => any;
|
|
68
68
|
export declare const createChallengeResolveData: (dataKey: string, transStatus: string, authorisationToken: string) => ChallengeResolveData;
|
|
69
69
|
export declare const createOldChallengeResolveData: (dataKey: string, transStatus: string, authorisationToken: string) => any;
|
|
70
|
-
export declare const handleErrorCode: (errorCode: string, errorDescription?: string) =>
|
|
70
|
+
export declare const handleErrorCode: (errorCode: string, errorDescription?: string) => ErrorCodeObject;
|
|
71
71
|
/**
|
|
72
72
|
*
|
|
73
73
|
* Takes a string and encodes it as a base64url string
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { ThreeDS2FlowObject } from './types';
|
|
1
|
+
import { ThreeDS2FlowObject, ThreeDS2ChallengeRejectObject } from './types';
|
|
2
2
|
export declare const DEFAULT_CHALLENGE_WINDOW_SIZE = "02";
|
|
3
3
|
export declare const THREEDS_METHOD_TIMEOUT = 10000;
|
|
4
4
|
export declare const CHALLENGE_TIMEOUT = 600000;
|
|
5
|
-
export declare const
|
|
6
|
-
export declare const
|
|
5
|
+
export declare const CHALLENGE_UNKNOWN_ERROR_REJECT_OBJECT: ThreeDS2ChallengeRejectObject;
|
|
6
|
+
export declare const CHALLENGE_TIMEOUT_REJECT_OBJECT: ThreeDS2FlowObject;
|
|
7
7
|
export declare const FAILED_METHOD_STATUS_RESOLVE_OBJECT: ThreeDS2FlowObject;
|
|
8
8
|
export declare const FAILED_METHOD_STATUS_RESOLVE_OBJECT_TIMEOUT: ThreeDS2FlowObject;
|
|
9
9
|
export declare const ERRORS: {
|
|
@@ -29,6 +29,12 @@ export interface ThreeDS2FlowObject {
|
|
|
29
29
|
errorCode?: string;
|
|
30
30
|
threeDSServerTransID?: string;
|
|
31
31
|
}
|
|
32
|
+
export interface ThreeDS2ChallengeRejectObject {
|
|
33
|
+
type: 'challengeError';
|
|
34
|
+
comment?: string;
|
|
35
|
+
extraInfo?: string;
|
|
36
|
+
eventDataRaw?: string;
|
|
37
|
+
}
|
|
32
38
|
export interface ThreeDS2Token {
|
|
33
39
|
acsTransID?: string;
|
|
34
40
|
acsURL?: string;
|
|
@@ -56,6 +56,7 @@ import OnlineBankingCZElement from './OnlineBankingCZ';
|
|
|
56
56
|
import OnlineBankingSKElement from './OnlineBankingSK';
|
|
57
57
|
import PayByBank from './PayByBank';
|
|
58
58
|
import PromptPay from "./PromptPay";
|
|
59
|
+
import Duitnow from "./DuitNow";
|
|
59
60
|
/**
|
|
60
61
|
* Maps each component with a Component element.
|
|
61
62
|
*/
|
|
@@ -187,6 +188,7 @@ declare const componentsMap: {
|
|
|
187
188
|
wechatpayQR: typeof WeChat;
|
|
188
189
|
promptpay: typeof PromptPay;
|
|
189
190
|
paynow: typeof PayNow;
|
|
191
|
+
duitnow: typeof Duitnow;
|
|
190
192
|
/** QRLoader */
|
|
191
193
|
/** Await */
|
|
192
194
|
blik: typeof Blik;
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { h } from 'preact';
|
|
2
|
-
|
|
2
|
+
export interface InputBaseProps {
|
|
3
|
+
/** Callback used to return the input element reference to parent component (Ex: Used to trigger focus programmatically) */
|
|
4
|
+
onCreateRef?(reference: HTMLInputElement): void;
|
|
5
|
+
[key: string]: any;
|
|
6
|
+
}
|
|
7
|
+
declare function InputBase({ onCreateRef, ...props }: InputBaseProps): h.JSX.Element;
|
|
3
8
|
declare namespace InputBase {
|
|
4
9
|
var defaultProps: {
|
|
5
10
|
type: string;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { h } from 'preact';
|
|
2
2
|
import './FormFields.scss';
|
|
3
|
-
|
|
3
|
+
import { InputBaseProps } from './InputBase';
|
|
4
|
+
export declare const renderFormField: (type: any, props: InputBaseProps) => h.JSX.Element;
|
|
4
5
|
export default renderFormField;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ComponentChildren, h } from 'preact';
|
|
2
|
+
import './Modal.scss';
|
|
3
|
+
declare type ModalRenderFnProps = {
|
|
4
|
+
/**
|
|
5
|
+
* Function used to properly trigger the Modal close mechanism. It takes into account the element that the Modal needs
|
|
6
|
+
* to set focus when it is dismissed.
|
|
7
|
+
*/
|
|
8
|
+
onCloseModal(): void;
|
|
9
|
+
};
|
|
10
|
+
declare type ModalProps = {
|
|
11
|
+
children: ({ onCloseModal }: ModalRenderFnProps) => ComponentChildren;
|
|
12
|
+
classNameModifiers?: string[];
|
|
13
|
+
onClose(): void;
|
|
14
|
+
isOpen: boolean;
|
|
15
|
+
isDismissible?: boolean;
|
|
16
|
+
labelledBy: string;
|
|
17
|
+
describedBy: string;
|
|
18
|
+
/**
|
|
19
|
+
* Reference to the element that should be focused when the modal is opened
|
|
20
|
+
*/
|
|
21
|
+
focusFirst: HTMLElement;
|
|
22
|
+
/**
|
|
23
|
+
* Reference to the element that should be focused when the modal is closed
|
|
24
|
+
*/
|
|
25
|
+
focusAfterClose: HTMLElement;
|
|
26
|
+
};
|
|
27
|
+
declare const Modal: ({ children, classNameModifiers, isOpen, onClose, isDismissible, labelledBy, describedBy, focusFirst, focusAfterClose, ...props }: ModalProps) => h.JSX.Element;
|
|
28
|
+
export { Modal };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Modal } from './Modal';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
declare type UseModalProps = {
|
|
2
|
+
modalElement?: HTMLElement;
|
|
3
|
+
isOpen: boolean;
|
|
4
|
+
isDismissible: boolean;
|
|
5
|
+
focusFirst: HTMLElement;
|
|
6
|
+
focusAfterClose: HTMLElement;
|
|
7
|
+
onClose(): void;
|
|
8
|
+
};
|
|
9
|
+
declare type UseModalHook = {
|
|
10
|
+
/**
|
|
11
|
+
* Function that focus on the 'focusAfterClose' element, and then closes the modal
|
|
12
|
+
*/
|
|
13
|
+
closeModal(): void;
|
|
14
|
+
handleClickOutside(event: MouseEvent): void;
|
|
15
|
+
};
|
|
16
|
+
declare const useModal: ({ modalElement, isOpen, isDismissible, focusFirst, focusAfterClose, onClose }: UseModalProps) => UseModalHook;
|
|
17
|
+
export { useModal };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
declare type UseTrapFocusProps = {
|
|
2
|
+
rootElement?: HTMLElement;
|
|
3
|
+
/**
|
|
4
|
+
* Element that must be focused when the hook is executed. If no element is passed, the first focusable child
|
|
5
|
+
* element of the root element will be focused
|
|
6
|
+
*/
|
|
7
|
+
focusFirst?: HTMLElement;
|
|
8
|
+
/**
|
|
9
|
+
* Can be used to conditionally disable the trap mechanism
|
|
10
|
+
*/
|
|
11
|
+
shouldTrap?: boolean;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Hook used to trap the focus within the specific element and its child nodes.
|
|
15
|
+
*/
|
|
16
|
+
declare const useTrapFocus: ({ rootElement, focusFirst, shouldTrap }: UseTrapFocusProps) => void;
|
|
17
|
+
export { useTrapFocus };
|
|
@@ -11,7 +11,7 @@ declare abstract class AbstractCSF {
|
|
|
11
11
|
protected validateForm: () => void;
|
|
12
12
|
protected handleBrandFromBinLookup: typeof handleBrandFromBinLookup;
|
|
13
13
|
protected callbacksHandler: (callbacksObj: object) => void;
|
|
14
|
-
protected configHandler: () => void;
|
|
14
|
+
protected configHandler: (props: CSFSetupObject) => void;
|
|
15
15
|
protected createCardSecuredFields: (securedFields: HTMLElement[]) => Promise<any>;
|
|
16
16
|
protected createNonCardSecuredFields: (securedFields: HTMLElement[]) => Promise<any>;
|
|
17
17
|
protected createSecuredFields: typeof createSecuredFields;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { CSFSetupObject } from '../types';
|
|
1
2
|
/**
|
|
2
3
|
* Parses this.props to set 'config' type vars on this (CSFComp)
|
|
3
4
|
* - properties that just need to be set once, at startup, and then don't change
|
|
4
5
|
*
|
|
5
6
|
* See interface ConfigObject in types.ts
|
|
6
7
|
*/
|
|
7
|
-
export declare function handleConfig(): void;
|
|
8
|
+
export declare function handleConfig(props: CSFSetupObject): void;
|
|
@@ -17,37 +17,48 @@ export interface CSFReturnObject {
|
|
|
17
17
|
sfIsOptionalOrHidden: (f: string) => boolean;
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
20
|
-
* Base interface for
|
|
20
|
+
* Base interface for CSFSetupObject & CSFConfigObject
|
|
21
|
+
*
|
|
22
|
+
* These are the props that are passed from SFP when CSF is initialised but which also end up
|
|
23
|
+
* as props in CSF->this.config: CSFConfigObject
|
|
21
24
|
*/
|
|
22
25
|
interface CSFCommonProps {
|
|
26
|
+
allowedDOMAccess?: boolean | string;
|
|
27
|
+
autoFocus?: boolean | string;
|
|
28
|
+
keypadFix?: boolean | string;
|
|
23
29
|
loadingContext: string;
|
|
24
30
|
cardGroupTypes?: string[];
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
trimTrailingSeparator?: boolean;
|
|
28
|
-
showWarnings?: boolean;
|
|
29
|
-
keypadFix?: boolean;
|
|
30
|
-
isKCP?: boolean;
|
|
31
|
+
trimTrailingSeparator?: boolean | string;
|
|
32
|
+
showWarnings?: boolean | string;
|
|
31
33
|
iframeUIConfig?: object;
|
|
32
34
|
legacyInputMode?: boolean;
|
|
33
35
|
minimumExpiryDate?: string;
|
|
34
36
|
implementationType?: 'components' | 'custom';
|
|
35
37
|
isCollatingErrors?: boolean;
|
|
38
|
+
maskSecurityCode: boolean;
|
|
36
39
|
}
|
|
37
40
|
/**
|
|
38
|
-
*
|
|
41
|
+
* The object sent when SecuredFieldsProvider initialises CSF
|
|
42
|
+
*
|
|
43
|
+
* The properties defined here are ones that will not end up on CSF->this.config
|
|
39
44
|
*/
|
|
40
45
|
export interface CSFSetupObject extends CSFCommonProps {
|
|
41
46
|
type: string;
|
|
42
47
|
clientKey: string;
|
|
43
48
|
rootNode: string | HTMLElement;
|
|
44
49
|
callbacks?: object;
|
|
50
|
+
isKCP?: boolean;
|
|
45
51
|
i18n?: Language;
|
|
46
52
|
forceCompat: boolean;
|
|
47
53
|
}
|
|
48
54
|
/**
|
|
49
|
-
* The type for the config object created by CSF
|
|
50
|
-
*
|
|
55
|
+
* The type for the this.config object created by CSF - properties that just need to be set once, at startup, and then don't change.
|
|
56
|
+
*
|
|
57
|
+
* The CSFConfigObject provides the source for many of the properties that are written into the
|
|
58
|
+
* SecuredFieldInitObj used by createSecuredFields.ts to initialise a new SecuredField.ts
|
|
59
|
+
*
|
|
60
|
+
* Properties defined directly in *this* interface c.f. CSFCommonProps are ones that are not part of the CSFSetupObject
|
|
61
|
+
* and which are generated/calculated in handleConfig.ts
|
|
51
62
|
*/
|
|
52
63
|
export interface CSFConfigObject extends CSFCommonProps {
|
|
53
64
|
iframeSrc: string;
|
package/dist/types/components/internal/SecuredFields/lib/securedField/AbstractSecuredField.d.ts
CHANGED
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
import { CVCPolicyType, DatePolicyType, RtnType_callbackFn, RtnType_noParamVoidFn, RtnType_postMessageListener, StylesObject } from '../types';
|
|
2
2
|
import { ENCRYPTED_BANK_ACCNT_NUMBER_FIELD, ENCRYPTED_BANK_LOCATION_FIELD, ENCRYPTED_CARD_NUMBER, ENCRYPTED_EXPIRY_DATE, ENCRYPTED_EXPIRY_MONTH, ENCRYPTED_EXPIRY_YEAR, ENCRYPTED_PWD_FIELD, ENCRYPTED_SECURITY_CODE, ENCRYPTED_SECURITY_CODE_3_DIGITS, ENCRYPTED_SECURITY_CODE_4_DIGITS } from '../configuration/constants';
|
|
3
3
|
/**
|
|
4
|
-
* Base interface, props common to both
|
|
4
|
+
* Base interface, props common to both SecuredFieldInitObj & IframeConfigObject
|
|
5
|
+
*
|
|
6
|
+
* These are the props that are passed from CSF.createSecuredFields when SecuredField.ts is initialised
|
|
7
|
+
* but which also end up as props in the IframeConfigObject
|
|
5
8
|
*/
|
|
6
9
|
export interface SFInternalConfig {
|
|
7
10
|
fieldType: string;
|
|
8
11
|
extraFieldData: string;
|
|
12
|
+
uid: string;
|
|
13
|
+
cvcPolicy: CVCPolicyType;
|
|
14
|
+
expiryDatePolicy: DatePolicyType;
|
|
9
15
|
txVariant: string;
|
|
10
16
|
cardGroupTypes: string[];
|
|
11
17
|
iframeUIConfig: IframeUIConfigObject;
|
|
@@ -13,26 +19,28 @@ export interface SFInternalConfig {
|
|
|
13
19
|
trimTrailingSeparator: boolean;
|
|
14
20
|
isCreditCardType: boolean;
|
|
15
21
|
showWarnings: boolean;
|
|
16
|
-
cvcPolicy: CVCPolicyType;
|
|
17
|
-
expiryDatePolicy: DatePolicyType;
|
|
18
22
|
legacyInputMode: boolean;
|
|
19
23
|
minimumExpiryDate: string;
|
|
20
|
-
uid: string;
|
|
21
24
|
implementationType: string;
|
|
22
|
-
bundleType: string;
|
|
23
25
|
isCollatingErrors: boolean;
|
|
26
|
+
maskSecurityCode: boolean;
|
|
24
27
|
}
|
|
25
28
|
/**
|
|
26
|
-
* The object
|
|
29
|
+
* The object sent when createSecuredFields initialises a new instance of SecuredField.ts
|
|
30
|
+
*
|
|
31
|
+
* Properties defined directly in *this* interface c.f. SFInternalConfig are ones
|
|
32
|
+
* that are needed by SecuredField.ts but are *not* required in the IframeConfigObject
|
|
27
33
|
*/
|
|
28
|
-
export interface
|
|
29
|
-
expiryDatePolicy: DatePolicyType;
|
|
34
|
+
export interface SecuredFieldInitObj extends SFInternalConfig {
|
|
30
35
|
iframeSrc: string;
|
|
31
36
|
loadingContext: string;
|
|
32
37
|
holderEl: HTMLElement;
|
|
33
38
|
}
|
|
34
39
|
/**
|
|
35
|
-
* Object sent via postMessage to a SecuredField iframe
|
|
40
|
+
* Object sent via postMessage to a SecuredField iframe in order to configure that iframe
|
|
41
|
+
*
|
|
42
|
+
* Properties defined directly in *this* interface are ones that are calculated by SecuredField.ts
|
|
43
|
+
* instead of just being read directly from the SecuredFieldInitObj
|
|
36
44
|
*/
|
|
37
45
|
export interface IframeConfigObject extends SFInternalConfig {
|
|
38
46
|
numKey: number;
|
|
@@ -65,7 +73,7 @@ export interface AriaConfigObject {
|
|
|
65
73
|
error?: object;
|
|
66
74
|
}
|
|
67
75
|
declare abstract class AbstractSecuredField {
|
|
68
|
-
|
|
76
|
+
sfConfig: SFInternalConfig;
|
|
69
77
|
fieldType: string;
|
|
70
78
|
protected iframeSrc: string;
|
|
71
79
|
protected loadingContext: string;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import AbstractSecuredField, {
|
|
1
|
+
import AbstractSecuredField, { SecuredFieldInitObj } from './AbstractSecuredField';
|
|
2
2
|
import { CVCPolicyType, DatePolicyType, RtnType_noParamVoidFn, RtnType_postMessageListener, RtnType_callbackFn } from '../types';
|
|
3
3
|
import Language from '../../../../../language/Language';
|
|
4
4
|
declare class SecuredField extends AbstractSecuredField {
|
|
5
|
-
constructor(pSetupObj:
|
|
5
|
+
constructor(pSetupObj: SecuredFieldInitObj, i18n: Language);
|
|
6
6
|
init(i18n: Language): SecuredField;
|
|
7
7
|
iframeOnLoadListenerFn(): void;
|
|
8
8
|
postMessageListenerFn(event: MessageEvent): void;
|
|
@@ -5,6 +5,37 @@ import Analytics from '../core/Analytics';
|
|
|
5
5
|
import RiskElement from '../core/RiskModule';
|
|
6
6
|
import { PayButtonProps } from './internal/PayButton/PayButton';
|
|
7
7
|
import Session from '../core/CheckoutSession';
|
|
8
|
+
export interface PaymentMethodData {
|
|
9
|
+
paymentMethod: {
|
|
10
|
+
[key: string]: any;
|
|
11
|
+
checkoutAttemptId?: string;
|
|
12
|
+
};
|
|
13
|
+
browserInfo?: {
|
|
14
|
+
acceptHeader: string;
|
|
15
|
+
colorDepth: number;
|
|
16
|
+
javaEnabled: boolean;
|
|
17
|
+
language: string;
|
|
18
|
+
screenHeight: number;
|
|
19
|
+
screenWidth: number;
|
|
20
|
+
timeZoneOffset: number;
|
|
21
|
+
userAgent: string;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Represents the payment data that will be submitted to the /payments endpoint
|
|
26
|
+
*/
|
|
27
|
+
export interface PaymentData extends PaymentMethodData {
|
|
28
|
+
riskData?: {
|
|
29
|
+
clientData: string;
|
|
30
|
+
};
|
|
31
|
+
order?: {
|
|
32
|
+
orderData: string;
|
|
33
|
+
pspReference: string;
|
|
34
|
+
};
|
|
35
|
+
clientStateDataIndicator: boolean;
|
|
36
|
+
sessionData?: string;
|
|
37
|
+
storePaymentMethod?: boolean;
|
|
38
|
+
}
|
|
8
39
|
export interface PaymentResponse {
|
|
9
40
|
action?: PaymentAction;
|
|
10
41
|
resultCode: string;
|
|
@@ -11,6 +11,7 @@ interface RiskModuleProps extends BaseElementProps {
|
|
|
11
11
|
risk: RiskModuleOptions;
|
|
12
12
|
loadingContext: string;
|
|
13
13
|
}
|
|
14
|
+
export declare type RiskData = string | boolean;
|
|
14
15
|
export default class RiskElement extends BaseElement<RiskModuleProps> {
|
|
15
16
|
static type: string;
|
|
16
17
|
static defaultProps: {
|
|
@@ -27,7 +28,7 @@ export default class RiskElement extends BaseElement<RiskModuleProps> {
|
|
|
27
28
|
onComplete: (result: any) => void;
|
|
28
29
|
onError: (error: any) => void;
|
|
29
30
|
get isValid(): any;
|
|
30
|
-
get data():
|
|
31
|
+
get data(): RiskData;
|
|
31
32
|
cleanUp: () => void;
|
|
32
33
|
componentWillUnmount(): void;
|
|
33
34
|
render(): h.JSX.Element;
|
|
@@ -6,6 +6,7 @@ export declare const defaultTranslation: {
|
|
|
6
6
|
payButton: string;
|
|
7
7
|
"payButton.redirecting": string;
|
|
8
8
|
"payButton.with": string;
|
|
9
|
+
close: string;
|
|
9
10
|
storeDetails: string;
|
|
10
11
|
"creditCard.holderName": string;
|
|
11
12
|
"creditCard.holderName.placeholder": string;
|
|
@@ -54,12 +55,15 @@ export declare const defaultTranslation: {
|
|
|
54
55
|
"companyDetails.registrationNumber": string;
|
|
55
56
|
socialSecurityNumber: string;
|
|
56
57
|
firstName: string;
|
|
58
|
+
"firstName.invalid": string;
|
|
57
59
|
infix: string;
|
|
58
60
|
lastName: string;
|
|
61
|
+
"lastName.invalid": string;
|
|
59
62
|
mobileNumber: string;
|
|
60
63
|
"mobileNumber.invalid": string;
|
|
61
64
|
city: string;
|
|
62
65
|
postalCode: string;
|
|
66
|
+
"postalCode.optional": string;
|
|
63
67
|
countryCode: string;
|
|
64
68
|
telephoneNumber: string;
|
|
65
69
|
dateOfBirth: string;
|
|
@@ -244,31 +248,41 @@ export declare const defaultTranslation: {
|
|
|
244
248
|
"ctp.login.subtitle": string;
|
|
245
249
|
"ctp.login.inputLabel": string;
|
|
246
250
|
"ctp.logout.notYou": string;
|
|
247
|
-
"ctp.logout.
|
|
251
|
+
"ctp.logout.notYourCards": string;
|
|
252
|
+
"ctp.logout.notYourCard": string;
|
|
253
|
+
"ctp.logout.notYourProfile": string;
|
|
248
254
|
"ctp.otp.fieldLabel": string;
|
|
249
255
|
"ctp.otp.resendCode": string;
|
|
250
256
|
"ctp.otp.codeResent": string;
|
|
251
257
|
"ctp.otp.title": string;
|
|
252
258
|
"ctp.otp.subtitle": string;
|
|
253
|
-
"ctp.
|
|
254
|
-
"ctp.emptyCardsView.subtitle": string;
|
|
255
|
-
"ctp.emptyCardsView.button": string;
|
|
259
|
+
"ctp.emptyProfile.message": string;
|
|
256
260
|
"ctp.separatorText": string;
|
|
257
261
|
"ctp.cards.title": string;
|
|
258
262
|
"ctp.cards.subtitle": string;
|
|
259
|
-
"ctp.cards.cardSelector": string;
|
|
260
263
|
"ctp.cards.expiredCard": string;
|
|
261
264
|
"ctp.manualCardEntry": string;
|
|
265
|
+
"ctp.aria.infoModalButton": string;
|
|
266
|
+
"ctp.infoPopup.title": string;
|
|
267
|
+
"ctp.infoPopup.subtitle": string;
|
|
268
|
+
"ctp.infoPopup.benefit1": string;
|
|
269
|
+
"ctp.infoPopup.benefit2": string;
|
|
270
|
+
"ctp.infoPopup.benefit3": string;
|
|
262
271
|
"ctp.errors.AUTH_INVALID": string;
|
|
263
272
|
"ctp.errors.NOT_FOUND": string;
|
|
264
273
|
"ctp.errors.ID_FORMAT_UNSUPPORTED": string;
|
|
265
274
|
"ctp.errors.FRAUD": string;
|
|
266
275
|
"ctp.errors.CONSUMER_ID_MISSING": string;
|
|
267
276
|
"ctp.errors.ACCT_INACCESSIBLE": string;
|
|
268
|
-
"ctp.errors.UNKNOWN_ERROR": string;
|
|
269
277
|
"ctp.errors.CODE_INVALID": string;
|
|
270
278
|
"ctp.errors.CODE_EXPIRED": string;
|
|
271
|
-
"ctp.errors.INVALID_PARAMETER": string;
|
|
272
279
|
"ctp.errors.RETRIES_EXCEEDED": string;
|
|
273
280
|
"ctp.errors.OTP_SEND_FAILED": string;
|
|
281
|
+
"ctp.errors.REQUEST_TIMEOUT": string;
|
|
282
|
+
"ctp.errors.UNKNOWN_ERROR": string;
|
|
283
|
+
"ctp.errors.SERVICE_ERROR": string;
|
|
284
|
+
"ctp.errors.SERVER_ERROR": string;
|
|
285
|
+
"ctp.errors.INVALID_PARAMETER": string;
|
|
286
|
+
"ctp.errors.AUTH_ERROR": string;
|
|
287
|
+
"paymentMethodsList.aria.label": string;
|
|
274
288
|
};
|