@adyen/adyen-web 5.22.0 → 5.24.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 +29 -20
- 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 +29 -20
- package/dist/cjs/adyen.css.map +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/es/adyen.css +29 -20
- package/dist/es/adyen.css.map +1 -1
- package/dist/es/index.js +1 -1
- package/dist/es.modern/adyen.css +29 -20
- package/dist/es.modern/adyen.css.map +1 -1
- package/dist/es.modern/index.js +1 -1
- package/dist/types/components/Ach/Ach.d.ts +41 -3
- package/dist/types/components/Ach/components/AchInput/types.d.ts +8 -4
- package/dist/types/components/Ach/types.d.ts +7 -0
- package/dist/types/components/BcmcMobile/BcmcMobile.d.ts +1 -0
- package/dist/types/components/Card/Bancontact.d.ts +13 -0
- package/dist/types/components/Card/Card.d.ts +29 -1
- package/dist/types/components/Card/ClickToPayHolder.d.ts +6 -0
- package/dist/types/components/Card/ClickToPayWrapper.d.ts +4 -0
- package/dist/types/components/Card/components/CardInput/defaultProps.d.ts +1 -0
- package/dist/types/components/Card/components/CardInput/types.d.ts +1 -0
- package/dist/types/components/Card/components/ClickToPay/ClickToPayComponent.d.ts +6 -0
- package/dist/types/components/Card/components/ClickToPay/components/CtPCards/CtPCards.d.ts +7 -0
- package/dist/types/components/Card/components/ClickToPay/components/CtPCards/CtPCardsList/CtPCardsList.d.ts +8 -0
- package/dist/types/components/Card/components/ClickToPay/components/CtPCards/CtPCardsList/index.d.ts +1 -0
- package/dist/types/components/Card/components/ClickToPay/components/CtPCards/CtPEmptyCardsList/CtPEmptyCardsList.d.ts +6 -0
- package/dist/types/components/Card/components/ClickToPay/components/CtPCards/CtPEmptyCardsList/index.d.ts +1 -0
- package/dist/types/components/Card/components/ClickToPay/components/CtPCards/CtPSingleCard/CtPSingleCard.d.ts +8 -0
- package/dist/types/components/Card/components/ClickToPay/components/CtPCards/CtPSingleCard/index.d.ts +1 -0
- package/dist/types/components/Card/components/ClickToPay/components/CtPCards/index.d.ts +1 -0
- package/dist/types/components/Card/components/ClickToPay/components/CtPLoader/CtPLoader.d.ts +4 -0
- package/dist/types/components/Card/components/ClickToPay/components/CtPLoader/index.d.ts +1 -0
- package/dist/types/components/Card/components/ClickToPay/components/CtPLogin/CtPLogin.d.ts +4 -0
- package/dist/types/components/Card/components/ClickToPay/components/CtPLogin/CtPLoginInput.d.ts +18 -0
- package/dist/types/components/Card/components/ClickToPay/components/CtPLogin/index.d.ts +1 -0
- package/dist/types/components/Card/components/ClickToPay/components/CtPLogin/validate.d.ts +2 -0
- package/dist/types/components/Card/components/ClickToPay/components/CtPOneTimePassword/CtPOneTimePassword.d.ts +4 -0
- package/dist/types/components/Card/components/ClickToPay/components/CtPOneTimePassword/CtPOneTimePasswordInput/CtPOneTimePasswordInput.d.ts +20 -0
- package/dist/types/components/Card/components/ClickToPay/components/CtPOneTimePassword/CtPOneTimePasswordInput/CtPResendOtpLink.d.ts +7 -0
- package/dist/types/components/Card/components/ClickToPay/components/CtPOneTimePassword/CtPOneTimePasswordInput/index.d.ts +1 -0
- package/dist/types/components/Card/components/ClickToPay/components/CtPOneTimePassword/CtPOneTimePasswordInput/validate.d.ts +2 -0
- package/dist/types/components/Card/components/ClickToPay/components/CtPOneTimePassword/index.d.ts +1 -0
- package/dist/types/components/Card/components/ClickToPay/components/CtPSection/CtPLogoutLink.d.ts +4 -0
- package/dist/types/components/Card/components/ClickToPay/components/CtPSection/CtPSection.d.ts +7 -0
- package/dist/types/components/Card/components/ClickToPay/components/CtPSection/index.d.ts +1 -0
- package/dist/types/components/Card/components/ClickToPay/context/ClickToPayContext.d.ts +22 -0
- package/dist/types/components/Card/components/ClickToPay/context/ClickToPayProvider.d.ts +16 -0
- package/dist/types/components/Card/components/ClickToPay/context/useClickToPayContext.d.ts +3 -0
- package/dist/types/components/Card/components/ClickToPay/index.d.ts +1 -0
- package/dist/types/components/Card/components/ClickToPay/models/ShopperCard.d.ts +15 -0
- package/dist/types/components/Card/components/ClickToPay/services/ClickToPayService.d.ts +79 -0
- package/dist/types/components/Card/components/ClickToPay/services/sdks/AbstractSrcInitiator.d.ts +75 -0
- package/dist/types/components/Card/components/ClickToPay/services/sdks/MastercardSdk.d.ts +13 -0
- package/dist/types/components/Card/components/ClickToPay/services/sdks/SrcSdkLoader.d.ts +15 -0
- package/dist/types/components/Card/components/ClickToPay/services/sdks/SrciError.d.ts +16 -0
- package/dist/types/components/Card/components/ClickToPay/services/sdks/VisaSdk.d.ts +13 -0
- package/dist/types/components/Card/components/ClickToPay/services/sdks/config.d.ts +31 -0
- package/dist/types/components/Card/components/ClickToPay/services/sdks/types.d.ts +53 -0
- package/dist/types/components/Card/components/ClickToPay/services/sdks/utils.d.ts +5 -0
- package/dist/types/components/Card/components/ClickToPay/services/types.d.ts +40 -0
- package/dist/types/components/Card/components/ClickToPay/services/utils.d.ts +9 -0
- package/dist/types/components/Card/components/ClickToPay/utils.d.ts +7 -0
- package/dist/types/components/Card/types.d.ts +30 -0
- package/dist/types/components/Dragonpay/Dragonpay.d.ts +1 -0
- package/dist/types/components/Dropin/Dropin.d.ts +1 -0
- package/dist/types/components/Pix/Pix.d.ts +1 -0
- package/dist/types/components/Swish/Swish.d.ts +1 -0
- package/dist/types/components/UIElement.d.ts +1 -0
- package/dist/types/components/WeChat/WeChat.d.ts +1 -0
- package/dist/types/components/index.d.ts +1 -0
- package/dist/types/components/internal/Button/types.d.ts +3 -1
- package/dist/types/components/internal/ContentSeparator/ContentSeparator.d.ts +2 -1
- package/dist/types/components/internal/FormFields/Field/types.d.ts +2 -1
- package/dist/types/components/internal/FormFields/Select/Select.d.ts +1 -1
- package/dist/types/components/internal/FormFields/Select/components/SelectListItem.d.ts +1 -1
- package/dist/types/components/internal/FormFields/Select/types.d.ts +4 -0
- package/dist/types/components/internal/Icon/Icon.d.ts +3 -1
- package/dist/types/components/internal/PayButton/PayButton.d.ts +7 -6
- package/dist/types/components/internal/PayButton/components/SecondaryButtonLabel.d.ts +6 -0
- package/dist/types/components/internal/PayButton/utils.d.ts +7 -0
- package/dist/types/components/internal/SecuredFields/SFP/SecuredFieldsProvider.d.ts +4 -2
- package/dist/types/components/internal/SecuredFields/SFP/SecuredFieldsProviderHandlers.d.ts +2 -2
- package/dist/types/components/internal/SecuredFields/lib/configuration/constants.d.ts +1 -1
- package/dist/types/components/internal/SecuredFields/lib/securedField/AbstractSecuredField.d.ts +3 -1
- package/dist/types/components/types.d.ts +3 -1
- package/dist/types/components/utils.d.ts +2 -2
- package/dist/types/core/types.d.ts +6 -2
- package/dist/types/index.d.ts +1 -1
- package/dist/types/language/config.d.ts +33 -0
- package/dist/types/language/locales/index.d.ts +66 -0
- package/dist/types/types/index.d.ts +8 -0
- package/package.json +1 -1
|
@@ -1,19 +1,57 @@
|
|
|
1
1
|
import { h } from 'preact';
|
|
2
2
|
import UIElement from '../UIElement';
|
|
3
|
-
|
|
3
|
+
import { AchElementProps } from './types';
|
|
4
|
+
export declare class AchElement extends UIElement<AchElementProps> {
|
|
4
5
|
static type: string;
|
|
5
|
-
formatProps(props:
|
|
6
|
+
formatProps(props: AchElementProps): {
|
|
7
|
+
holderNameRequired: boolean;
|
|
8
|
+
storedPaymentMethodId?: string;
|
|
9
|
+
hasHolderName?: boolean;
|
|
10
|
+
enableStoreDetails: boolean;
|
|
11
|
+
session?: import("../../core/CheckoutSession/CheckoutSession").default;
|
|
12
|
+
onChange?: (state: any, element: UIElement<any>) => void;
|
|
13
|
+
onValid?: (state: any, element: UIElement<any>) => void;
|
|
14
|
+
beforeSubmit?: (state: any, element: UIElement<any>, actions: any) => Promise<void>;
|
|
15
|
+
onSubmit?: (state: any, element: UIElement<any>) => void;
|
|
16
|
+
onComplete?: (state: any, element: UIElement<any>) => void;
|
|
17
|
+
onAdditionalDetails?: (state: any, element: UIElement<any>) => void;
|
|
18
|
+
onError?: (error: any, element?: UIElement<any>) => void;
|
|
19
|
+
onPaymentCompleted?: (result: any, element: UIElement<any>) => void;
|
|
20
|
+
beforeRedirect?: (resolve: any, reject: any, redirectData: any, element: UIElement<any>) => void;
|
|
21
|
+
isInstantPayment?: boolean;
|
|
22
|
+
type?: string;
|
|
23
|
+
name?: string;
|
|
24
|
+
icon?: string;
|
|
25
|
+
amount?: import("../../types").PaymentAmount;
|
|
26
|
+
secondaryAmount?: import("../../types").PaymentAmountExtended;
|
|
27
|
+
showPayButton?: boolean;
|
|
28
|
+
setStatusAutomatically?: boolean;
|
|
29
|
+
payButton?: (options: import("../types").PayButtonFunctionProps) => h.JSX.Element;
|
|
30
|
+
loadingContext?: string;
|
|
31
|
+
createFromAction?: (action: import("../../types").PaymentAction, props: object) => UIElement<any>;
|
|
32
|
+
clientKey?: string;
|
|
33
|
+
elementRef?: any;
|
|
34
|
+
i18n?: import("../../language").default;
|
|
35
|
+
_parentInstance?: import("../../core/core").default;
|
|
36
|
+
order?: import("../../types").Order;
|
|
37
|
+
modules?: {
|
|
38
|
+
analytics: import("../../core/Analytics/Analytics").default;
|
|
39
|
+
risk: import("../../core/RiskModule").default;
|
|
40
|
+
};
|
|
41
|
+
isDropin?: boolean;
|
|
42
|
+
};
|
|
6
43
|
/**
|
|
7
44
|
* Formats the component data output
|
|
8
45
|
*/
|
|
9
46
|
formatData(): {
|
|
47
|
+
storePaymentMethod: any;
|
|
10
48
|
billingAddress: any;
|
|
11
49
|
paymentMethod: any;
|
|
12
50
|
};
|
|
13
51
|
updateStyles(stylesObj: any): this;
|
|
14
52
|
setFocusOn(fieldName: any): this;
|
|
15
53
|
get isValid(): boolean;
|
|
16
|
-
get displayName():
|
|
54
|
+
get displayName(): string;
|
|
17
55
|
render(): h.JSX.Element;
|
|
18
56
|
}
|
|
19
57
|
export default AchElement;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import Language from '../../../../language/Language';
|
|
2
2
|
import { StylesObject } from '../../../internal/SecuredFields/lib/types';
|
|
3
|
+
import UIElement from "../../../UIElement";
|
|
3
4
|
export interface ACHInputStateValid {
|
|
4
5
|
holderName?: boolean;
|
|
5
6
|
billingAddress?: boolean;
|
|
@@ -25,25 +26,28 @@ export interface ACHInputProps {
|
|
|
25
26
|
billingAddressAllowedCountries?: string[];
|
|
26
27
|
billingAddressRequired?: boolean;
|
|
27
28
|
billingAddressRequiredFields?: string[];
|
|
28
|
-
clientKey
|
|
29
|
+
clientKey?: string;
|
|
29
30
|
data?: ACHInputDataState;
|
|
31
|
+
enableStoreDetails: boolean;
|
|
30
32
|
hasHolderName?: boolean;
|
|
31
33
|
holderName?: string;
|
|
32
34
|
holderNameRequired?: boolean;
|
|
33
35
|
i18n?: Language;
|
|
34
36
|
keypadFix?: boolean;
|
|
35
37
|
legacyInputMode?: boolean;
|
|
36
|
-
loadingContext
|
|
38
|
+
loadingContext?: string;
|
|
37
39
|
onAllValid?: () => {};
|
|
38
40
|
onBlur?: (e: any) => {};
|
|
39
|
-
onChange?: (obj: any) =>
|
|
41
|
+
onChange?: (obj: any) => void;
|
|
42
|
+
onSubmit?: (obj: any) => void;
|
|
40
43
|
onConfigSuccess?: () => {};
|
|
41
|
-
onError?: () =>
|
|
44
|
+
onError?: (error: any, element?: UIElement<any>) => void;
|
|
42
45
|
onFieldValid?: () => {};
|
|
43
46
|
onFocus?: (e: any) => {};
|
|
44
47
|
onLoad?: () => {};
|
|
45
48
|
payButton?: (obj: any) => {};
|
|
46
49
|
placeholders?: Placeholders;
|
|
50
|
+
ref?: any;
|
|
47
51
|
showPayButton?: boolean;
|
|
48
52
|
showWarnings?: boolean;
|
|
49
53
|
styles?: StylesObject;
|
|
@@ -25,6 +25,7 @@ declare class BCMCMobileElement extends QRLoaderContainer {
|
|
|
25
25
|
name?: string;
|
|
26
26
|
icon?: string;
|
|
27
27
|
amount?: import("../../types").PaymentAmount;
|
|
28
|
+
secondaryAmount?: import("../../types").PaymentAmountExtended;
|
|
28
29
|
showPayButton?: boolean;
|
|
29
30
|
setStatusAutomatically?: boolean;
|
|
30
31
|
payButton?: (options: import("../types").PayButtonFunctionProps) => import("preact").JSX.Element;
|
|
@@ -6,6 +6,7 @@ declare class BancontactElement extends CardElement {
|
|
|
6
6
|
brands: string[];
|
|
7
7
|
onBinLookup: () => void;
|
|
8
8
|
showBrandsUnderCardNumber: boolean;
|
|
9
|
+
useClickToPay: boolean;
|
|
9
10
|
SRConfig: {};
|
|
10
11
|
};
|
|
11
12
|
/**
|
|
@@ -23,6 +24,10 @@ declare class BancontactElement extends CardElement {
|
|
|
23
24
|
countryCode: any;
|
|
24
25
|
configuration: {
|
|
25
26
|
socialSecurityNumberMode: import("./types").SocialSecurityMode;
|
|
27
|
+
visaSrciDpaId?: string;
|
|
28
|
+
visaSrcInitiatorId?: string;
|
|
29
|
+
mcSrcClientId?: string;
|
|
30
|
+
mcDpaId?: string;
|
|
26
31
|
merchantIdentifier?: string;
|
|
27
32
|
merchantOrigin?: string;
|
|
28
33
|
gatewayMerchantId?: string;
|
|
@@ -43,7 +48,14 @@ declare class BancontactElement extends CardElement {
|
|
|
43
48
|
showPanel: any;
|
|
44
49
|
};
|
|
45
50
|
installmentOptions: any;
|
|
51
|
+
clickToPayConfiguration: {
|
|
52
|
+
shopperIdentityValue: any;
|
|
53
|
+
locale: string;
|
|
54
|
+
shopperIdentityType?: "email" | "mobilePhone";
|
|
55
|
+
merchantDisplayName: string;
|
|
56
|
+
};
|
|
46
57
|
brand?: string;
|
|
58
|
+
useClickToPay: boolean;
|
|
47
59
|
brands?: string[];
|
|
48
60
|
showBrandsUnderCardNumber?: boolean;
|
|
49
61
|
showBrandIcon?: boolean;
|
|
@@ -70,6 +82,7 @@ declare class BancontactElement extends CardElement {
|
|
|
70
82
|
isInstantPayment?: boolean;
|
|
71
83
|
name?: string;
|
|
72
84
|
amount?: import("../../types").PaymentAmount;
|
|
85
|
+
secondaryAmount?: import("../../types").PaymentAmountExtended;
|
|
73
86
|
showPayButton?: boolean;
|
|
74
87
|
setStatusAutomatically?: boolean;
|
|
75
88
|
payButton?: (options: import("../types").PayButtonFunctionProps) => import("preact").JSX.Element;
|
|
@@ -1,15 +1,25 @@
|
|
|
1
1
|
import { h } from 'preact';
|
|
2
2
|
import { UIElement } from '../UIElement';
|
|
3
|
-
import { CardElementData, CardElementProps
|
|
3
|
+
import { BinLookupResponse, CardElementData, CardElementProps } from './types';
|
|
4
4
|
import { CbObjOnBinLookup } from '../internal/SecuredFields/lib/types';
|
|
5
|
+
import { UIElementStatus } from '../types';
|
|
5
6
|
export declare class CardElement extends UIElement<CardElementProps> {
|
|
6
7
|
static type: string;
|
|
8
|
+
private readonly clickToPayService;
|
|
9
|
+
/**
|
|
10
|
+
* Reference to the 'ClickToPayComponent'
|
|
11
|
+
*/
|
|
12
|
+
private clickToPayRef;
|
|
13
|
+
constructor(props: any);
|
|
7
14
|
protected static defaultProps: {
|
|
8
15
|
onBinLookup: () => void;
|
|
9
16
|
showBrandsUnderCardNumber: boolean;
|
|
17
|
+
useClickToPay: boolean;
|
|
10
18
|
SRConfig: {};
|
|
11
19
|
};
|
|
20
|
+
setStatus(status: UIElementStatus, props?: any): this;
|
|
12
21
|
setComponentRef: (ref: any) => void;
|
|
22
|
+
private setClickToPayRef;
|
|
13
23
|
formatProps(props: CardElementProps): {
|
|
14
24
|
holderNameRequired: boolean;
|
|
15
25
|
hasCVC: boolean;
|
|
@@ -18,6 +28,10 @@ export declare class CardElement extends UIElement<CardElementProps> {
|
|
|
18
28
|
countryCode: any;
|
|
19
29
|
configuration: {
|
|
20
30
|
socialSecurityNumberMode: import("./types").SocialSecurityMode;
|
|
31
|
+
visaSrciDpaId?: string;
|
|
32
|
+
visaSrcInitiatorId?: string;
|
|
33
|
+
mcSrcClientId?: string;
|
|
34
|
+
mcDpaId?: string;
|
|
21
35
|
merchantIdentifier?: string;
|
|
22
36
|
merchantOrigin?: string;
|
|
23
37
|
gatewayMerchantId?: string;
|
|
@@ -38,7 +52,18 @@ export declare class CardElement extends UIElement<CardElementProps> {
|
|
|
38
52
|
showPanel: any;
|
|
39
53
|
};
|
|
40
54
|
installmentOptions: any;
|
|
55
|
+
/**
|
|
56
|
+
* Click to Pay configuration
|
|
57
|
+
* - If email is set explicitly in the configuration, then it can override the one used in the session creation
|
|
58
|
+
*/
|
|
59
|
+
clickToPayConfiguration: {
|
|
60
|
+
shopperIdentityValue: any;
|
|
61
|
+
locale: string;
|
|
62
|
+
shopperIdentityType?: "email" | "mobilePhone";
|
|
63
|
+
merchantDisplayName: string;
|
|
64
|
+
};
|
|
41
65
|
brand?: string;
|
|
66
|
+
useClickToPay: boolean;
|
|
42
67
|
brands?: string[];
|
|
43
68
|
showBrandsUnderCardNumber?: boolean;
|
|
44
69
|
showBrandIcon?: boolean;
|
|
@@ -65,6 +90,7 @@ export declare class CardElement extends UIElement<CardElementProps> {
|
|
|
65
90
|
isInstantPayment?: boolean;
|
|
66
91
|
name?: string;
|
|
67
92
|
amount?: import("../../types").PaymentAmount;
|
|
93
|
+
secondaryAmount?: import("../../types").PaymentAmountExtended;
|
|
68
94
|
showPayButton?: boolean;
|
|
69
95
|
setStatusAutomatically?: boolean;
|
|
70
96
|
payButton?: (options: import("../types").PayButtonFunctionProps) => h.JSX.Element;
|
|
@@ -90,6 +116,7 @@ export declare class CardElement extends UIElement<CardElementProps> {
|
|
|
90
116
|
onBrand: (event: any) => void;
|
|
91
117
|
processBinLookupResponse(binLookupResponse: BinLookupResponse, isReset?: boolean): this;
|
|
92
118
|
handleUnsupportedCard(errObj: any): this;
|
|
119
|
+
private handleClickToPaySubmit;
|
|
93
120
|
onBinLookup(obj: CbObjOnBinLookup): void;
|
|
94
121
|
onBinValue: (callbackObj: import("../internal/SecuredFields/lib/types").CbObjOnBinValue) => void;
|
|
95
122
|
get isValid(): boolean;
|
|
@@ -102,6 +129,7 @@ export declare class CardElement extends UIElement<CardElementProps> {
|
|
|
102
129
|
get displayName(): string;
|
|
103
130
|
get accessibleName(): string;
|
|
104
131
|
get browserInfo(): import("../../types").BrowserInfo;
|
|
132
|
+
private renderCardInput;
|
|
105
133
|
render(): h.JSX.Element;
|
|
106
134
|
}
|
|
107
135
|
export default CardElement;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ClickToPayProviderProps } from './components/ClickToPay/context/ClickToPayProvider';
|
|
2
|
+
import { h } from 'preact';
|
|
3
|
+
declare const ClickToPayWrapper: ({ amount, clickToPayService, setClickToPayRef, onSetStatus, onSubmit, onError, ...props }: ClickToPayProviderProps) => h.JSX.Element;
|
|
4
|
+
export default ClickToPayWrapper;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { h } from 'preact';
|
|
2
|
+
import ShopperCard from '../../../models/ShopperCard';
|
|
3
|
+
declare type CtPCardsListProps = {
|
|
4
|
+
cards: ShopperCard[];
|
|
5
|
+
onChangeCard(card: ShopperCard): void;
|
|
6
|
+
};
|
|
7
|
+
declare const CtPCardsList: ({ cards, onChangeCard }: CtPCardsListProps) => h.JSX.Element;
|
|
8
|
+
export default CtPCardsList;
|
package/dist/types/components/Card/components/ClickToPay/components/CtPCards/CtPCardsList/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './CtPCardsList';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './CtPEmptyCardsList';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { h } from 'preact';
|
|
2
|
+
import ShopperCard from '../../../models/ShopperCard';
|
|
3
|
+
import './CtPSingleCard.scss';
|
|
4
|
+
declare type CtPSingleCardProps = {
|
|
5
|
+
card: ShopperCard;
|
|
6
|
+
};
|
|
7
|
+
declare const CtPSingleCard: ({ card }: CtPSingleCardProps) => h.JSX.Element;
|
|
8
|
+
export default CtPSingleCard;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './CtPSingleCard';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './CtPCards';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './CtPLoader';
|
package/dist/types/components/Card/components/ClickToPay/components/CtPLogin/CtPLoginInput.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
interface CtPLoginInputProps {
|
|
2
|
+
disabled: boolean;
|
|
3
|
+
errorMessage?: string;
|
|
4
|
+
onPressEnter(): void;
|
|
5
|
+
onChange({ data: CtPLoginInputDataState, valid, errors, isValid: boolean }: {
|
|
6
|
+
data: any;
|
|
7
|
+
valid: any;
|
|
8
|
+
errors: any;
|
|
9
|
+
isValid: any;
|
|
10
|
+
}): void;
|
|
11
|
+
}
|
|
12
|
+
export declare type CtPLoginInputHandlers = {
|
|
13
|
+
validateInput(): void;
|
|
14
|
+
};
|
|
15
|
+
declare const CtPLoginInput: import("preact").FunctionalComponent<Omit<CtPLoginInputProps, "ref"> & {
|
|
16
|
+
ref?: import("preact").Ref<CtPLoginInputHandlers>;
|
|
17
|
+
}>;
|
|
18
|
+
export default CtPLoginInput;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './CtPLogin';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import './CtPOneTimePasswordInput.scss';
|
|
2
|
+
interface CtPOneTimePasswordInputProps {
|
|
3
|
+
disabled: boolean;
|
|
4
|
+
isValidatingOtp: boolean;
|
|
5
|
+
errorMessage?: string;
|
|
6
|
+
onPressEnter(): Promise<void>;
|
|
7
|
+
onChange({ data: CtPOneTimePasswordInputDataState, valid, errors, isValid: boolean }: {
|
|
8
|
+
data: any;
|
|
9
|
+
valid: any;
|
|
10
|
+
errors: any;
|
|
11
|
+
isValid: any;
|
|
12
|
+
}): void;
|
|
13
|
+
}
|
|
14
|
+
export declare type CtPOneTimePasswordInputHandlers = {
|
|
15
|
+
validateInput(): void;
|
|
16
|
+
};
|
|
17
|
+
declare const CtPOneTimePasswordInput: import("preact").FunctionalComponent<Omit<CtPOneTimePasswordInputProps, "ref"> & {
|
|
18
|
+
ref?: import("preact").Ref<CtPOneTimePasswordInputHandlers>;
|
|
19
|
+
}>;
|
|
20
|
+
export default CtPOneTimePasswordInput;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './CtPOneTimePasswordInput';
|
package/dist/types/components/Card/components/ClickToPay/components/CtPOneTimePassword/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './CtPOneTimePassword';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './CtPSection';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { CtpState } from '../services/ClickToPayService';
|
|
2
|
+
import { ClickToPayCheckoutPayload, IClickToPayService } from '../services/types';
|
|
3
|
+
import { PaymentAmount } from '../../../../../types';
|
|
4
|
+
import ShopperCard from '../models/ShopperCard';
|
|
5
|
+
import { UIElementStatus } from '../../../../types';
|
|
6
|
+
import AdyenCheckoutError from '../../../../../core/Errors/AdyenCheckoutError';
|
|
7
|
+
export interface ClickToPayContextInterface extends Pick<IClickToPayService, 'checkout' | 'startIdentityValidation' | 'finishIdentityValidation' | 'verifyIfShopperIsEnrolled'> {
|
|
8
|
+
isCtpPrimaryPaymentMethod: boolean;
|
|
9
|
+
setIsCtpPrimaryPaymentMethod(isPrimary: boolean): void;
|
|
10
|
+
logoutShopper(): void;
|
|
11
|
+
ctpState: CtpState;
|
|
12
|
+
cards: ShopperCard[];
|
|
13
|
+
schemes: string[];
|
|
14
|
+
otpMaskedContact: string;
|
|
15
|
+
amount: PaymentAmount;
|
|
16
|
+
status: UIElementStatus;
|
|
17
|
+
onSubmit(payload: ClickToPayCheckoutPayload): void;
|
|
18
|
+
onSetStatus(status: UIElementStatus): void;
|
|
19
|
+
onError(error: AdyenCheckoutError): void;
|
|
20
|
+
}
|
|
21
|
+
declare const ClickToPayContext: import("preact").Context<ClickToPayContextInterface>;
|
|
22
|
+
export { ClickToPayContext };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { h } from 'preact';
|
|
2
|
+
import { ClickToPayCheckoutPayload, IClickToPayService } from '../services/types';
|
|
3
|
+
import { PaymentAmount } from '../../../../../types';
|
|
4
|
+
import { UIElementStatus } from '../../../../types';
|
|
5
|
+
import AdyenCheckoutError from '../../../../../core/Errors/AdyenCheckoutError';
|
|
6
|
+
export declare type ClickToPayProviderProps = {
|
|
7
|
+
clickToPayService: IClickToPayService | null;
|
|
8
|
+
amount: PaymentAmount;
|
|
9
|
+
children: any;
|
|
10
|
+
setClickToPayRef(ref: any): void;
|
|
11
|
+
onSubmit(payload: ClickToPayCheckoutPayload): void;
|
|
12
|
+
onSetStatus(status: UIElementStatus): void;
|
|
13
|
+
onError(error: AdyenCheckoutError): void;
|
|
14
|
+
};
|
|
15
|
+
declare const ClickToPayProvider: ({ clickToPayService, amount, children, setClickToPayRef, onSubmit, onSetStatus, onError }: ClickToPayProviderProps) => h.JSX.Element;
|
|
16
|
+
export default ClickToPayProvider;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './ClickToPayComponent';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { SrcCard } from '../services/sdks/types';
|
|
2
|
+
import { ClickToPayScheme } from '../../../types';
|
|
3
|
+
declare class ShopperCard {
|
|
4
|
+
dateOfCardLastUsed: string;
|
|
5
|
+
panLastFour: string;
|
|
6
|
+
srcDigitalCardId: string;
|
|
7
|
+
scheme: ClickToPayScheme;
|
|
8
|
+
artUri: string;
|
|
9
|
+
srcCorrelationId: string;
|
|
10
|
+
tokenId?: string;
|
|
11
|
+
private descriptorName?;
|
|
12
|
+
constructor(maskedCard: SrcCard, scheme: ClickToPayScheme, srcCorrelationId: string);
|
|
13
|
+
get title(): string;
|
|
14
|
+
}
|
|
15
|
+
export default ShopperCard;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { CallbackStateSubscriber, IClickToPayService, IdentityLookupParams, ClickToPayCheckoutPayload } from './types';
|
|
2
|
+
import { ISrcSdkLoader } from './sdks/SrcSdkLoader';
|
|
3
|
+
import { SrcInitParams } from './sdks/types';
|
|
4
|
+
import { ClickToPayScheme } from '../../../types';
|
|
5
|
+
import ShopperCard from '../models/ShopperCard';
|
|
6
|
+
export declare enum CtpState {
|
|
7
|
+
Idle = "Idle",
|
|
8
|
+
Loading = "Loading",
|
|
9
|
+
ShopperIdentified = "ShopperIdentified",
|
|
10
|
+
OneTimePassword = "OneTimePassword",
|
|
11
|
+
Ready = "Ready",
|
|
12
|
+
Login = "Login",
|
|
13
|
+
NotAvailable = "NotAvailable"
|
|
14
|
+
}
|
|
15
|
+
declare class ClickToPayService implements IClickToPayService {
|
|
16
|
+
private readonly sdkLoader;
|
|
17
|
+
private readonly schemesConfig;
|
|
18
|
+
private readonly shopperIdentity?;
|
|
19
|
+
private readonly environment;
|
|
20
|
+
/**
|
|
21
|
+
* Mandatory unique ID passed to all the networks (Click to Pay systems), used to track user journey
|
|
22
|
+
*/
|
|
23
|
+
private readonly srciTransactionId;
|
|
24
|
+
private sdks;
|
|
25
|
+
private validationSchemeSdk;
|
|
26
|
+
private stateSubscriber;
|
|
27
|
+
state: CtpState;
|
|
28
|
+
shopperCards: ShopperCard[];
|
|
29
|
+
shopperValidationContact: string;
|
|
30
|
+
constructor(schemesConfig: Record<ClickToPayScheme, SrcInitParams>, sdkLoader: ISrcSdkLoader, environment: string, shopperIdentity?: IdentityLookupParams);
|
|
31
|
+
get schemes(): string[];
|
|
32
|
+
initialize(): Promise<void>;
|
|
33
|
+
/**
|
|
34
|
+
* Set the callback for notifying when the CtPState changes
|
|
35
|
+
*/
|
|
36
|
+
subscribeOnStateChange(callback: CallbackStateSubscriber): void;
|
|
37
|
+
/**
|
|
38
|
+
* Initiates Consumer Identity validation with one Click to Pay System.
|
|
39
|
+
* The Click to Pay System sends a one-time-password (OTP) to the registered email address or mobile number.
|
|
40
|
+
**/
|
|
41
|
+
startIdentityValidation(): Promise<void>;
|
|
42
|
+
/**
|
|
43
|
+
* Completes the validation of the Shopper by evaluating the supplied OTP.
|
|
44
|
+
*/
|
|
45
|
+
finishIdentityValidation(otpCode: string): Promise<void>;
|
|
46
|
+
/**
|
|
47
|
+
* This method performs checkout using the selected card
|
|
48
|
+
*/
|
|
49
|
+
checkout(card: ShopperCard): Promise<ClickToPayCheckoutPayload>;
|
|
50
|
+
/**
|
|
51
|
+
* Call the 'unbindAppInstance()' method of each SRC SDK in order to remove the shopper cookies.
|
|
52
|
+
* Besides, it deletes all information stored about the shopper.
|
|
53
|
+
*/
|
|
54
|
+
logout(): Promise<void>;
|
|
55
|
+
/**
|
|
56
|
+
* Call the 'identityLookup()' method of each SRC SDK in order to verify if the shopper has an account.
|
|
57
|
+
*
|
|
58
|
+
* Based on the responses from the Click to Pay Systems, we should do the validation process using the SDK that
|
|
59
|
+
* that responds faster with 'consumerPresent=true'
|
|
60
|
+
*/
|
|
61
|
+
verifyIfShopperIsEnrolled(value: string, type?: 'email' | 'mobilePhone'): Promise<{
|
|
62
|
+
isEnrolled: boolean;
|
|
63
|
+
}>;
|
|
64
|
+
private setState;
|
|
65
|
+
private setSdkForPerformingShopperIdentityValidation;
|
|
66
|
+
/**
|
|
67
|
+
* Based on the given idToken, this method goes through each SRCi SDK and fetches the shopper
|
|
68
|
+
* profile with his cards
|
|
69
|
+
*/
|
|
70
|
+
private getShopperProfile;
|
|
71
|
+
/**
|
|
72
|
+
* Calls the 'isRecognized()' method of each SRC SDK in order to verify if the shopper is
|
|
73
|
+
* recognized on the device. The shopper is recognized if he/she has the Cookies stored
|
|
74
|
+
* on their browser
|
|
75
|
+
*/
|
|
76
|
+
private verifyIfShopperIsRecognized;
|
|
77
|
+
private initiateSdks;
|
|
78
|
+
}
|
|
79
|
+
export default ClickToPayService;
|