UNPKG

@adyen/adyen-web

Version:

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

68 lines (67 loc) 2.42 kB
import { h } from 'preact'; import UIElement from '../UIElement'; import { PaymentAction } from '../../types'; import { PayPalElementProps } from './types'; import './Paypal.scss'; import { SendAnalyticsObject } from '../../core/Analytics/types'; declare class PaypalElement extends UIElement<PayPalElementProps> { static type: string; static subtype: string; paymentData: string; private resolve; private reject; protected static defaultProps: PayPalElementProps; constructor(props: any); protected submitAnalytics(analyticsObj: SendAnalyticsObject): void; formatProps(props: PayPalElementProps): PayPalElementProps; submit: () => void; /** * Updates the paymentData value. It must be used in the PayPal Express flow, when patching the amount * @param paymentData - Payment data value */ updatePaymentData(paymentData: string): void; /** * Formats the component data output */ protected formatData(): { paymentMethod: { type: string; userAction: "continue" | "pay"; subtype: string; }; }; handleAction: (action: PaymentAction) => any; updateWithAction: (action: PaymentAction) => any; /** * Dropin Validation * * @remarks * Paypal does not require any specific Dropin validation */ get isValid(): boolean; private handleCancel; private handleOnApprove; handleResolve(token: string): void; handleReject(errorMessage: string): void; private handleSubmit; /** * If the merchant provides the 'onShippingAddressChange' callback, then this method is used as a wrapper to it, in order * to expose to the merchant the 'component' instance. The merchant needs the 'component' in order to manipulate the * paymentData * * @param data - PayPal data * @param actions - PayPal actions. */ private handleOnShippingAddressChange; /** * If the merchant provides the 'onShippingOptionsChange' callback, then this method is used as a wrapper to it, in order * to expose to the merchant the 'component' instance. The merchant needs the 'component' in order to manipulate the * paymentData * * @param data - PayPal data * @param actions - PayPal actions. */ private handleOnShippingOptionsChange; render(): h.JSX.Element; } export default PaypalElement;