@adyen/adyen-web 5.43.1 → 5.45.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/README.md +1 -1
- package/dist/adyen.css +2 -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 +2 -0
- package/dist/cjs/adyen.css.map +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/es/adyen.css +2 -0
- package/dist/es/adyen.css.map +1 -1
- package/dist/es/index.js +1 -1
- package/dist/es.modern/adyen.css +2 -0
- package/dist/es.modern/adyen.css.map +1 -1
- package/dist/es.modern/index.js +1 -1
- package/dist/types/components/ApplePay/utils.d.ts +1 -1
- package/dist/types/components/Card/components/CardInput/components/CardFieldsWrapper.d.ts +2 -1
- package/dist/types/components/Card/components/CardInput/types.d.ts +2 -0
- package/dist/types/components/Card/types.d.ts +11 -0
- package/dist/types/components/CashAppPay/CashAppPay.d.ts +80 -0
- package/dist/types/components/CashAppPay/components/CashAppComponent.d.ts +16 -0
- package/dist/types/components/CashAppPay/defaultProps.d.ts +7 -0
- package/dist/types/components/CashAppPay/index.d.ts +1 -0
- package/dist/types/components/CashAppPay/services/CashAppSdkLoader.d.ts +9 -0
- package/dist/types/components/CashAppPay/services/CashAppService.d.ts +21 -0
- package/dist/types/components/CashAppPay/services/config.d.ts +3 -0
- package/dist/types/components/CashAppPay/services/types.d.ts +49 -0
- package/dist/types/components/CashAppPay/types.d.ts +70 -0
- package/dist/types/components/Dropin/components/PaymentMethod/OrderPaymentMethods.d.ts +2 -1
- package/dist/types/components/Dropin/components/PaymentMethod/useBrandLogoConfiguration.d.ts +6 -0
- package/dist/types/components/Dropin/types.d.ts +5 -0
- package/dist/types/components/Giftcard/components/GiftcardPinField.d.ts +1 -1
- package/dist/types/components/Giftcard/components/types.d.ts +2 -0
- package/dist/types/components/Klarna/types.d.ts +2 -0
- package/dist/types/components/index.d.ts +2 -0
- package/dist/types/components/internal/Address/components/AddressSearch.d.ts +16 -0
- package/dist/types/components/internal/Address/types.d.ts +6 -0
- package/dist/types/components/internal/Address/utils.d.ts +2 -0
- package/dist/types/components/internal/Countdown/CountdownA11yReporter.d.ts +25 -0
- package/dist/types/components/internal/Countdown/index.d.ts +3 -29
- package/dist/types/components/internal/Countdown/types.d.ts +9 -0
- package/dist/types/components/internal/Countdown/useCountdownA11yReporter.d.ts +2 -0
- package/dist/types/components/internal/FormFields/Select/Select.d.ts +1 -1
- package/dist/types/components/internal/FormFields/Select/types.d.ts +3 -0
- package/dist/types/components/internal/IbanInput/specifications.d.ts +426 -0
- package/dist/types/components/internal/IbanInput/utils.d.ts +45 -0
- package/dist/types/components/internal/RedirectButton/RedirectButton.d.ts +3 -1
- package/dist/types/components/internal/SecuredFields/lib/utilities/commonUtils.d.ts +45 -0
- package/dist/types/components/internal/SecuredFields/lib/utilities/dom.d.ts +7 -0
- package/dist/types/components/internal/SecuredFields/lib/utilities/logger.d.ts +23 -1
- package/dist/types/components/internal/SecuredFields/utils.d.ts +15 -0
- package/dist/types/components/types.d.ts +14 -0
- package/dist/types/core/Errors/SRPanel.d.ts +3 -7
- package/dist/types/core/Errors/types.d.ts +6 -0
- package/dist/types/core/core.d.ts +37 -0
- package/dist/types/core/types.d.ts +8 -0
- package/dist/types/language/config.d.ts +4 -0
- package/dist/types/language/locales/index.d.ts +8 -0
- package/dist/types/language/utils.d.ts +12 -1
- package/dist/types/types/index.d.ts +1 -0
- package/dist/types/utils/amount-util.d.ts +28 -1
- package/dist/types/utils/base64.d.ts +8 -0
- package/package.json +2 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function resolveSupportedVersion(latestVersion:
|
|
1
|
+
export declare function resolveSupportedVersion(latestVersion: number): number | null;
|
|
2
2
|
export declare function mapBrands(brands: any): any;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { h } from 'preact';
|
|
2
|
-
export declare const CardFieldsWrapper: ({ data, valid, errors, handleChangeFor, sfpState, setFocusOn, cvcPolicy, focusedElement, hasInstallments, handleInstallments, showAmountsInInstallments, brandsIcons, formData, formErrors, formValid, expiryDatePolicy, dualBrandSelectElements, extensions, selectedBrandValue, showKCP, showBrazilianSSN, socialSecurityNumber, handleOnStoreDetails, billingAddress, handleAddress, setAddressRef, partialAddressSchema, amount, billingAddressRequired, billingAddressRequiredFields, billingAddressAllowedCountries, billingAddressValidationRules, brandsConfiguration, enableStoreDetails, hasCVC, hasHolderName, holderNameRequired, installmentOptions, placeholders, positionHolderNameOnTop, showBrandIcon, showBrandsUnderCardNumber, iOSFocusedField, disclaimerMessage }: {
|
|
2
|
+
export declare const CardFieldsWrapper: ({ data, valid, errors, handleChangeFor, sfpState, setFocusOn, cvcPolicy, focusedElement, hasInstallments, handleInstallments, showAmountsInInstallments, brandsIcons, formData, formErrors, formValid, expiryDatePolicy, dualBrandSelectElements, extensions, selectedBrandValue, showKCP, showBrazilianSSN, socialSecurityNumber, handleOnStoreDetails, billingAddress, handleAddress, setAddressRef, partialAddressSchema, onAddressLookup, amount, billingAddressRequired, billingAddressRequiredFields, billingAddressAllowedCountries, billingAddressValidationRules, brandsConfiguration, enableStoreDetails, hasCVC, hasHolderName, holderNameRequired, installmentOptions, placeholders, positionHolderNameOnTop, showBrandIcon, showBrandsUnderCardNumber, iOSFocusedField, disclaimerMessage }: {
|
|
3
3
|
data: any;
|
|
4
4
|
valid: any;
|
|
5
5
|
errors: any;
|
|
@@ -27,6 +27,7 @@ export declare const CardFieldsWrapper: ({ data, valid, errors, handleChangeFor,
|
|
|
27
27
|
handleAddress: any;
|
|
28
28
|
setAddressRef: any;
|
|
29
29
|
partialAddressSchema: any;
|
|
30
|
+
onAddressLookup: any;
|
|
30
31
|
amount: any;
|
|
31
32
|
billingAddressRequired: any;
|
|
32
33
|
billingAddressRequiredFields: any;
|
|
@@ -13,6 +13,7 @@ import Analytics from '../../../../core/Analytics';
|
|
|
13
13
|
import RiskElement from '../../../../core/RiskModule';
|
|
14
14
|
import { ComponentMethodsRef } from '../../../types';
|
|
15
15
|
import { DisclaimerMsgObject } from '../../../internal/DisclaimerMessage/DisclaimerMessage';
|
|
16
|
+
import { OnAddressLookupType } from '../../../internal/Address/components/AddressSearch';
|
|
16
17
|
export interface CardInputValidState {
|
|
17
18
|
holderName?: boolean;
|
|
18
19
|
billingAddress?: boolean;
|
|
@@ -101,6 +102,7 @@ export interface CardInputProps {
|
|
|
101
102
|
onFieldValid?: () => {};
|
|
102
103
|
onFocus?: (e: any) => {};
|
|
103
104
|
onLoad?: () => {};
|
|
105
|
+
onAddressLookup?: OnAddressLookupType;
|
|
104
106
|
payButton?: (obj: any) => {};
|
|
105
107
|
placeholders?: Placeholders;
|
|
106
108
|
positionHolderNameOnTop?: boolean;
|
|
@@ -17,6 +17,17 @@ export interface CardElementProps extends UIElementProps {
|
|
|
17
17
|
* Configuration for Click to Pay
|
|
18
18
|
*/
|
|
19
19
|
clickToPayConfiguration?: ClickToPayConfiguration;
|
|
20
|
+
/**
|
|
21
|
+
* Disable Click to Pay for testing purposes
|
|
22
|
+
* @defaultValue false
|
|
23
|
+
* @internal
|
|
24
|
+
*/
|
|
25
|
+
_disableClickToPay?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Funding source field populated when 'splitCardFundingSources' is used
|
|
28
|
+
* @internal
|
|
29
|
+
*/
|
|
30
|
+
fundingSource?: 'debit' | 'credit';
|
|
20
31
|
/**
|
|
21
32
|
* type will always be "card" (generic card, stored card)
|
|
22
33
|
* except for a single branded card when it will be the same as the brand prop
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { h } from 'preact';
|
|
2
|
+
import UIElement from '../UIElement';
|
|
3
|
+
import { CashAppPayElementData, CashAppPayElementProps } from './types';
|
|
4
|
+
export declare class CashAppPay extends UIElement<CashAppPayElementProps> {
|
|
5
|
+
static type: string;
|
|
6
|
+
private readonly cashAppService;
|
|
7
|
+
protected static defaultProps: {
|
|
8
|
+
onClick: (actions: any) => void;
|
|
9
|
+
showPayButton: boolean;
|
|
10
|
+
enableStoreDetails: boolean;
|
|
11
|
+
storePaymentMethod: boolean;
|
|
12
|
+
};
|
|
13
|
+
constructor(props: any);
|
|
14
|
+
formatProps(props: CashAppPayElementProps): {
|
|
15
|
+
enableStoreDetails: boolean;
|
|
16
|
+
storePaymentMethod?: boolean;
|
|
17
|
+
onClick?(actions: {
|
|
18
|
+
resolve: () => void;
|
|
19
|
+
reject: () => void;
|
|
20
|
+
}): void;
|
|
21
|
+
referenceId?: string;
|
|
22
|
+
redirectURL?: string;
|
|
23
|
+
button?: {
|
|
24
|
+
shape?: "round" | "semiround";
|
|
25
|
+
size?: "small" | "medium";
|
|
26
|
+
theme?: "dark" | "light";
|
|
27
|
+
width?: "full" | "static";
|
|
28
|
+
};
|
|
29
|
+
configuration?: {
|
|
30
|
+
clientId: string;
|
|
31
|
+
scopeId: string;
|
|
32
|
+
};
|
|
33
|
+
storedPaymentMethodId?: string;
|
|
34
|
+
cashtag?: string;
|
|
35
|
+
environment?: string;
|
|
36
|
+
session?: import("../../core/CheckoutSession/CheckoutSession").default;
|
|
37
|
+
onChange?: (state: any, element: UIElement<any>) => void;
|
|
38
|
+
onValid?: (state: any, element: UIElement<any>) => void;
|
|
39
|
+
beforeSubmit?: (state: any, element: UIElement<any>, actions: any) => Promise<void>;
|
|
40
|
+
onSubmit?: (state: any, element: UIElement<any>) => void;
|
|
41
|
+
onComplete?: (state: any, element: UIElement<any>) => void;
|
|
42
|
+
onActionHandled?: (rtnObj: import("../types").ActionHandledReturnObject) => void;
|
|
43
|
+
onAdditionalDetails?: (state: any, element: UIElement<any>) => void;
|
|
44
|
+
onError?: (error: any, element?: UIElement<any>) => void;
|
|
45
|
+
onPaymentCompleted?: (result: any, element: UIElement<any>) => void;
|
|
46
|
+
beforeRedirect?: (resolve: any, reject: any, redirectData: any, element: UIElement<any>) => void;
|
|
47
|
+
isInstantPayment?: boolean;
|
|
48
|
+
type?: string;
|
|
49
|
+
name?: string;
|
|
50
|
+
icon?: string;
|
|
51
|
+
amount?: import("../../types").PaymentAmount;
|
|
52
|
+
secondaryAmount?: import("../../types").PaymentAmountExtended;
|
|
53
|
+
showPayButton?: boolean;
|
|
54
|
+
setStatusAutomatically?: boolean;
|
|
55
|
+
payButton?: (options: import("../types").PayButtonFunctionProps) => h.JSX.Element;
|
|
56
|
+
loadingContext?: string;
|
|
57
|
+
createFromAction?: (action: import("../../types").PaymentAction, props: object) => UIElement<any>;
|
|
58
|
+
clientKey?: string;
|
|
59
|
+
elementRef?: any;
|
|
60
|
+
i18n?: import("../../language").default;
|
|
61
|
+
_parentInstance?: import("../../core/core").default;
|
|
62
|
+
order?: import("../../types").Order;
|
|
63
|
+
modules?: {
|
|
64
|
+
srPanel?: import("../../core/Errors/SRPanel").SRPanel;
|
|
65
|
+
analytics?: import("../../core/Analytics/Analytics").default;
|
|
66
|
+
resources?: import("../../core/Context/Resources").Resources;
|
|
67
|
+
risk?: import("../../core/RiskModule").default;
|
|
68
|
+
};
|
|
69
|
+
isDropin?: boolean;
|
|
70
|
+
};
|
|
71
|
+
formatData(): CashAppPayElementData;
|
|
72
|
+
get displayName(): string;
|
|
73
|
+
get additionalInfo(): "" | "Cash App Pay";
|
|
74
|
+
submit: () => void;
|
|
75
|
+
get isValid(): boolean;
|
|
76
|
+
private handleOnChangeStoreDetails;
|
|
77
|
+
private handleAuthorize;
|
|
78
|
+
render(): h.JSX.Element;
|
|
79
|
+
}
|
|
80
|
+
export default CashAppPay;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { h, RefObject } from 'preact';
|
|
2
|
+
import AdyenCheckoutError from '../../../core/Errors/AdyenCheckoutError';
|
|
3
|
+
import { ICashAppService } from '../services/types';
|
|
4
|
+
import { CashAppPayEventData } from '../types';
|
|
5
|
+
import './CashAppComponent.scss';
|
|
6
|
+
interface CashAppComponentProps {
|
|
7
|
+
enableStoreDetails?: boolean;
|
|
8
|
+
cashAppService: ICashAppService;
|
|
9
|
+
onClick(): void;
|
|
10
|
+
onChangeStoreDetails(data: any): void;
|
|
11
|
+
onAuthorize(payEventData: CashAppPayEventData): void;
|
|
12
|
+
onError(error: AdyenCheckoutError): void;
|
|
13
|
+
ref(ref: RefObject<typeof CashAppComponent>): void;
|
|
14
|
+
}
|
|
15
|
+
export declare function CashAppComponent({ enableStoreDetails, cashAppService, onClick, onChangeStoreDetails, onAuthorize, onError }: CashAppComponentProps): h.JSX.Element;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './CashAppPay';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ICashAppWindowObject } from './types';
|
|
2
|
+
export interface ICashAppSdkLoader {
|
|
3
|
+
load(environment: string): Promise<ICashAppWindowObject>;
|
|
4
|
+
}
|
|
5
|
+
declare class CashAppSdkLoader implements ICashAppSdkLoader {
|
|
6
|
+
private isSdkIsAvailableOnWindow;
|
|
7
|
+
load(environment: string): Promise<ICashAppWindowObject>;
|
|
8
|
+
}
|
|
9
|
+
export { CashAppSdkLoader };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ICashAppSdkLoader } from './CashAppSdkLoader';
|
|
2
|
+
import { CashAppPayEvents, CashAppServiceConfig, ICashAppService } from './types';
|
|
3
|
+
export default class CashAppService implements ICashAppService {
|
|
4
|
+
private readonly sdkLoader;
|
|
5
|
+
private readonly configuration;
|
|
6
|
+
private pay;
|
|
7
|
+
/**
|
|
8
|
+
* Reference to CashApp 'begin' method
|
|
9
|
+
*/
|
|
10
|
+
private startAuthorization?;
|
|
11
|
+
constructor(sdkLoader: ICashAppSdkLoader, configuration: CashAppServiceConfig);
|
|
12
|
+
get hasOneTimePayment(): boolean;
|
|
13
|
+
get hasOnFilePayment(): boolean;
|
|
14
|
+
setStorePaymentMethod(store: boolean): void;
|
|
15
|
+
initialize(): Promise<void>;
|
|
16
|
+
renderButton(target: HTMLElement): Promise<void>;
|
|
17
|
+
begin(): void;
|
|
18
|
+
subscribeToEvent(eventType: CashAppPayEvents, callback: Function): Function;
|
|
19
|
+
createCustomerRequest(): Promise<void>;
|
|
20
|
+
restart(): Promise<void>;
|
|
21
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { PaymentAmount } from '../../../types';
|
|
2
|
+
export interface ICashAppWindowObject {
|
|
3
|
+
pay({ clientId }: {
|
|
4
|
+
clientId: string;
|
|
5
|
+
}): Promise<ICashAppSDK>;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* https://developers.cash.app/docs/api/technical-documentation/sdks/pay-kit/technical-reference
|
|
9
|
+
*/
|
|
10
|
+
export interface ICashAppSDK {
|
|
11
|
+
render(target: string | HTMLElement, options?: any): Promise<{
|
|
12
|
+
begin?: () => void;
|
|
13
|
+
}>;
|
|
14
|
+
addEventListener(eventType: CashAppPayEvents, callback: Function): void;
|
|
15
|
+
removeEventListener(eventType: CashAppPayEvents, callback: Function): void;
|
|
16
|
+
customerRequest(customerRequest: any): Promise<void>;
|
|
17
|
+
restart(): Promise<void>;
|
|
18
|
+
}
|
|
19
|
+
export declare enum CashAppPayEvents {
|
|
20
|
+
CustomerDismissed = "CUSTOMER_DISMISSED",
|
|
21
|
+
CustomerRequestApproved = "CUSTOMER_REQUEST_APPROVED",
|
|
22
|
+
CustomerRequestDeclined = "CUSTOMER_REQUEST_DECLINED",
|
|
23
|
+
CustomerRequestFailed = "CUSTOMER_REQUEST_FAILED"
|
|
24
|
+
}
|
|
25
|
+
export interface ICashAppService {
|
|
26
|
+
begin(): void;
|
|
27
|
+
initialize(): Promise<void>;
|
|
28
|
+
setStorePaymentMethod(store: boolean): void;
|
|
29
|
+
renderButton(target: HTMLElement): Promise<void>;
|
|
30
|
+
restart(): Promise<void>;
|
|
31
|
+
createCustomerRequest(): Promise<void>;
|
|
32
|
+
subscribeToEvent(eventType: CashAppPayEvents, callback: Function): Function;
|
|
33
|
+
}
|
|
34
|
+
export type CashAppServiceConfig = {
|
|
35
|
+
useCashAppButtonUi: boolean;
|
|
36
|
+
storePaymentMethod: boolean;
|
|
37
|
+
environment: string;
|
|
38
|
+
clientId: string;
|
|
39
|
+
scopeId: string;
|
|
40
|
+
amount: PaymentAmount;
|
|
41
|
+
referenceId?: string;
|
|
42
|
+
redirectURL?: string;
|
|
43
|
+
button?: {
|
|
44
|
+
shape?: 'semiround' | 'round';
|
|
45
|
+
size?: 'medium' | 'small';
|
|
46
|
+
theme?: 'dark' | 'light';
|
|
47
|
+
width?: 'static' | 'full';
|
|
48
|
+
};
|
|
49
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { UIElementProps } from '../types';
|
|
2
|
+
export interface CashAppPayElementProps extends UIElementProps {
|
|
3
|
+
/**
|
|
4
|
+
* Indicates that the payment must be stored (Ex: in case there is no checkbox but merchant wants to store it)
|
|
5
|
+
*/
|
|
6
|
+
storePaymentMethod?: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Enables storing the payment method using the Checkbox
|
|
9
|
+
*/
|
|
10
|
+
enableStoreDetails?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Callback triggered before starting the CashAppPay flow. Use case: Validate customer data, check product availability
|
|
13
|
+
*/
|
|
14
|
+
onClick?(actions: {
|
|
15
|
+
resolve: () => void;
|
|
16
|
+
reject: () => void;
|
|
17
|
+
}): void;
|
|
18
|
+
/**
|
|
19
|
+
* A reference to your system (for example, a cart or checkout identifier). Maximum length 1024 characters.
|
|
20
|
+
* https://developers.cash.app/docs/api/technical-documentation/sdks/pay-kit/technical-reference#parameters-3
|
|
21
|
+
*/
|
|
22
|
+
referenceId?: string;
|
|
23
|
+
/**
|
|
24
|
+
* The destination for the customer after approving (or declining) in Cash App for mobile redirect flow.
|
|
25
|
+
* https://developers.cash.app/docs/api/technical-documentation/sdks/pay-kit/technical-reference#customerrequest
|
|
26
|
+
* @defaultValue window.location.ref
|
|
27
|
+
*/
|
|
28
|
+
redirectURL?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Button customization
|
|
31
|
+
* https://developers.cash.app/docs/api/technical-documentation/sdks/pay-kit/use-cases#customize-the-cash-app-pay-button
|
|
32
|
+
*/
|
|
33
|
+
button?: {
|
|
34
|
+
shape?: 'semiround' | 'round';
|
|
35
|
+
size?: 'medium' | 'small';
|
|
36
|
+
theme?: 'dark' | 'light';
|
|
37
|
+
width?: 'static' | 'full';
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* CashAppPay configuration sent by the /paymentMethods response
|
|
41
|
+
*/
|
|
42
|
+
configuration?: {
|
|
43
|
+
clientId: string;
|
|
44
|
+
scopeId: string;
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* If payment is tokenized, then API will return its ID
|
|
48
|
+
* @internal
|
|
49
|
+
*/
|
|
50
|
+
storedPaymentMethodId?: string;
|
|
51
|
+
/**
|
|
52
|
+
* If payment is tokenized, then API will return this value
|
|
53
|
+
* @internal
|
|
54
|
+
*/
|
|
55
|
+
cashtag?: string;
|
|
56
|
+
}
|
|
57
|
+
export type CashAppPayElementData = {
|
|
58
|
+
paymentMethod: {
|
|
59
|
+
type: string;
|
|
60
|
+
grantId?: string;
|
|
61
|
+
storedPaymentMethodId?: string;
|
|
62
|
+
};
|
|
63
|
+
storePaymentMethod?: boolean;
|
|
64
|
+
};
|
|
65
|
+
export type CashAppPayEventData = {
|
|
66
|
+
cashTag?: string;
|
|
67
|
+
customerId?: string;
|
|
68
|
+
grantId?: string;
|
|
69
|
+
onFileGrantId?: string;
|
|
70
|
+
};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { h } from 'preact';
|
|
2
2
|
import './OrderPaymentMethods.scss';
|
|
3
|
-
export declare const OrderPaymentMethods: ({ order, orderStatus, onOrderCancel }: {
|
|
3
|
+
export declare const OrderPaymentMethods: ({ order, orderStatus, onOrderCancel, brandLogoConfiguration }: {
|
|
4
4
|
order: any;
|
|
5
5
|
orderStatus: any;
|
|
6
6
|
onOrderCancel: any;
|
|
7
|
+
brandLogoConfiguration: any;
|
|
7
8
|
}) => h.JSX.Element;
|
|
8
9
|
export default OrderPaymentMethods;
|
|
@@ -28,6 +28,11 @@ export interface DropinElementProps extends UIElementProps {
|
|
|
28
28
|
* @defaultValue []
|
|
29
29
|
*/
|
|
30
30
|
instantPaymentTypes?: InstantPaymentTypes[];
|
|
31
|
+
/**
|
|
32
|
+
* Instant Payment methods derived from the instantPaymentTypes property
|
|
33
|
+
* @internal
|
|
34
|
+
*/
|
|
35
|
+
instantPaymentMethods?: PaymentMethod[];
|
|
31
36
|
openFirstStoredPaymentMethod?: boolean;
|
|
32
37
|
openFirstPaymentMethod?: boolean;
|
|
33
38
|
onSubmit?: (data: any, component: any) => void;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { h } from 'preact';
|
|
2
2
|
import { GiftcardFieldProps } from './types';
|
|
3
|
-
export declare const GiftcardPinField: ({ i18n, classNameModifiers, sfpState, focusedElement, setFocusOn }: GiftcardFieldProps) => h.JSX.Element;
|
|
3
|
+
export declare const GiftcardPinField: ({ i18n, classNameModifiers, sfpState, focusedElement, setFocusOn, label }: GiftcardFieldProps) => h.JSX.Element;
|
|
@@ -8,6 +8,7 @@ export type GiftcardFieldsProps = {
|
|
|
8
8
|
getCardErrorMessage: any;
|
|
9
9
|
focusedElement: any;
|
|
10
10
|
setFocusOn: any;
|
|
11
|
+
label?: string;
|
|
11
12
|
};
|
|
12
13
|
export type GiftcardFieldProps = {
|
|
13
14
|
i18n: Language;
|
|
@@ -16,4 +17,5 @@ export type GiftcardFieldProps = {
|
|
|
16
17
|
getCardErrorMessage: any;
|
|
17
18
|
focusedElement: any;
|
|
18
19
|
setFocusOn: any;
|
|
20
|
+
label?: string;
|
|
19
21
|
};
|
|
@@ -25,6 +25,8 @@ interface KlarnaPaymentsShared {
|
|
|
25
25
|
paymentMethodType: string;
|
|
26
26
|
}
|
|
27
27
|
export interface KlarnaWidgetProps extends KlarnaPaymentsShared {
|
|
28
|
+
/** @internal */
|
|
29
|
+
payButton: (options: any) => any;
|
|
28
30
|
onComplete: (detailsData: any) => void;
|
|
29
31
|
onError: (error: any) => void;
|
|
30
32
|
}
|
|
@@ -4,6 +4,7 @@ import ApplePay from './ApplePay';
|
|
|
4
4
|
import Atome from './Atome';
|
|
5
5
|
import { BillDeskOnline, BillDeskWallet } from './BillDesk';
|
|
6
6
|
import Card from './Card';
|
|
7
|
+
import CashAppPay from './CashAppPay';
|
|
7
8
|
import ClickToPay from './ClickToPay';
|
|
8
9
|
import Bancontact from './Card/Bancontact';
|
|
9
10
|
import Donation from './Donation';
|
|
@@ -108,6 +109,7 @@ declare const componentsMap: {
|
|
|
108
109
|
/** Wallets */
|
|
109
110
|
amazonpay: typeof AmazonPay;
|
|
110
111
|
applepay: typeof ApplePay;
|
|
112
|
+
cashapp: typeof CashAppPay;
|
|
111
113
|
clicktopay: typeof ClickToPay;
|
|
112
114
|
googlepay: typeof GooglePay;
|
|
113
115
|
paypal: typeof PayPal;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { h } from 'preact';
|
|
2
|
+
import { AddressLookupItem } from '../types';
|
|
3
|
+
import './AddressSearch.scss';
|
|
4
|
+
export type OnAddressLookupType = (value: string, actions: {
|
|
5
|
+
resolve: (value: Array<AddressLookupItem>) => void;
|
|
6
|
+
reject: (reason?: any) => void;
|
|
7
|
+
}) => Promise<void>;
|
|
8
|
+
interface AddressSearchProps {
|
|
9
|
+
onAddressLookup?: OnAddressLookupType;
|
|
10
|
+
onSelect: any;
|
|
11
|
+
onManualAddress: any;
|
|
12
|
+
externalErrorMessage: string;
|
|
13
|
+
hideManualButton: boolean;
|
|
14
|
+
}
|
|
15
|
+
export default function AddressSearch({ onAddressLookup, onSelect, onManualAddress, externalErrorMessage, hideManualButton }: AddressSearchProps): h.JSX.Element;
|
|
16
|
+
export {};
|
|
@@ -2,6 +2,7 @@ import { AddressField, AddressData } from '../../../types';
|
|
|
2
2
|
import Specifications from './Specifications';
|
|
3
3
|
import { ValidatorRules } from '../../../utils/Validator/types';
|
|
4
4
|
import { ValidationRuleResult } from '../../../utils/Validator/ValidationRuleResult';
|
|
5
|
+
import { OnAddressLookupType } from './components/AddressSearch';
|
|
5
6
|
export type StringObject = {
|
|
6
7
|
[key: string]: string;
|
|
7
8
|
};
|
|
@@ -11,6 +12,7 @@ export interface AddressProps {
|
|
|
11
12
|
data?: object;
|
|
12
13
|
label?: string;
|
|
13
14
|
onChange: (newState: any) => void;
|
|
15
|
+
onAddressLookup?: OnAddressLookupType;
|
|
14
16
|
requiredFields?: string[];
|
|
15
17
|
ref?: any;
|
|
16
18
|
specifications?: AddressSpecifications;
|
|
@@ -22,6 +24,10 @@ export interface AddressProps {
|
|
|
22
24
|
showPayButton?: boolean;
|
|
23
25
|
setComponentRef?: (ref: any) => void;
|
|
24
26
|
}
|
|
27
|
+
export interface AddressLookupItem extends AddressData {
|
|
28
|
+
id: string;
|
|
29
|
+
name: string;
|
|
30
|
+
}
|
|
25
31
|
export interface AddressStateError {
|
|
26
32
|
street?: ValidationRuleResult;
|
|
27
33
|
houseNumberOrName?: ValidationRuleResult;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import Language from '../../../language';
|
|
2
2
|
import { StringObject } from './types';
|
|
3
|
+
export declare const DEFAULT_DEBOUNCE_TIME_MS = 300;
|
|
3
4
|
/**
|
|
4
5
|
* Used by the SRPanel sorting function to tell it whether we need to prepend the field type to the SR panel message, and, if so, we retrieve the correct translation for the field type.
|
|
5
6
|
* (Whether we need to prepend the field type depends on whether we know that the error message correctly reflects the label of the field. Ultimately all error messages should do this
|
|
6
7
|
* and this mapping fn will become redundant)
|
|
7
8
|
*/
|
|
8
9
|
export declare const mapFieldKey: (key: string, i18n: Language, countrySpecificLabels: StringObject) => string;
|
|
10
|
+
export declare const debounce: (fn: Function, ms?: number) => (this: any, ...args: any[]) => void;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { SRPanel } from '../../../core/Errors/SRPanel';
|
|
2
|
+
import Language from '../../../language';
|
|
3
|
+
import { CountdownTime } from './types';
|
|
4
|
+
interface ICountdownA11yService {
|
|
5
|
+
srPanel: SRPanel;
|
|
6
|
+
i18n: Language;
|
|
7
|
+
}
|
|
8
|
+
export declare class CountdownA11yReporter {
|
|
9
|
+
protected TRANSLATION_KEY: string;
|
|
10
|
+
protected LONG_TIMEOUT: number;
|
|
11
|
+
protected MID_TIMEOUT: number;
|
|
12
|
+
protected SHORT_TIMEOUT: number;
|
|
13
|
+
private readonly srPanel;
|
|
14
|
+
private readonly i18n;
|
|
15
|
+
private srInterval;
|
|
16
|
+
private timeout;
|
|
17
|
+
private timeLeft;
|
|
18
|
+
constructor(props: ICountdownA11yService);
|
|
19
|
+
update(time: CountdownTime): void;
|
|
20
|
+
tearDown(): void;
|
|
21
|
+
private setInterval;
|
|
22
|
+
private getSrMessages;
|
|
23
|
+
private clearInterval;
|
|
24
|
+
}
|
|
25
|
+
export {};
|
|
@@ -1,30 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
onTick?: (time: any) => void;
|
|
5
|
-
onCompleted?: () => void;
|
|
6
|
-
}
|
|
7
|
-
interface CountdownState {
|
|
8
|
-
startTime: Date;
|
|
9
|
-
endTime: Date;
|
|
10
|
-
minutes: string;
|
|
11
|
-
seconds: string;
|
|
12
|
-
}
|
|
13
|
-
declare class Countdown extends Component<CountdownProps, CountdownState> {
|
|
14
|
-
constructor(props: any);
|
|
15
|
-
static defaultProps: {
|
|
16
|
-
onTick: () => void;
|
|
17
|
-
onCompleted: () => void;
|
|
18
|
-
};
|
|
19
|
-
protected interval: any;
|
|
20
|
-
tick(): void | {
|
|
21
|
-
minutes: any;
|
|
22
|
-
seconds: any;
|
|
23
|
-
percentage: number;
|
|
24
|
-
};
|
|
25
|
-
clearInterval(): void;
|
|
26
|
-
componentDidMount(): void;
|
|
27
|
-
componentWillUnmount(): void;
|
|
28
|
-
render(): h.JSX.Element;
|
|
29
|
-
}
|
|
1
|
+
import { h } from 'preact';
|
|
2
|
+
import { CountdownProps } from './types';
|
|
3
|
+
declare function Countdown({ minutesFromNow, onTick, onCompleted }: CountdownProps): h.JSX.Element;
|
|
30
4
|
export default Countdown;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { h } from 'preact';
|
|
2
2
|
import { SelectProps } from './types';
|
|
3
3
|
import './Select.scss';
|
|
4
|
-
declare function Select({ items, className, classNameModifiers, filterable, readonly, onChange, selected, name, isInvalid, isValid, placeholder, uniqueId, disabled }: SelectProps): h.JSX.Element;
|
|
4
|
+
declare function Select({ items, className, classNameModifiers, filterable, readonly, onChange, onInput, selected, name, isInvalid, isValid, placeholder, uniqueId, disabled, disableTextFilter, clearOnSelect }: SelectProps): h.JSX.Element;
|
|
5
5
|
declare namespace Select {
|
|
6
6
|
var defaultProps: {
|
|
7
7
|
className: string;
|
|
@@ -20,11 +20,14 @@ export interface SelectProps {
|
|
|
20
20
|
name: string;
|
|
21
21
|
};
|
|
22
22
|
}) => void;
|
|
23
|
+
onInput?: (value: string) => void;
|
|
23
24
|
placeholder: string;
|
|
24
25
|
readonly: boolean;
|
|
25
26
|
selected: string;
|
|
26
27
|
uniqueId?: string;
|
|
27
28
|
disabled: boolean;
|
|
29
|
+
disableTextFilter: boolean;
|
|
30
|
+
clearOnSelect: boolean;
|
|
28
31
|
}
|
|
29
32
|
export interface SelectButtonProps {
|
|
30
33
|
inputText: string;
|