UNPKG

@adyen/adyen-web

Version:

[![npm](https://img.shields.io/npm/v/@adyen/adyen-web.svg)](https://www.npmjs.com/package/@adyen/adyen-web)

108 lines (107 loc) 4.63 kB
import { h } from 'preact'; import UIElement from '../UIElement'; import { PaymentAction, PaymentMethod } from '../../types'; import { DropinElementProps, InstantPaymentTypes } from './types'; import { PaymentResponse } from '../types'; declare class DropinElement extends UIElement<DropinElementProps> { static type: string; protected static defaultProps: { isDropin: boolean; onReady: () => void; onComplete: () => void; onError: () => void; onSelect: () => void; onDisableStoredPaymentMethod: any; onChange: () => void; instantPaymentMethods: any[]; amount: {}; installmentOptions: {}; paymentMethodsConfiguration: {}; openFirstPaymentMethod: boolean; openFirstStoredPaymentMethod: boolean; showStoredPaymentMethods: boolean; showPaymentMethods: boolean; showRemoveStoredPaymentMethodButton: boolean; showPayButton: boolean; }; dropinRef: any; /** * Reference to the component created from `handleAction` (Ex.: ThreeDS2Challenge) */ componentFromAction?: UIElement; constructor(props: any); formatProps(props: any): { instantPaymentTypes: InstantPaymentTypes[]; instantPaymentMethods: PaymentMethod[]; paymentMethods: PaymentMethod[]; paymentMethodsConfiguration?: import("../../core/types").PaymentMethodsConfiguration; storedPaymentMethods?: import("../../types").StoredPaymentMethod[]; order?: import("../../types").Order; showStoredPaymentMethods?: boolean; showPaymentMethods?: boolean; openFirstStoredPaymentMethod?: boolean; openFirstPaymentMethod?: boolean; onSubmit?: (data: any, component: any) => void; onReady?: () => void; onSelect?: (paymentMethod: UIElement<any>) => void; showRemovePaymentMethodButton?: boolean; onDisableStoredPaymentMethod?: (storedPaymentMethod: any, resolve: any, reject: any) => void; environment?: string; session?: import("../../core/CheckoutSession/CheckoutSession").default; onChange?: (state: any, element: UIElement<any>) => void; onValid?: (state: any, element: UIElement<any>) => void; beforeSubmit?: (state: any, element: UIElement<any>, actions: any) => Promise<void>; onComplete?: (state: any, element: UIElement<any>) => void; onActionHandled?: (rtnObj: import("../types").ActionHandledReturnObject) => void; onAdditionalDetails?: (state: any, element: UIElement<any>) => void; onError?: (error: any, element?: UIElement<any>) => void; onPaymentCompleted?: (result: any, element: UIElement<any>) => void; beforeRedirect?: (resolve: any, reject: any, redirectData: any, element: UIElement<any>) => void; isInstantPayment?: boolean; type?: string; name?: string; icon?: string; amount?: import("../../types").PaymentAmount; secondaryAmount?: import("../../types").PaymentAmountExtended; brand?: string; showPayButton?: boolean; setStatusAutomatically?: boolean; payButton?: (options: import("../types").PayButtonFunctionProps) => h.JSX.Element; loadingContext?: string; createFromAction?: (action: PaymentAction, props: object) => UIElement<any>; clientKey?: string; paymentMethodType?: string; elementRef?: any; i18n?: import("../../language").default; _parentInstance?: import("../../core/core").default; modules?: { srPanel?: import("../../core/Errors/SRPanel").SRPanel; analytics?: import("../types").AnalyticsModule; resources?: import("../../core/Context/Resources").Resources; risk?: import("../../core/RiskModule").default; }; isDropin?: boolean; }; get isValid(): boolean; showValidation(): this; setStatus(status: any, props?: {}): this; get activePaymentMethod(): any; get data(): any; /** * Calls the onSubmit event with the state of the activePaymentMethod */ submit(): void; /** * Creates the Drop-in elements */ private handleCreate; handleAction(action: PaymentAction, props?: {}): UIElement | null; /** * handleOrder is implemented so we don't trigger a callback like in the components * @param response - PaymentResponse */ protected handleOrder: ({ order }: PaymentResponse) => void; closeActivePaymentMethod(): void; render(): h.JSX.Element; } export default DropinElement;