;
/**
* Make sure the await action UIElement is available before mounting
*/
handleAction(action: PaymentAction, props?: {}): UIElement | null;
formatData(): PayByBankPixData;
/**
* There are 3 endpoints (stages) we need to call for the enrollment flow.
* The first one is the regular payments call on issuer selection - we indicate to store the payment token for the selected issuer.
* The second one is to poll the enrollment eligibility - we poll the server to get the enrollment challenge in the `getEnrollmentStatus` function.
* The third one is in the `authorizeEnrollment` function - we create passkeys and authorize the enrollment with shopper's passkey.
*/
private readonly onIssuerSelected;
private readonly authorizeEnrollment;
/**
* There are 3 endpoints (stages) we need to call for the payment flow.
* The first one `payWithStoredPayment` is the regular payments call - we attempt to pay with the stored payment token.
* The second one is to poll the authorization options - we poll the server to get the challenge in the `getAuthorizationStatus` function.
* The third one is in the `authorizePayment` function - we authorize the payment with shopper's passkey.
*/
private readonly payWithStoredPayment;
private readonly authorizePayment;
protected componentToRender(): h.JSX.Element;
}
/** Components */
/**
* Maps each tx variant to a Component element.
*
* WARNING: This mapping must be imported carefully as it breaks the tree-shaking. It is now used in:
* - The utility function 'createComponent' for UMD bundle (UMD bundle does not have tree-shaking, so this use-case is fine)
* - Generating Drop-in Typescript types (Typescript types do not break tree-shaking)
*/
declare const ComponentsMap: {
/** internal */
address: typeof AddressElement;
donation: typeof DonationElement;
personal_details: typeof PersonalDetailsElement;
/** internal */
/** Bank Transfer */
bankTransfer_IBAN: typeof BankTransferElement;
bankTransfer_BE: typeof BankTransferElement;
bankTransfer_NL: typeof BankTransferElement;
bankTransfer_PL: typeof BankTransferElement;
bankTransfer_FR: typeof BankTransferElement;
bankTransfer_CH: typeof BankTransferElement;
bankTransfer_IE: typeof BankTransferElement;
bankTransfer_GB: typeof BankTransferElement;
bankTransfer_DE: typeof BankTransferElement;
bankTransfer_AE: typeof BankTransferElement;
bankTransfer_AT: typeof BankTransferElement;
bankTransfer_AU: typeof BankTransferElement;
bankTransfer_BG: typeof BankTransferElement;
bankTransfer_CA: typeof BankTransferElement;
bankTransfer_EE: typeof BankTransferElement;
bankTransfer_ES: typeof BankTransferElement;
bankTransfer_FI: typeof BankTransferElement;
bankTransfer_HK: typeof BankTransferElement;
bankTransfer_HU: typeof BankTransferElement;
bankTransfer_IT: typeof BankTransferElement;
bankTransfer_JP: typeof BankTransferElement;
bankTransfer_LU: typeof BankTransferElement;
bankTransfer_NZ: typeof BankTransferElement;
bankTransfer_PT: typeof BankTransferElement;
bankTransfer_SG: typeof BankTransferElement;
bankTransfer_SK: typeof BankTransferElement;
bankTransfer_US: typeof BankTransferElement;
/** Bank Transfer */
/** Card */
bcmc: typeof BancontactElement;
card: typeof CardElement;
scheme: typeof CardElement;
storedCard: typeof CardElement;
customcard: typeof CustomCard;
/** Card */
/** Direct debit */
ach: typeof AchElement;
directdebit_GB: typeof BacsElement;
sepadirectdebit: typeof SepaElement;
eft_directdebit_CA: typeof PreAuthorizedDebitCanada;
/** Direct debit */
/** Open Invoice */
affirm: typeof Affirm;
afterpay: typeof AfterPay;
afterpay_default: typeof AfterPay;
afterpay_b2b: typeof AfterPayB2B;
atome: typeof Atome;
facilypay_3x: typeof FacilyPay3x;
facilypay_4x: typeof FacilyPay4x;
facilypay_6x: typeof FacilyPay6x;
facilypay_10x: typeof FacilyPay10x;
facilypay_12x: typeof FacilyPay12x;
ratepay: typeof RatePay;
ratepay_directdebit: typeof RatePayDirectDebit;
/** Open Invoice */
/** Wallets */
amazonpay: typeof AmazonPayElement;
applepay: typeof ApplePayElement;
cashapp: typeof CashAppPay;
clicktopay: typeof ClickToPayElement;
googlepay: typeof GooglePay;
paypal: typeof PaypalElement;
fastlane: typeof Fastlane;
paywithgoogle: typeof GooglePay;
/** Wallets */
/** Voucher */
boletobancario: typeof BoletoElement;
boletobancario_itau: typeof BoletoElement;
boletobancario_santander: typeof BoletoElement;
doku: typeof DokuElement;
doku_alfamart: typeof DokuElement;
doku_permata_lite_atm: typeof DokuElement;
doku_indomaret: typeof DokuElement;
doku_atm_mandiri_va: typeof DokuElement;
doku_sinarmas_va: typeof DokuElement;
doku_mandiri_va: typeof DokuElement;
doku_cimb_va: typeof DokuElement;
doku_danamon_va: typeof DokuElement;
doku_bri_va: typeof DokuElement;
doku_bni_va: typeof DokuElement;
doku_bca_va: typeof DokuElement;
doku_wallet: typeof DokuElement;
oxxo: typeof OxxoElement;
primeiropay_boleto: typeof BoletoElement;
/** Voucher */
/** issuerList */
billdesk_online: typeof BillDeskOnlineElement;
billdesk_wallet: typeof BillDeskWalletElement;
dotpay: typeof DotpayElement;
eps: typeof EPSElement;
iris: typeof Iris;
molpay_ebanking_fpx_MY: typeof MolPayEBankingMYElement;
molpay_ebanking_TH: typeof MolPayEBankingTHElement;
molpay_ebanking_VN: typeof MolPayEbankingVNElement;
onlineBanking_CZ: typeof OnlineBankingCZElement;
onlinebanking_IN: typeof OnlineBankingINElement;
onlineBanking_PL: typeof OnlineBankingPL;
onlineBanking_SK: typeof OnlineBankingSKElement;
paybybank: typeof PayByBank;
payu_IN_cashcard: typeof PayuNetCashcardElement;
payu_IN_nb: typeof PayuNetBankingElement;
wallet_IN: typeof WalletINElement;
/** issuerList */
/** Dragonpay */
dragonpay_ebanking: typeof DragonpayElement;
dragonpay_otc_banking: typeof DragonpayElement;
dragonpay_otc_non_banking: typeof DragonpayElement;
dragonpay_otc_philippines: typeof DragonpayElement;
/** Dragonpay */
/** Econtext */
econtext_atm: typeof EcontextElement;
econtext_online: typeof EcontextElement;
econtext_seven_eleven: typeof EcontextElement;
econtext_stores: typeof EcontextElement;
/** Econtext */
/** Redirect */
giropay: typeof GiropayElement;
multibanco: typeof MultibancoElement;
redirect: typeof RedirectElement;
twint: typeof TwintElement;
vipps: typeof VippsElement;
trustly: typeof TrustlyElement;
paybybank_AIS_DD: typeof PayByBankUS;
riverty: typeof Riverty;
paybybank_pix: typeof PayByBankPixElement;
/** Redirect */
/** Klarna */
klarna: typeof KlarnaPayments;
klarna_account: typeof KlarnaPayments;
klarna_paynow: typeof KlarnaPayments;
klarna_b2b: typeof KlarnaPayments;
/** Klarna */
/** QRLoader */
bcmc_mobile: typeof BCMCMobileElement;
bcmc_mobile_QR: typeof BCMCMobileElement;
pix: typeof PixElement;
swish: typeof SwishElement;
wechatpay: typeof WeChatPayElement;
wechatpayQR: typeof WeChatPayElement;
promptpay: typeof PromptPayElement;
paynow: typeof PayNowElement;
duitnow: typeof DuitNowElement;
/** QRLoader */
/** Await */
blik: typeof BlikElement;
mbway: typeof MBWayElement;
ancv: typeof ANCVElement;
payto: typeof PayToElement;
upi: typeof UPI;
upi_qr: typeof UPI;
upi_intent: typeof UPI;
/** Await */
/** Giftcard */
giftcard: typeof GiftcardElement;
mealVoucher_FR_natixis: typeof MealVoucherFRElement;
mealVoucher_FR_sodexo: typeof MealVoucherFRElement;
mealVoucher_FR_groupeup: typeof MealVoucherFRElement;
};
/**
* Available components
*/
type PaymentMethods = typeof ComponentsMap;
/**
* Options for a component
*/
type PaymentMethodOptions = InstanceType['props'];
type PaymentMethodsConfigurationMap = {
[key in keyof PaymentMethods]?: Partial>;
};
type PaymentActionTypesMap = {
[key in PaymentActionsType]?: Partial;
};
/**
* Type must be loose, otherwise it will take priority over the rest
*/
type NonMappedPaymentMethodsMap = {
[key: string]: any;
};
type PaymentMethodsConfiguration = PaymentMethodsConfigurationMap & PaymentActionTypesMap & NonMappedPaymentMethodsMap;
type InstantPaymentTypes = 'paywithgoogle' | 'googlepay' | 'applepay';
interface DropinConfiguration extends UIElementProps {
/**
* Configure each payment method displayed on the Drop-in
*/
paymentMethodsConfiguration?: PaymentMethodsConfiguration;
/**
* Pass the payment method classes that are going to be used as part of the Drop-in.
*/
paymentMethodComponents?: NewableComponent[];
order?: Order;
/**
* Show/Hide stored payment methods
* @defaultValue true
*/
showStoredPaymentMethods?: boolean;
/**
* Disable the final animation when the payment is successful or if it fails.
* @defaultValue false
*/
disableFinalAnimation?: boolean;
/**
* Show/Hide regular (non-stored) payment methods
* @defaultValue true
*/
showPaymentMethods?: boolean;
/**
* Show wallet payment methods to show on top of the regular payment
* method list.
*
* @defaultValue []
*/
instantPaymentTypes?: InstantPaymentTypes[];
/**
* Pre-select a specific payment method when Drop-in is rendered
*
* @default undefined
*/
openPaymentMethod?: {
type: string;
};
/**
* Pre-select the first stored payment method.
* It has priority over 'openFirstPaymentMethod' property
*
* @default true
*/
openFirstStoredPaymentMethod?: boolean;
/**
* Pre-select the first non-stored payment method.
* 'openFirstStoredPaymentMethod' has priority over this property
*
* @default true
*/
openFirstPaymentMethod?: boolean;
/**
* Callback triggered once the Drop-in is ready to be used
*/
onReady?(): void;
/**
* Callback triggered before Drop-in creates the stored payment method UIElements.
* This callback lets you choose which saved payment methods appear in the Drop-in.
*/
filterStoredPaymentMethods?(storedPaymentMethods: RawStoredPaymentMethod[]): RawStoredPaymentMethod[];
/**
* Callback triggered once the shopper selects a different payment method in the Drop-in
*/
onSelect?(paymentMethod: UIElement): void;
/**
* Show/Hide the remove payment method button on stored payment methods
* Requires {@link DropinConfiguration.onDisableStoredPaymentMethod}
* @defaultValue false
*/
showRemovePaymentMethodButton?: boolean;
/**
* Show/Hide the radio in the payment method list
* @defaultValue false
*/
showRadioButton?: boolean;
/**
* Called when a shopper clicks Remove on a stored payment method
* Use this to call the {@link https://docs.adyen.com/api-explorer/#/Recurring/v49/post/disable /disable endpoint}
* Call resolve() if the removal was successful, or call reject() if there was an error
* @defaultValue false
*/
onDisableStoredPaymentMethod?: (storedPaymentMethod: any, resolve: any, reject: any) => void;
}
interface onOrderCancelData {
order: {
orderData: string;
pspReference: string;
};
}
type onOrderCancelType = (data: onOrderCancelData, actions: {
resolve: (data: {
amount: PaymentAmount;
}) => void;
reject: (error: string) => void;
}) => void;
interface DropinComponentProps extends DropinConfiguration {
core: ICore;
onCreateElements(): any;
onElementsCreated(elements: UIElement[]): void;
onOrderCancel?: onOrderCancelType;
}
interface DropinStatus {
type: UIElementStatus | StatusFromAction;
props?: DropinStatusProps;
}
interface DropinStatusProps {
component?: UIElement;
message?: string;
}
interface DropinComponentState {
elements: UIElement[];
fastlanePaymentElement: UIElement[];
instantPaymentElements: UIElement[];
storedPaymentElements: UIElement[];
status: DropinStatus;
activePaymentMethod: UIElement;
cachedPaymentMethods: Record;
showDefaultPaymentMethodList: boolean;
isDisabling: boolean;
orderStatus: OrderStatus;
}
interface IDropin {
/**
* Used to make the Dropin display the final animation
*
* @internal
* @param type - animation type
*/
displayFinalAnimation(type: 'success' | 'error'): void;
activePaymentMethod: () => null;
closeActivePaymentMethod: () => void;
}
interface SFError {
isValid?: boolean;
errorMessage?: string;
errorI18n?: string;
error: string;
rootNode: HTMLElement;
detectedBrands?: string[];
}
interface SFStateErrorObj {
[key: string]: SFError;
}
interface ValidationRuleErrorObj {
[key: string]: ValidationRuleResult;
}
interface AriaAttributes {
'aria-relevant'?: 'additions' | 'all' | 'removals' | 'text' | 'additions text';
'aria-live'?: 'off' | 'polite' | 'assertive';
'aria-atomic'?: 'true' | 'false';
}
interface SRPanelProps extends BaseElementProps {
enabled?: boolean;
node?: string;
showPanel?: boolean;
moveFocus?: boolean;
id?: string;
ariaAttributes?: AriaAttributes;
}
type SRPanelConfig = Pick;
interface GenericError {
isValid: boolean;
errorMessage: string;
error: string;
}
/**
* A panel meant to hold messages that will be read out by ScreenReaders on an aria-live="polite" basis
* Expects a string or string array of message to add to the panel to be read out
* For testing purposes can be made visible
*/
declare class SRPanel extends BaseElement {
static readonly type = "srPanel";
static readonly defaultProps: Partial;
private readonly srPanelContainer;
private readonly id;
private readonly showPanel;
private readonly _enabled;
private readonly _moveFocus;
private componentRef;
constructor(checkout: ICore, props?: SRPanelProps);
setComponentRef: (ref: any) => void;
get enabled(): boolean;
get moveFocus(): boolean;
setAriaProps(ariaAttributes: AriaAttributes): void;
setMessages: (messages: string[] | string) => void;
render(): h.JSX.Element;
}
interface BaseElementProps {
order?: Order;
modules?: {
srPanel?: SRPanel;
analytics?: IAnalytics;
resources?: Resources;
risk?: RiskElement;
};
/**
* Identifies if the Element is the DropIn element
*/
isDropin?: boolean;
}
interface IBaseElement {
data: object;
state: any;
props: any;
_id: string;
_component: any;
render(): ComponentChild | Error;
mount(domNode: HTMLElement | string): IBaseElement;
update(props: any): IBaseElement;
unmount(): IBaseElement;
remove(): void;
activate(): void;
}
type CoreCallbacks = Pick;
type StatusFromAction = 'redirect' | 'loading' | 'custom';
type UIElementProps = {
paymentMethodId?: string;
storedPaymentMethodId?: string;
} & BaseElementProps & CoreCallbacks & {
environment?: string;
session?: Session;
onComplete?: (state: any, element: UIElement) => void;
isInstantPayment?: boolean;
/**
* Flags if the element is Stored payment method
* @internal
*/
isStoredPaymentMethod?: boolean;
/**
* Flag if the element is Stored payment method.
* Perhaps can be deprecated and we use the one above?
* @internal
*/
oneClick?: boolean;
/**
* Stored payment method id
* @internal
*/
storedPaymentMethodId?: string;
/**
* Status set when creating the Component from action
* @internal
*/
statusType?: StatusFromAction;
type?: string;
name?: string;
icon?: string;
amount?: PaymentAmount;
secondaryAmount?: PaymentAmount;
/**
* Show/Hide pay button
* @defaultValue true
*/
showPayButton?: boolean;
/** @internal */
payButton?: (options: PayButtonProps) => h.JSX.Element;
/** @internal */
loadingContext?: string;
/** @internal */
createFromAction?: (action: PaymentAction, props: object) => UIElement;
/** @internal */
clientKey?: string;
/** @internal */
elementRef?: any;
/** @internal */
i18n?: Language;
/**
* The shopper’s issuer account label. It can be available for stored payment method
* @internal
*/
label?: string;
/**
* Returned after the payments call, when an action is returned. It represents the payment method tx variant
* that was used for the payment
* @internal
*/
paymentMethodType?: string;
/**
* Reference to the action object found in a /payments response. This, in most cases, is passed on to the onActionHandled callback
*/
originalAction?: PaymentAction;
};
type UIElementStatus = 'ready' | 'loading' | 'error' | 'success';
interface ComponentMethodsRef {
showValidation?: () => void;
setStatus?(status: UIElementStatus): void;
}
type DonationConfiguration = UIElementProps & Omit & {
onDonate(data: DonationPayload, component: DonationElement): void;
onCancel(data: DonationPayload): void;
};
interface DonationCampaign extends CampaignContentProps {
id: string;
campaignName: string;
donation: Donation;
termsAndConditionsUrl?: string;
}
interface DonationOptions {
/**
* Optional boolean to delay, or halt, the showing of the Donation component when in the Sessions flow.
* Defaults to true.
*/
autoMount?: boolean;
/**
* Optional number representing the delay in milliseconds before the Donation component is mounted (if mandated by the /payments response in the Sessions flow),
* Defaults to 3000.
*/
delay?: number;
/**
* Callback when the (sessions) donation is completed (or cancelled)
* @param didDonate - a boolean stating whether a donation was made (true) or whether the shopper cancelled the donation (false)
*/
onDonationSuccess: (result: {
didDonate: boolean;
}) => void;
/**
* Callback when the (sessions) donation fails
* @param reason - the reason why the donation failed (could be an error message; or a string, stating for example, that the donation payment was refused)
*/
onDonationFailure: (reason: unknown) => void;
}
interface DonationCampaignOptions {
rootNode: HTMLElement | string;
commercialTxAmount: number;
}
/**
* Union type for Donation component instantiation.
* - DonationConfiguration: Direct mode (backward compatible) - campaign data already available
* - DonationCampaignOptions: Service mode - component fetches campaign data
*/
type DonationProps = DonationConfiguration | DonationCampaignOptions;
type CheckoutSession = {
id: string;
sessionData: string;
shopperLocale?: string;
shopperEmail?: string;
telephoneNumber?: string;
};
type SessionConfiguration = {
installmentOptions?: InstallmentOptions;
enableStoreDetails?: boolean;
};
type CheckoutSessionSetupResponse = {
id: string;
sessionData: string;
countryCode?: string;
amount: Omit;
expiresAt: string;
paymentMethods: any;
returnUrl: string;
configuration: SessionConfiguration;
/**
* 'shopperLocale' set during session creation.
* @defaultValue en-US
*/
shopperLocale: string;
};
type CheckoutSessionPaymentResponse = {
sessionData: string;
sessionResult: string;
status?: string;
resultCode: ResultCode;
action?: PaymentAction;
};
type CheckoutSessionDetailsResponse = {
sessionData: string;
sessionResult: string;
resultCode: ResultCode;
status?: string;
action?: PaymentAction;
};
type CheckoutSessionBalanceResponse = {
sessionData: string;
balance?: PaymentAmount;
transactionLimit?: PaymentAmount;
};
type CheckoutSessionOrdersResponse = {
sessionData: string;
orderData: string;
pspReference: string;
};
type CheckoutSessionDonationCampaignsResponse = {
sessionData: string;
donationCampaigns: DonationCampaign[];
};
type CheckoutSessionDonationsResponse = {
resultCode: ResultCode;
sessionData: string;
};
type CheckoutSessionDonationsRequestData = {
donationCampaignId: string;
donationType: DonationType;
amount: PaymentAmount;
};
type SetupSessionOptions = {
browserInfo?: BrowserInfo;
order?: Order;
};
declare class Session {
private readonly storage;
readonly session: CheckoutSession;
readonly clientKey: string;
readonly loadingContext: string;
configuration: SessionConfiguration;
private _sessionsDonationInitiated;
constructor(rawSession: Partial, clientKey: string, loadingContext: string);
get shopperLocale(): string;
get id(): string;
get data(): string;
set sessionsDonationInitiated(donationInitiated: boolean);
get sessionsDonationInitiated(): boolean;
/**
* Updates the session.data with the latest data blob
*/
private updateSessionData;
/**
* Fetches data from a session
*/
setupSession(options: SetupSessionOptions): Promise;
/**
* Submits a session payment
*/
submitPayment(data: any): Promise;
/**
* Submits session payment additional details
*/
submitDetails(data: AdditionalDetailsData['data']): Promise;
/**
* Call donationCampaigns endpoint
*/
fetchDonationCampaigns(): Promise;
/**
* Call donations endpoint
*/
makeDonation(data: CheckoutSessionDonationsRequestData): Promise;
/**
* Checks the balance for a payment method
*/
checkBalance(data: any): Promise;
/**
* Creates an order for the current session
*/
createOrder(): Promise;
/**
* Cancels an order for the current session
*/
cancelOrder(data: onOrderCancelData): Promise;
/**
* Gets the stored session but only if the current id and the stored id match
*/
getStoredSession(): CheckoutSession;
/**
* Stores the session
*/
storeSession(): void;
/**
* Clears the stored session
*/
removeStoredSession(): void;
}
interface ICore {
initialize(): Promise;
register(...items: NewableComponent[]): void;
update(props: Partial, options?: {
shouldReinitializeCheckout?: boolean;
}): Promise;
remove(component: any): ICore;
submitDetails(details: AdditionalDetailsData['data']): void;
getCorePropsForComponent(): any;
getComponent(txVariant: string): NewableComponent | undefined;
createFromAction(action: PaymentAction, options?: any): UIElement;
storeElementReference(element: UIElement): void;
options: CoreConfiguration;
modules: CoreModules;
paymentMethodsResponse: PaymentMethods$1;
session?: Session;
}
type CoreModules = Readonly<{
risk: RiskElement;
analytics: IAnalytics;
resources: Resources;
i18n: Language;
srPanel: SRPanel;
}>;
type PaymentCompletedData = SessionsResponse | {
resultCode: ResultCode;
donationToken?: string;
};
type PaymentFailedData = SessionsResponse | {
resultCode: ResultCode;
};
type SubmitData = {
data: PaymentData;
isValid: boolean;
};
type SubmitActions = {
resolve: (response: CheckoutAdvancedFlowResponse) => void;
reject: (error?: Pick) => void;
};
type AdditionalDetailsData = {
data: {
details: {
redirectResult?: string;
threeDSResult?: string;
[key: string]: any;
};
paymentData?: string;
sessionData?: string;
};
};
type AdditionalDetailsActions = {
resolve: (response: CheckoutAdvancedFlowResponse) => void;
reject: () => void;
};
type BeforeSubmitActions = {
resolve: (data: PaymentData & {
billingAddress?: AddressData;
deliveryAddress?: AddressData;
shopperEmail?: string;
shopperName?: string;
}) => void;
reject: () => void;
};
type OnChangeData = {
data: PaymentData;
isValid: boolean;
valid?: {
[fieldKey: string]: boolean;
};
errors?: {
[fieldKey: string]: {
isValid: boolean;
errorMessage: string;
errorI18n: string;
error: string;
rootNode: HTMLElement;
};
};
};
interface CoreConfiguration {
/**
* The payment session object from your call to /sessions.
*/
session?: {
id: string;
sessionData?: string;
shopperEmail?: string;
telephoneNumber?: string;
};
/**
* Use 'test'. When you're ready to accept live payments, change the value to one of our {@link https://docs.adyen.com/checkout/drop-in-web#testing-your-integration | live environments}.
*/
environment?: 'test' | 'live' | 'live-us' | 'live-au' | 'live-apse' | 'live-in' | 'live-nea';
/**
* Show or hides a Pay Button for each payment method
* @default true
*/
showPayButton?: boolean;
/**
* A public key linked to your web service user, used for {@link https://docs.adyen.com/user-management/client-side-authentication | client-side authentication}.
*/
clientKey?: string;
/**
* The shopper's locale. This is used to set the language rendered in the UI.
* For a list of supported locales, see {@link https://docs.adyen.com/checkout/components-web/localization-components | Localization}.
* For adding a custom locale, see {@link https://docs.adyen.com/checkout/components-web/localization-components#create-localization | Create localization}.*
*/
locale?: string;
/**
* Custom translations and localizations
* See {@link https://docs.adyen.com/checkout/components-web/localization-components | Localizing Components}
*/
translations?: CustomTranslations;
/**
* The full `/paymentMethods` response
*/
paymentMethodsResponse?: PaymentMethodsResponse;
/**
* Amount of the payment
*/
amount?: PaymentAmount;
/**
* Secondary amount of the payment - alternative currency & value converted according to rate
*/
secondaryAmount?: PaymentAmount;
/**
* The shopper's country code. A valid value is an ISO two-character country code (e.g. 'NL').
*/
countryCode?: string;
/**
* Display only these payment methods
*/
allowPaymentMethods?: string[];
/**
* Never display these payment methods
*/
removePaymentMethods?: string[];
/**
* Screen Reader configuration
*/
srConfig?: SRPanelConfig;
analytics?: AnalyticsOptions;
risk?: RiskModuleOptions;
donation?: DonationOptions;
order?: Order;
/**
* Add @adyen/web metadata to the window object.
* It helps to identify version number and bundle type in the merchant environment
*
* @default true
*/
exposeLibraryMetadata?: boolean;
/**
* Called before the page redirect happens.
* Allows you to perform any sort of action before redirecting the shopper to another page.
*
* @param resolve
* @param reject
* @param redirectData
*/
beforeRedirect?(resolve: () => void, reject: () => void, redirectData: {
url: string;
method: string;
data?: any;
}): void;
/**
* Called when the shopper selects the Pay button (it only works on Sessions flow)
*
* Allows you to add details which will be sent in the payment request to Adyen's servers.
* For example, you can add shopper details like 'billingAddress', 'deliveryAddress', 'shopperEmail' or 'shopperName'
*
* @param state
* @param component
* @param actions
*/
beforeSubmit?(state: PaymentData, component: UIElement, actions: BeforeSubmitActions): Promise | void;
/**
* Called when the payment succeeds.
*
* The first parameter is the sessions response (when using sessions flow), or the result code.
*
* @param data
* @param component
*/
onPaymentCompleted?(data: PaymentCompletedData, component?: UIElement): void;
/**
* Called when the payment fails.
*
* The first parameter is populated when merchant is using sessions, or when the payment was rejected
* with an object. (Ex: 'action.reject(obj)' ). Otherwise, it will be empty.
*
* @param data - session response or resultCode. It can also be undefined if payment was rejected without argument ('action.reject()')
* @param component
*/
onPaymentFailed?(data?: PaymentFailedData, component?: UIElement): void;
/**
* Callback used in the Advanced flow to perform the /payments API call
*
* The payment response must be passed to the 'resolve' function, even if the payment wasn't authorized (Ex: resultCode = Refused).
* The 'reject' should be used only if a critical error occurred.
*
* @param state
* @param component
* @param actions
*/
onSubmit?(state: SubmitData, component: UIElement, actions: SubmitActions): void;
/**
* Callback used in the Advanced flow to perform the /payments/details API call.
*
* The payment response must be passed to the 'resolve' function, even if the payment wasn't authorized (Ex: resultCode = Refused).
* The 'reject' should be used only if a critical error occurred.
*
* @param state
* @param component - Component submitting details. It is undefined when using checkout.submitDetails()
* @param actions
*/
onAdditionalDetails?(state: AdditionalDetailsData, component: UIElement, actions: AdditionalDetailsActions): void;
/**
* Callback invoked when the user is redirected back, and an `action` is included in the response (either `/details` or `/paymentDetails`).
*
* The `action` from the response will be converted into a UIElement and passed to the callback.
* For the tree-shakable integration, register the components beforehand.
*
* @param component - The UIElement representing the action, which must be mounted on the page for the user to interact with.
* @internal - used by PBL
*/
afterAdditionalDetails?(component: UIElement): void;
/**
* Callback called when an action (for example a QR code or 3D Secure 2 authentication screen) is shown to the shopper.
*
* @param actionHandled
*/
onActionHandled?(actionHandled: ActionHandledReturnObject): void;
onChange?(state: OnChangeData, component: UIElement): void;
/**
* Callback called in two different scenarios:
* - when a critical error happened (network error; implementation error; script failed to load)
* - when the shopper cancels the payment flow in payment methods that have an overlay (GooglePay, PayPal, ApplePay)
*
* @param error
* @param component
*/
onError?(error: AdyenCheckoutError, component?: UIElement): void;
onBalanceCheck?: onBalanceCheckCallbackType;
onOrderRequest?: onOrderRequestCallbackType;
/**
* Called when a Component detects, or is told by a SecuredField, that the Enter key has been pressed.
* - merchant set config option
*/
onEnterKeyPressed?(activeElement: Element, component: UIElement): void;
/**
* Callback called when it is required to fetch/update the payment methods list.
* It is currently used mainly on Giftcard flow (Partial orders), since the payment method list might change depending on the amount left to be paid
*
* The /paymentMethods response must be passed to the 'resolve' function
*
* @param data
* @param actions
*/
onPaymentMethodsRequest?(data: PaymentMethodsRequestData, actions: {
resolve: (response: PaymentMethodsResponse) => void;
reject: () => void;
}): void;
onOrderCancel?: onOrderCancelType;
/**
* Called when the gift card balance is less than the transaction amount.
* Returns an Order object that includes the remaining amount to be paid.
* https://docs.adyen.com/payment-methods/gift-cards/web-component?tab=config-sessions_1
*/
onOrderUpdated?(data: {
order: Order;
}): void;
/**
* @internal
*/
loadingContext?: string;
/**
* Used internally in order to set different URL's instead of using the ones mapped in our codebase.
*
* @internal
*/
_environmentUrls?: {
api?: string;
analytics?: string;
cdn?: {
images?: string;
translations?: string;
};
};
}
declare abstract class BaseElement implements IBaseElement {
readonly _id: string;
readonly core: ICore;
props: P;
state: any;
_component: any;
protected _node: HTMLElement;
protected static readonly defaultProps: {};
constructor(checkout: ICore, props?: P);
protected buildElementProps(componentProps?: P): void;
/**
* Executed during creation of any payment element.
* Gives a chance to any paymentMethod to format the props we're receiving.
*/
protected formatProps(props: P): P;
/**
* Executed on the `data` getter.
* Returns the component data necessary for the /payments request
*/
protected formatData(): any;
protected submitAnalytics(analyticsObj?: AbstractAnalyticsEvent): any;
protected handleKeyPress(e: h.JSX.TargetedKeyboardEvent): any;
protected setState(newState: object): void;
/**
* Returns the component payment data ready to submit to the Checkout API
* Note: this does not ensure validity, check isValid first
*/
get data(): PaymentData;
/**
* Method used to make the payment method active
* (Useful when there are different payment methods available and activating one PM must trigger a specific task)
*/
activate(): void;
render(): ComponentChild | Error;
/**
* Mounts an element into the dom
* @param domNode - Node (or selector) where we will mount the payment element
* @returns this - the payment element instance we mounted
*/
mount(domNode: HTMLElement | string): this;
/**
* Updates props, resets the internal state and remounts the element.
*
* @param props - props to update
* @returns this - the element instance
*/
update(props: Partial): this;
/**
* Unmounts a payment element from the DOM
*/
unmount(): this;
/**
* Unmounts an element and removes it from the parent instance
* For "destroy" type cleanup - when you don't intend to use the component again
*/
remove(): void;
}
interface AmountProviderRef {
update(newAmount: PaymentAmount, newSecondaryAmount?: PaymentAmount): void;
}
declare abstract class UIElement
extends BaseElement
{
/**
* componentRef is a ref to the primary component inside the subclass that extends UIElement e.g. CardInput.tsx (which sits inside Card.tsx)
*/
protected componentRef: any;
protected resources: Resources;
/**
* elementRef is a ref to the subclass that extends UIElement e.g. Card.tsx or Dropin.tsx
*/
elementRef: UIElement;
static readonly type: string | undefined;
/**
* Reference to the methods exposed by the AmountProvider context
*/
protected amountProviderRef: RefObject;
/**
* Defines all txVariants that the Component supports (in case it support multiple ones besides the 'type' one)
*/
static readonly txVariants: string[];
constructor(checkout: ICore, props?: P);
/**
* Creates a hook tied to render() method. This hook is called every time render() is invoked.
* Currently useful for Analytics
*
* @param configSetByMerchant
* @private
*/
private createBeforeRenderHook;
protected beforeRender(configSetByMerchant?: P): void;
protected reportIntegrationFlavor(): void;
get analytics(): IAnalytics;
get srPanel(): SRPanel;
protected getPaymentMethodConfigFromResponse(componentProps: P): RawPaymentMethod;
protected buildElementProps(componentProps?: P): void;
protected getStoredPaymentMethodDetails(storedPaymentMethodId: string): StoredPaymentMethod;
/**
* Get the payment method from the paymentMethodsResponse
*
* @param type - The type of the payment method to get. (This prop is passed by Drop-in OR Standalone components containing the property 'type' as part of their configuration)
* @param paymentMethodId - Unique internal payment method ID
*/
protected getPaymentMethodFromPaymentMethodsResponse(type?: string, paymentMethodId?: string): RawPaymentMethod;
protected storeElementRefOnCore(props?: P): void;
isAvailable(): Promise;
setState(newState: object): void;
showValidation(): this;
/**
* Updates the amount in the props and propagates it to the AmountProvider.
* This allows children components to access the updated amount via context.
*
* @param amount - Primary payment amount object
* @param secondaryAmount - Optional secondary amount for display purposes (e.g., converted currency)
* @internal
*/
updateAmount(amount: PaymentAmount, secondaryAmount?: PaymentAmount): void;
/**
* Set status using elementRef, which:
* - If Drop-in, will set status for Dropin component, and then it will propagate the new status for the active payment method component
* - If Component, it will set its own status
*/
setElementStatus(status: UIElementStatus, props?: any): this;
/**
* componentRef is a ref to the primary component inside that subclass e.g. CardInput.tsx
*/
setStatus(status: UIElementStatus, props?: any): this;
protected onChange(): void;
protected submitAnalytics(event: AbstractAnalyticsEvent): void;
submit(): void;
protected makePaymentsCall(): Promise;
private submitUsingAdvancedFlow;
private submitUsingSessionsFlow;
protected onComplete(state: any): void;
protected handleError: (error: AdyenCheckoutError) => void;
protected handleAdditionalDetails(state: AdditionalDetailsData): void;
private makeAdditionalDetailsCall;
private submitAdditionalDetailsUsingSessionsFlow;
handleAction(action: PaymentAction, props?: {}): UIElement | null;
protected onActionHandled(actionHandledObj: ActionHandledReturnObject): void;
protected handleOrder: (response: PaymentResponseData) => void;
protected setupSessionsDonation(): void;
/**
* Handles when the payment fails. The payment fails when:
* - adv flow: the merchant rejects the payment due to a critical error
* - adv flow: the merchant resolves the payment with a failed resultCode
* - sessions: a network error occurs when making the payment
* - sessions: the payment fails with a failed resultCode
*
* @param result
*/
protected handleFailedResult: (result?: PaymentResponseData) => void;
protected handleSuccessResult: (result: PaymentResponseData) => void;
/**
* Handles a /payments or /payments/details response.
* The component will handle automatically actions, orders, and final results.
*
* Expected to be called after sanitizeResponse has been run on the raw payment response
*
* @param response -
*/
protected handleResponse(response: PaymentResponseData): void;
protected handleKeyPress(e: h.JSX.TargetedKeyboardEvent | KeyboardEvent): void;
/**
* Handle Enter key pressed from a UIElement (called via handleKeyPress)
* @param obj
*/
protected onEnterKeyPressed(activeElement: Element, component: UIElement): void;
/**
* Call update on parent instance
* This function exist to make safe access to the protected _parentInstance
* @param options - CoreOptions
*/
updateParent(options?: CoreConfiguration): Promise;
setComponentRef: (ref: ComponentMethodsRef) => void;
/**
* Get the current validation status of the element
*/
get isValid(): boolean;
/**
* Get the element icon URL for the current environment
*/
get icon(): string;
/**
* Get the element's displayable name
*/
get displayName(): string;
/**
* Get the element accessible name, used in the aria-label of the button that controls selected payment method
*/
get accessibleName(): string;
/**
* Used to display the second line of a payment method item
*/
get additionalInfo(): string;
/**
* Return the type of an element
*/
get type(): string;
/**
* Get the payButton component for the current element
*/
protected payButton: (props: PayButtonProps) => h.JSX.Element;
/**
* Used in the Partial Orders flow.
* When the Order is updated, the merchant can request new payment methods based on the new remaining amount
*
* @private
*/
protected handleAdvanceFlowPaymentMethodsUpdate(order: Order | null, amount?: PaymentAmount): Promise;
protected abstract componentToRender(): h.JSX.Element | null;
render(): h.JSX.Element;
}
type NewableComponent = new (checkout: ICore, props?: any) => UIElement;
interface IRegistry {
add(...items: NewableComponent[]): void;
getComponent(type: string): NewableComponent | undefined;
}
declare const actionTypes: {
readonly redirect: (core: ICore, registry: any, action: PaymentAction, props: UIElementProps) => UIElement;
readonly threeDS2: (core: ICore, registry: any, action: PaymentAction, props: ThreeDS2ActionProps) => UIElement;
readonly voucher: (core: ICore, registry: IRegistry, action: PaymentAction, props: UIElementProps) => UIElement;
readonly qrCode: (core: ICore, registry: IRegistry, action: PaymentAction, props: UIElementProps) => UIElement;
readonly await: (core: ICore, registry: IRegistry, action: PaymentAction, props: UIElementProps) => UIElement;
readonly bankTransfer: (core: ICore, registry: IRegistry, action: PaymentAction, props: UIElementProps) => UIElement;
readonly sdk: (core: ICore, registry: IRegistry, action: PaymentAction, props: UIElementProps) => UIElement;
};
type PaymentActionsType = keyof typeof actionTypes;
/**
* {@link https://docs.adyen.com/api-explorer/#/PaymentSetupAndVerificationService/v51/payments__resParam_action API Explorer /payments action}
*/
interface PaymentAction {
/**
* General type of action that needs to be taken by the client
*/
type: PaymentActionsType;
/**
* Refinement of type of action that needs to be taken by the client (currently only applies to the new 'threeDS2' type)
*/
subtype?: string;
/**
* Specifies the payment method.
*/
paymentMethodType: string;
/**
* When non-empty, contains a value that you must submit to the /payments/details endpoint. In some cases, required for polling.
*/
paymentData?: string;
authorisationToken?: string;
/**
* Specifies the HTTP method, for example GET or POST.
*/
method?: string;
/**
* Specifies the URL to redirect to.
*/
url?: string;
alternativeReference?: string;
downloadUrl?: string;
entity?: string;
expiresAt?: string;
instructionsUrl?: string;
issuer?: string;
maskedTelephoneNumber?: string;
merchantName?: string;
merchantReference?: string;
reference?: string;
shopperEmail?: string;
shopperName?: string;
qrCodeData?: string;
/**
* A token to pass to the 3DS2 Component to get the fingerprint/challenge.
*/
token?: string;
/**
* An object containing data to be used in external SDKs like PayPal Buttons SDK.
*/
sdkData?: {
[key: string]: any;
};
}
type Issuer = {
id: string;
name: string;
disabled?: boolean;
};
/**
* Raw payment method object returned in the /paymentMethods response.
*/
interface RawPaymentMethod {
/**
* The unique payment method code.
*/
type: string;
/**
* The displayable name of this payment method.
*/
name: string;
/**
* A list of issuers for this payment method.
*/
issuers?: Issuer[];
/**
* Configuration props as set by the merchant in the CA and received in the PM object in the /paymentMethods response
*/
configuration?: object;
/**
* Brand for the selected gift card. For example: plastix, hmclub.
*/
brand?: string;
/**
* List of possible brands. For example: visa, mc.
*/
brands?: string[];
/**
* The funding source of the payment method.
*/
fundingSource?: 'debit' | 'credit' | 'prepaid';
/**
* The group where this payment method belongs to.
*/
group?: PaymentMethodGroup;
}
/**
* List of the available payment methods
* {@link https://docs.adyen.com/api-explorer/Checkout/70/post/paymentMethods API Explorer /paymentMethods}.
*/
interface PaymentMethodsResponse {
/**
* Detailed list of payment methods required to generate payment forms.
*/
paymentMethods?: RawPaymentMethod[];
/**
* List of all stored payment methods.
*/
storedPaymentMethods?: RawStoredPaymentMethod[];
}
/**
* Raw stored payment method object returned in the /paymentMethods response.
*/
interface RawStoredPaymentMethod extends RawPaymentMethod {
id: string;
name: string;
supportedShopperInteractions: string[];
expiryMonth?: string;
expiryYear?: string;
holderName?: string;
iban?: string;
lastFour?: string;
networkTxReference?: string;
ownerName?: string;
shopperEmail?: string;
/** The shopper’s issuer account label */
label?: string;
}
/**
* The group where this payment method belongs to.
*/
interface PaymentMethodGroup {
/**
* The name of the group.
*/
name: string;
/**
* Echo data to be used if the payment method is displayed as part of this group.
*/
paymentMethodData: string;
/**
* The unique code of the group.
*/
type: string;
}
interface ProcessedPaymentStatusResponse {
type: string;
props?: Record;
}
interface PaymentAmount {
/**
* The payment amount in minor units for the specified `currency`.
*/
value: number;
/**
* The 3-letter ISO 4217 currency code.
*/
currency: string;
/**
* Influences how the currency is displayed on the pay button.
*
* This maps to `Intl.NumberFormat`'s `currencyDisplay` option (for example, `"symbol"`, `"code"`, `"name"`, `"narrowSymbol"`).
*
* @default 'symbol'
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#currencydisplay
*/
currencyDisplay?: string;
}
type AddressField = (typeof ADDRESS_SCHEMA)[number];
type AddressData = {
[key in AddressField]?: string;
};
interface PersonalDetailsSchema {
firstName?: string;
lastName?: string;
dateOfBirth?: string;
shopperEmail?: string;
telephoneNumber?: string;
}
interface Order {
/**
* The encrypted order data.
*/
orderData: string;
/**
* The pspReference that belongs to the order.
*/
pspReference: string;
/**
* The remaining amount to complete the order.
*/
remainingAmount?: PaymentAmount;
}
interface OrderStatus {
expiresAt: string;
paymentMethods: {
amount?: PaymentAmount;
lastFour?: string;
type: string;
name?: string;
label?: string;
}[];
pspReference: string;
reference: string;
remainingAmount: PaymentAmount;
}
/**
* {@link https://docs.adyen.com/api-explorer/#/PaymentSetupAndVerificationService/v52/post/payments__reqParam_browserInfo API Explorer /payments browserInfo}
*/
interface BrowserInfo {
acceptHeader: string;
colorDepth: number;
language: string;
javaEnabled: boolean;
screenHeight: number;
screenWidth: number;
userAgent: string;
timeZoneOffset: number;
}
/**
* Visibility options for a fieldset
*/
type FieldsetVisibility = 'editable' | 'hidden' | 'readOnly';
interface PaymentMethodData {
paymentMethod: {
[key: string]: any;
checkoutAttemptId?: string;
};
browserInfo?: BrowserInfo;
}
/**
* Represents the payment data that will be submitted to the /payments endpoint
*/
interface PaymentData extends PaymentMethodData {
riskData?: {
clientData: string;
};
order?: {
orderData: string;
pspReference: string;
};
clientStateDataIndicator: boolean;
sessionData?: string;
storePaymentMethod?: boolean;
billingAddress?: AddressData;
deliveryAddress?: AddressData;
}
type ResultCode = 'AuthenticationFinished' | 'AuthenticationNotRequired' | 'Authorised' | 'Cancelled' | 'ChallengeShopper' | 'Error' | 'IdentifyShopper' | 'PartiallyAuthorised' | 'Pending' | 'PresentToShopper' | 'Received' | 'RedirectShopper' | 'Refused';
type SessionsResponse = {
sessionData: string;
sessionResult: string;
resultCode: ResultCode;
};
interface PaymentMethodsRequestData {
order?: Order;
locale?: string;
countryCode?: string;
}
interface CheckoutAdvancedFlowResponse {
resultCode: ResultCode;
action?: PaymentAction;
order?: Order;
donationToken?: string;
error?: {
googlePayError?: google.payments.api.PaymentDataError | string;
applePayError?: ApplePayJS.ApplePayError[] | ApplePayJS.ApplePayError;
};
}
interface PaymentResponseData {
resultCode: ResultCode;
type?: string;
action?: PaymentAction;
sessionData?: string;
sessionResult?: string;
order?: Order;
donationToken?: string;
askDonation?: boolean;
}
type RawPaymentResponse = PaymentResponseData & CheckoutAdvancedFlowResponse & {
[key: string]: any;
};
type RawPaymentStatusResponse = Pick & {
payload?: string | null;
};
/**
* onActionHandled is called for all actions:
* - qrcode
* - await
* - threeds2
* - redirect
* - sdk
* - voucher
* - bankTransfer
*/
type ActionDescriptionType = 'qr-code-loaded' | 'polling-started' | '3DS2 fingerprint iframe loaded' | '3DS2 challenge iframe loaded' | 'performing-redirect' | 'voucher-presented' | 'sdk-loaded';
interface ActionHandledReturnObject {
componentType: string;
actionDescription: ActionDescriptionType;
originalAction?: PaymentAction;
}
type ComponentFocusObject = {
fieldType: string;
event: Event | CardFocusData;
};
type DecodeObject = {
success: boolean;
error?: string;
data?: string;
};
type PaymentMethodBrand = {
icon: string;
name: string;
};
type PlaceholderKeys = 'holderName' | 'cardNumber' | 'expiryDate' | 'expiryMonth' | 'expiryYear' | 'securityCodeThreeDigits' | 'securityCodeFourDigits' | 'password';
type FundingSourceKeys = 'credit' | 'debit' | 'prepaid';
type CardPlaceholders = Partial>;
interface CardConfiguration extends UIElementProps {
/**
* Automatically shift the focus from one field to another. Usually happens from a valid Expiry Date field to the Security Code field,
* but some BINS also allow us to know that the PAN is complete, in which case we can shift focus to the date field
* @defaultValue `true`
*
* - merchant set config option
*/
autoFocus?: boolean;
/**
* Config t olimit the countries that will show in the country dropdown
* - merchant set config option
*/
billingAddressAllowedCountries?: string[];
/**
* If billingAddressRequired is set to true, you can set this to partial to require the shopper's postal code instead of the full address.
* @defaultValue full
*
* - merchant set config option
*/
billingAddressMode?: 'full' | 'partial' | 'none';
/**
* Show Address fields
* @defaultValue `false`
*
* - merchant set config option
*/
billingAddressRequired?: boolean;
/**
* Config to specify which address field are required
* - merchant set config option
*/
billingAddressRequiredFields?: string[];
/**
* Only set for a stored card,
* brand is never set for a generic card component OR a single-branded card
* @internal
*/
brand?: string;
/**
* List of brands accepted by the component
* @internal
* - but can also be overwritten by merchant config option
*/
brands?: string[];
/**
* Configuration specific to brands
* - merchant set config option
*/
brandsConfiguration?: CardBrandsConfiguration;
/**
* Defines the size of the challenge Component
*
* 01: [250px, 400px]
* 02: [390px, 400px]
* 03: [500px, 600px]
* 04: [600px, 400px]
* 05: [100%, 100%]
*
* @defaultValue '02'
*
* - merchant set config option
*/
challengeWindowSize?: ChallengeWindowSize;
/**
* Configuration for Click to Pay
* - merchant set config option
*/
clickToPayConfiguration?: ClickToPayProps;
/**
* Configuration for displaying the Fastlane consent UI.
*/
fastlaneConfiguration?: FastlaneSignupConfiguration;
/**
* An object sent in the /paymentMethods response
* @internal
*/
configuration?: CardBackendConfiguration;
/**
* Mostly used in relation to KCP cards
* @internal
*/
countryCode?: string;
/**
* Object that contains placeholder information that you can use to prefill fields.
* - merchant set config option
*/
data?: {
holderName?: string;
billingAddress?: Partial;
};
/**
* Disable Click to Pay for testing purposes
* @defaultValue false
* @internal
*/
_disableClickToPay?: boolean;
/**
* Turn on the procedure to force the arrow keys on an iOS soft keyboard to always be disabled
* @defaultValue `false`
*
* - merchant set config option
*/
disableIOSArrowKeys?: boolean;
/**
* Object to configure the message and text for a disclaimer message, added after the Card input fields
* - merchant set config option
*/
disclaimerMessage?: DisclaimerMsgObject;
/**
* Allow binLookup process to occur
* @defaultValue `true`
*
* - merchant set config option
*/
doBinLookup?: boolean;
/**
* Config option related to whether we set storePaymentMethod in the card data, and showing/hiding the "store details" checkbox
* - merchant set config option
*/
enableStoreDetails?: boolean;
/**
* Comes from Stored payment method object
* @internal
*/
expiryMonth?: string;
/**
* Allows SF to return an unencrypted expiryDate
* - merchant set config option
*/
exposeExpiryDate?: boolean;
/**
* Force securedFields to use the 'compat' version of JWE. (Use case: running custom http:// test environment
* - merchant set config option
*/
forceCompat?: boolean;
/**
* Funding source field populated when 'splitCardFundingSources' is configured in `sessions/` call
* This value is automatically set in Drop-in integration. For standalone integration, it can be set manually.
* When provided, it ensures the component loads configuration specific to that funding source (e.g. credit, debit, prepaid)
* - merchant set config option
*/
fundingSource?: FundingSourceKeys;
/**
* Decides whether the CVC (Security Code) component will even be rendered.
* Always true except when hideCVC set to false by merchant OR in the case of a *stored* BCMC card.
* (For the Bancontact card comp this is set to true since dual-branding possibilities mean the BCMC card can now end up needing to show a CVC field)
* @internal
*/
hasCVC?: boolean;
/**
* Show/hide the card holder name field
* - merchant set config option
*/
hasHolderName?: boolean;
/**
* holderName coming from a stored card in /paymentMethods response
* @internal
*/
holderName?: string;
/**
* Show/hide the Security Code field
* - merchant set config option
*/
hideCVC?: boolean;
/**
* Whether the card holder name field will be required
* - merchant set config option
*/
holderNameRequired?: boolean;
/**
* Relates to storedCards
* @internal
*/
id?: string;
/**
* Configure the installment options for the card
* - merchant set config option
*/
installmentOptions?: InstallmentOptions;
/**
* Implements a workaround for iOS/Safari bug where keypad doesn't retract when SF paymentMethod is no longer active
* @defaultValue `true`
*
* - merchant set config option
*/
keypadFix?: boolean;
/**
* Related to storedCards - this information comes from the storedCardData once we process it
* @internal
*/
lastFour?: string;
/**
* For some scenarios make the card input fields (PAN, Expiry Date, Security Code) have type="tel" rather than type="text" inputmode="numeric"
* @defaultValue `false`
*
* - merchant set config option
*/
legacyInputMode?: boolean;
/**
* Adds type="password" to the Security code input field, causing its value to be masked
* @defaultValue `false`
*
* - merchant set config option
*/
maskSecurityCode?: boolean;
/**
* Specify the minimum expiry date that will be considered valid
*
* - merchant set config option
*/
minimumExpiryDate?: string;
/**
* When in Dropin this is the name shown in the paymentMethods list
* @defaultValue - derived from PaymentMethods response
* @internal - but can also be overwritten by merchant config option
*/
name?: string;
/**
* Function used to perform 3rd party Address lookup
* - merchant set config option
*/
onAddressLookup?: OnAddressLookupType;
/**
* Function used to handle the selected address from 3rd party Address lookup
* - merchant set config option
*/
onAddressSelected?: OnAddressSelectedType;
/**
* After binLookup call - provides the brand(s) we detect the user is entering, and if we support the brand(s)
* - merchant set config option
*/
onBinLookup?: (event: CardBinLookupData) => void;
/**
* Provides the BIN Number of the card (up to 6 digits), called as the user types in the PAN.
* - merchant set config option
*/
onBinValue?: (event: CardBinValueData) => void;
/**
* Called when a field loses focus.
* - merchant set config option
*/
onBlur?: (event: CardFocusData | ComponentFocusObject) => void;
/**
* Called once we detect the card brand.
* - merchant set config option
*/
onBrand?: (event: CardBrandData) => void;
/**
* Called once the card input fields are ready to use.
* - merchant set config option
*/
onConfigSuccess?: (event: CardConfigSuccessData) => void;
/**
* Called when *all* the securedFields becomes valid
* Also called again if one of the fields moves out of validity.
*/
onAllValid?: (event: CardAllValidData) => void;
/**
* Called when a field becomes valid and also if a valid field changes and becomes invalid.
* For the card number field, it returns the last 4 digits of the card number.
* - merchant set config option
*/
onFieldValid?: (event: CardFieldValidData) => void;
/**
* Called when a field gains focus.
* - merchant set config option
*/
onFocus?: (event: CardFocusData | ComponentFocusObject) => void;
/**
* Called once all the card input fields have been created but are not yet ready to use.
* - merchant set config option
*/
onLoad?: (event: CardLoadData) => void;
/**
* Configure placeholder text for holderName, cardNumber, expirationDate, securityCode and password.
* - merchant set config option
*/
placeholders?: CardPlaceholders;
/**
* Position holder name above card number field (instead of having it after the security code field)
* @defaultValue `false`
*
* - merchant set config option
*/
positionHolderNameOnTop?: boolean;
/**
* Show/hide the brand logo when the card brand has been recognized
* @defaultValue `true`
*
* - merchant set config option
*/
showBrandIcon?: boolean;
/**
* Show/Hide contextual element next to the logo
* @defaultValue true
*
* - merchant set config option
*/
showContextualElement?: boolean;
/**
* Set whether to show installments broken down into amounts or months
* @defaultValue `true`
*
* - merchant set config option
*/
showInstallmentAmounts?: boolean;
/**
* Related to storedCards - this information comes from the storedCardData once we process it
* @internal
*/
storedPaymentMethodId?: string;
/**
* Show/hide the "store details" checkbox
* @internal
*/
showStoreDetailsCheckbox?: boolean;
/**
* Object to configure the styling of the inputs in the iframes that are used to present the PAN, Expiry Date & Security Code fields
* - merchant set config option
*/
styles?: StylesObject;
/**
* Relates to storedCards and the type of interactions they support e.g. "Ecommerce", "ContAuth" etc
* @internal
*/
supportedShopperInteractions?: string[];
/**
* For the PAN field: If the card number is now at one of it's valid lengths and the formatting process has added a separator
* to the end of the string... delete the separator
* - merchant set config option. Defaults to true
*/
trimTrailingSeparator?: boolean;
/**
* type will always be "card" (generic card, stored card)
* except for a single branded card when it will be the same as the brand prop
* @internal
*/
type?: string;
}
type SocialSecurityMode = 'show' | 'hide' | 'auto';
/** If the merchant wishes to set any of these properties in their local config they should do so via a "configuration" object */
interface CardBackendConfiguration {
visaSrciDpaId?: string;
visaSrcInitiatorId?: string;
mcSrcClientId?: string;
mcDpaId?: string;
merchantIdentifier?: string;
merchantOrigin?: string;
gatewayMerchantId?: string;
publicKeyId?: string;
region?: string;
merchantName?: string;
merchantId?: string;
intent?: string;
koreanAuthenticationRequired?: boolean;
socialSecurityNumberMode?: SocialSecurityMode;
icon?: string;
brandsConfiguration?: CardBrandsConfiguration;
}
interface BrandConfiguration {
name?: string;
icon?: string;
}
interface CardBrandsConfiguration {
[key: string]: BrandConfiguration;
}
interface CardPaymentMethodData {
type: string;
brand?: string;
storedPaymentMethodId?: string;
fundingSource?: FundingSourceKeys;
holderName?: string;
encryptedCardNumber?: string;
encryptedExpiryMonth?: string;
encryptedExpiryYear?: string;
encryptedSecurityCode?: string;
}
interface CardElementData {
paymentMethod: CardPaymentMethodData;
billingAddress?: AddressData;
installments?: {
value: number;
};
storePaymentMethod?: boolean;
browserInfo: BrowserInfo;
origin?: string;
}
interface BrandObject {
brand: string;
localeBrand?: string;
cvcPolicy: CVCPolicyType;
enableLuhnCheck: boolean;
showExpiryDate?: boolean;
expiryDatePolicy?: DatePolicyType;
showSocialSecurityNumber?: boolean;
supported: boolean;
brandImageUrl?: string;
panLength?: number;
paymentMethodVariant?: string;
}
interface BinLookupResponseRaw {
requestId: string;
issuingCountryCode?: string;
brands?: BrandObject[];
showSocialSecurityNumber?: boolean;
status: number;
errorCode: string;
message: string;
errorType: string;
}
/**
* Mapped & simplified version of BinLookupResponseRaw
*/
interface BinLookupResponse {
issuingCountryCode: string;
showSocialSecurityNumber?: boolean;
supportedBrands?: BrandObject[];
isDualBrandSelection?: boolean;
}
interface DualBrandSelectElement {
id: string;
brandObject: BrandObject;
}
interface DualBrandButtons {
id: string;
name: string;
imageURL: string;
altName: string;
}
type DualBrandingChangeHandler = (brandValue: string) => void;
declare class CardElement extends UIElement {
static readonly type: TxVariants;
private readonly clickToPayService;
/**
* Reference to the 'ClickToPayComponent'
*/
private clickToPayRef;
constructor(checkout: ICore, props?: CardConfiguration);
protected static readonly defaultProps: any;
setStatus(status: UIElementStatus, props?: any): this;
private setClickToPayRef;
protected getPaymentMethodConfigFromResponse(componentProps: CardConfiguration): RawPaymentMethod;
formatProps(props: CardConfiguration): CardConfiguration;
/**
* Formats the component data output
*/
formatData(): CardElementData;
protected beforeRender(configSetByMerchant?: CardConfiguration): void;
updateStyles(stylesObj: any): this;
setFocusOn(fieldName: any): this;
onBrand: (event: any) => void;
processBinLookupResponse(binLookupResponse: BinLookupResponse, isReset?: boolean): this;
handleUnsupportedCard(errObj: any): this;
private handleClickToPaySubmit;
onBinLookup(obj: CardBinLookupData): void;
private onConfigSuccess;
private onFocus;
private onBlur;
onBinValue: (callbackObj: CardBinValueData) => void;
get storePaymentMethodPayload(): {
storePaymentMethod?: undefined;
} | {
storePaymentMethod: boolean;
};
get isValid(): boolean;
get icon(): string;
get brands(): PaymentMethodBrand[];
get displayName(): string;
get accessibleName(): string;
get browserInfo(): BrowserInfo;
protected payButton: (props: PayButtonProps) => h.JSX.Element;
private renderCardInput;
protected componentToRender(): h.JSX.Element;
}
declare class ThreeDS2Challenge extends UIElement {
static readonly type = TxVariants.threeDS2Challenge;
static readonly defaultProps: {
dataKey: string;
size: string;
type: string;
};
protected beforeRender(): void;
protected onActionHandled: (rtnObj: ActionHandledReturnObject) => void;
/**
* Will make a call to onAdditionalDetails (as set in actionTypes.ts) for the regular, "native" flow.
* However, if the action to create this component came from the 3DS2InMDFlow process it will instead equal a call to the onComplete callback
* (as defined in the 3DS2InMDFlow and passed in as a config prop).
*/
onComplete(state: LegacyChallengeResolveData | ChallengeResolveData): void;
protected componentToRender(): h.JSX.Element;
}
declare class ThreeDS2DeviceFingerprint extends UIElement {
static readonly type = TxVariants.threeDS2Fingerprint;
static readonly defaultProps: {
dataKey: string;
type: string;
};
private callSubmit3DS2Fingerprint;
protected beforeRender(): void;
protected onActionHandled: (rtnObj: ActionHandledReturnObject) => void;
/**
* Can be called directly from PrepareFingerprint (MDFlow) or after the call to /submitThreeDS2Fingerprint endpoint (native flow)
*/
onComplete(state: LegacyFingerprintResolveData | FingerprintResolveData): void;
protected componentToRender(): h.JSX.Element;
}
declare class OnlineBankingFI extends IssuerListContainer {
static readonly type = "ebanking_FI";
}
declare class PayMeElement extends QRLoaderContainer {
static readonly type = "payme";
private static readonly defaultCountdown;
private static readonly defaultDelay;
formatProps(props: any): {
delay: number;
countdownTime: number;
throttleTime?: number;
throttleInterval?: number;
type?: string;
brandLogo?: string;
buttonLabel: string;
qrCodeImage?: string;
qrCodeData?: string;
paymentData?: string;
redirectIntroduction: string;
timeToPay: string;
copyBtn?: boolean;
introduction: string | (() => preact.JSX.Element);
instructions: string | (() => preact.JSX.Element);
paymentMethodId?: string;
storedPaymentMethodId?: string;
order?: Order;
modules?: {
srPanel?: SRPanel;
analytics?: IAnalytics;
resources?: Resources;
risk?: RiskElement;
};
isDropin?: boolean;
donation?: DonationOptions;
onPaymentCompleted?: (data: PaymentCompletedData, component?: UIElement) => void;
onPaymentFailed?: (data?: PaymentFailedData, component?: UIElement) => void;
beforeRedirect?: (resolve: () => void, reject: () => void, redirectData: {
url: string;
method: string;
data?: any;
}) => void;
beforeSubmit?: (state: PaymentData, component: UIElement, actions: BeforeSubmitActions) => Promise | void;
onSubmit?: (state: SubmitData, component: UIElement, actions: SubmitActions) => void;
onActionHandled?: (actionHandled: ActionHandledReturnObject) => void;
onAdditionalDetails?: (state: AdditionalDetailsData, component: UIElement, actions: AdditionalDetailsActions) => void;
onChange?: (state: OnChangeData, component: UIElement) => void;
onEnterKeyPressed?: (activeElement: Element, component: UIElement) => void;
onError?: (error: AdyenCheckoutError, component?: UIElement) => void;
onOrderUpdated?: (data: {
order: Order;
}) => void;
onPaymentMethodsRequest?: (data: PaymentMethodsRequestData, actions: {
resolve: (response: PaymentMethodsResponse) => void;
reject: () => void;
}) => void;
environment?: string;
session?: Session;
onComplete?: (state: any, element: UIElement) => void;
isInstantPayment?: boolean;
isStoredPaymentMethod?: boolean;
oneClick?: boolean;
statusType?: StatusFromAction;
name?: string;
icon?: string;
amount?: PaymentAmount;
secondaryAmount?: PaymentAmount;
showPayButton?: boolean;
payButton?: (options: PayButtonProps) => preact.JSX.Element;
loadingContext?: string;
createFromAction?: (action: PaymentAction, props: object) => UIElement;
clientKey?: string;
elementRef?: any;
i18n?: Language;
label?: string;
paymentMethodType?: string;
originalAction?: PaymentAction;
};
}
declare class DropinElement extends UIElement implements IDropin {
static readonly type = TxVariants.dropin;
protected static readonly defaultProps: DropinConfiguration;
dropinRef: any;
private paymentMethodsConfiguration;
/**
* Reference to the component created from `handleAction` (Ex.: ThreeDS2Challenge)
*/
componentFromAction?: UIElement;
/**
* Reference to all payment method elements being rendered by Drop-in
*/
paymentMethodElements: UIElement[];
constructor(checkout: ICore, props?: DropinConfiguration);
protected reportIntegrationFlavor(): void;
protected storeElementRefOnCore(): void;
formatProps(props: any): {
instantPaymentTypes: InstantPaymentTypes[];
paymentMethodsConfiguration?: PaymentMethodsConfiguration;
paymentMethodComponents?: NewableComponent[];
order?: Order;
showStoredPaymentMethods?: boolean;
disableFinalAnimation?: boolean;
showPaymentMethods?: boolean;
openPaymentMethod?: {
type: string;
};
openFirstStoredPaymentMethod?: boolean;
openFirstPaymentMethod?: boolean;
onReady?(): void;
filterStoredPaymentMethods?(storedPaymentMethods: RawStoredPaymentMethod[]): RawStoredPaymentMethod[];
onSelect?(paymentMethod: UIElement): void;
showRemovePaymentMethodButton?: boolean;
showRadioButton?: boolean;
onDisableStoredPaymentMethod?: (storedPaymentMethod: any, resolve: any, reject: any) => void;
paymentMethodId?: string;
storedPaymentMethodId?: string;
modules?: {
srPanel?: SRPanel;
analytics?: IAnalytics;
resources?: Resources;
risk?: RiskElement;
};
isDropin?: boolean;
donation?: DonationOptions;
onPaymentCompleted?: (data: PaymentCompletedData, component?: UIElement) => void;
onPaymentFailed?: (data?: PaymentFailedData, component?: UIElement) => void;
beforeRedirect?: (resolve: () => void, reject: () => void, redirectData: {
url: string;
method: string;
data?: any;
}) => void;
beforeSubmit?: (state: PaymentData, component: UIElement, actions: BeforeSubmitActions) => Promise | void;
onSubmit?: (state: SubmitData, component: UIElement, actions: SubmitActions) => void;
onActionHandled?: (actionHandled: ActionHandledReturnObject) => void;
onAdditionalDetails?: (state: AdditionalDetailsData, component: UIElement, actions: AdditionalDetailsActions) => void;
onChange?: (state: OnChangeData, component: UIElement) => void;
onEnterKeyPressed?: (activeElement: Element, component: UIElement) => void;
onError?: (error: AdyenCheckoutError, component?: UIElement) => void;
onOrderUpdated?: (data: {
order: Order;
}) => void;
onPaymentMethodsRequest?: (data: PaymentMethodsRequestData, actions: {
resolve: (response: PaymentMethodsResponse) => void;
reject: () => void;
}) => void;
environment?: string;
session?: Session;
onComplete?: (state: any, element: UIElement) => void;
isInstantPayment?: boolean;
isStoredPaymentMethod?: boolean;
oneClick?: boolean;
statusType?: StatusFromAction;
type?: string;
name?: string;
icon?: string;
amount?: PaymentAmount;
secondaryAmount?: PaymentAmount;
showPayButton?: boolean;
payButton?: (options: PayButtonProps) => h.JSX.Element;
loadingContext?: string;
createFromAction?: (action: PaymentAction, props: object) => UIElement;
clientKey?: string;
elementRef?: any;
i18n?: Language;
label?: string;
paymentMethodType?: string;
originalAction?: PaymentAction;
};
get isValid(): boolean;
showValidation(): this;
setStatus(status: any, props?: {}): this;
get activePaymentMethod(): any;
get data(): any;
displayFinalAnimation(type: 'success' | 'error'): void;
/**
* Calls the onSubmit event with the state of the activePaymentMethod
*/
submit(): void;
/**
* Updates the amount in the props and propagates it to the AmountProvider. That way the children components can use the updated amount.
*
* This method **overrides** the parent one to specifically propagate the changes to all payment method elements.
*
* @param amount - Primary payment amount object
* @param secondaryAmount - Optional secondary amount for display purposes (e.g., converted currency)
* @internal
*/
updateAmount(amount: PaymentAmount, secondaryAmount?: PaymentAmount): void;
/**
* Assign all elements created in the Component to the paymentMethodElements property
* @param elements
*/
private handleElementsCreated;
/**
* Creates the Drop-in elements
*/
private handleCreate;
handleAction(action: PaymentAction, props?: {}): this | null;
/**
* handleOrder is implemented so we don't trigger a callback like in the components
* @param response - PaymentResponse
*/
protected handleOrder: ({ order }: PaymentResponseData) => void;
closeActivePaymentMethod(): void;
protected handleKeyPress(e: h.JSX.TargetedKeyboardEvent | KeyboardEvent): void;
protected onEnterKeyPressed(activeElement: Element, component: UIElement): void;
protected componentToRender(): h.JSX.Element;
}
/**
* Exposing UI Components derived by UIElement
*/
/** Card */
type index_d_Affirm = Affirm;
declare const index_d_Affirm: typeof Affirm;
type index_d_AfterPay = AfterPay;
declare const index_d_AfterPay: typeof AfterPay;
type index_d_AfterPayB2B = AfterPayB2B;
declare const index_d_AfterPayB2B: typeof AfterPayB2B;
type index_d_Atome = Atome;
declare const index_d_Atome: typeof Atome;
type index_d_CashAppPay = CashAppPay;
declare const index_d_CashAppPay: typeof CashAppPay;
type index_d_CustomCard = CustomCard;
declare const index_d_CustomCard: typeof CustomCard;
type index_d_Fastlane = Fastlane;
declare const index_d_Fastlane: typeof Fastlane;
type index_d_GooglePay = GooglePay;
declare const index_d_GooglePay: typeof GooglePay;
type index_d_Iris = Iris;
declare const index_d_Iris: typeof Iris;
type index_d_OnlineBankingFI = OnlineBankingFI;
declare const index_d_OnlineBankingFI: typeof OnlineBankingFI;
type index_d_OnlineBankingPL = OnlineBankingPL;
declare const index_d_OnlineBankingPL: typeof OnlineBankingPL;
type index_d_PayByBank = PayByBank;
declare const index_d_PayByBank: typeof PayByBank;
type index_d_PayByBankUS = PayByBankUS;
declare const index_d_PayByBankUS: typeof PayByBankUS;
type index_d_PreAuthorizedDebitCanada = PreAuthorizedDebitCanada;
declare const index_d_PreAuthorizedDebitCanada: typeof PreAuthorizedDebitCanada;
type index_d_RatePay = RatePay;
declare const index_d_RatePay: typeof RatePay;
type index_d_RatePayDirectDebit = RatePayDirectDebit;
declare const index_d_RatePayDirectDebit: typeof RatePayDirectDebit;
type index_d_Riverty = Riverty;
declare const index_d_Riverty: typeof Riverty;
type index_d_ThreeDS2Challenge = ThreeDS2Challenge;
declare const index_d_ThreeDS2Challenge: typeof ThreeDS2Challenge;
type index_d_ThreeDS2DeviceFingerprint = ThreeDS2DeviceFingerprint;
declare const index_d_ThreeDS2DeviceFingerprint: typeof ThreeDS2DeviceFingerprint;
type index_d_UPI = UPI;
declare const index_d_UPI: typeof UPI;
declare namespace index_d {
export {
ANCVElement as ANCV,
AchElement as Ach,
AddressElement as Address,
index_d_Affirm as Affirm,
index_d_AfterPay as AfterPay,
index_d_AfterPayB2B as AfterPayB2B,
AmazonPayElement as AmazonPay,
ApplePayElement as ApplePay,
index_d_Atome as Atome,
BacsElement as BacsDirectDebit,
BancontactElement as Bancontact,
BankTransferElement as BankTransfer,
BCMCMobileElement as BcmcMobile,
BillDeskOnlineElement as BillDeskOnline,
BillDeskWalletElement as BillDeskWallet,
BlikElement as Blik,
BoletoElement as Boleto,
CardElement as Card,
index_d_CashAppPay as CashAppPay,
ClickToPayElement as ClickToPay,
index_d_CustomCard as CustomCard,
DokuElement as Doku,
DonationElement as Donation,
DotpayElement as Dotpay,
DragonpayElement as Dragonpay,
DropinElement as Dropin,
DuitNowElement as DuitNow,
EPSElement as EPS,
EcontextElement as Econtext,
FacilyPay10x as FacilPay10x,
FacilyPay12x as FacilPay12x,
FacilyPay3x as FacilPay3x,
FacilyPay4x as FacilPay4x,
FacilyPay6x as FacilPay6x,
index_d_Fastlane as Fastlane,
GiftcardElement as Giftcard,
GiropayElement as Giropay,
index_d_GooglePay as GooglePay,
index_d_Iris as Iris,
KlarnaPayments as Klarna,
MBWayElement as MBWay,
MealVoucherFRElement as MealVoucherFR,
MolPayEBankingMYElement as MolPayEBankingMY,
MolPayEBankingTHElement as MolPayEBankingTH,
MolPayEbankingVNElement as MolPayEBankingVN,
MultibancoElement as Multibanco,
OnlineBankingCZElement as OnlineBankingCZ,
index_d_OnlineBankingFI as OnlineBankingFI,
OnlineBankingINElement as OnlineBankingIN,
index_d_OnlineBankingPL as OnlineBankingPL,
OnlineBankingSKElement as OnlineBankingSK,
OxxoElement as Oxxo,
index_d_PayByBank as PayByBank,
PayByBankPixElement as PayByBankPix,
index_d_PayByBankUS as PayByBankUS,
PayMeElement as PayMe,
PayNowElement as PayNow,
PaypalElement as PayPal,
PayToElement as PayTo,
PayuNetCashcardElement as PayuCashcard,
PayuNetBankingElement as PayuNetBanking,
PersonalDetailsElement as PersonalDetails,
PixElement as Pix,
index_d_PreAuthorizedDebitCanada as PreAuthorizedDebitCanada,
PromptPayElement as PromptPay,
index_d_RatePay as RatePay,
index_d_RatePayDirectDebit as RatePayDirectDebit,
RedirectElement as Redirect,
index_d_Riverty as Riverty,
SepaElement as SepaDirectDebit,
SwishElement as Swish,
index_d_ThreeDS2Challenge as ThreeDS2Challenge,
index_d_ThreeDS2DeviceFingerprint as ThreeDS2DeviceFingerprint,
TrustlyElement as Trustly,
TwintElement as Twint,
index_d_UPI as UPI,
VippsElement as Vipps,
WalletINElement as WalletIN,
WeChatPayElement as WeChat,
};
}
declare class FastlaneSDK {
private readonly clientKey;
private readonly checkoutShopperURL;
private readonly fastlaneLocale;
private readonly forceConsentDetails;
private readonly analytics;
private fastlaneSdk?;
private latestShopperDetails?;
private fastlaneSessionId?;
constructor(configuration: FastlaneSDKConfiguration);
/**
* Initializes the Fastlane SDK
*/
initialize(): Promise;
destroy(): void;
/**
* Triggers the authentication for Fastlane using shopper's email.
* If shopper is recognized, the OTP flow is initialized.
*
* @param email
*/
authenticate(email: string): Promise;
/**
* Creates the Component configuration based on the Fastlane authentication result.
*
* In case the shopper authenticated successfully, it returns config to be used in the Fastlane component
* Otherwise, it returns the configuration to be used in the Card component
*
* @param authResult
*/
getComponentConfiguration(authResult: FastlaneAuthenticatedCustomerResult): Promise;
/**
* Displays the Fastlane Shipping Address selector UI
*/
showShippingAddressSelector(): Promise;
/**
* Render the "Fastlane by PayPal" logo in the specified HTML container
*/
mountWatermark(container: HTMLElement | string, options?: {
includeAdditionalInfo: boolean;
}): Promise;
private requestClientToken;
private fetchSdk;
/**
* Fetch the fastlane session ID used internally by PayPal for Network Token Usage event
* This ID is not critical for the payment processing part
*
* @private
*/
private fetchSessionIdAsync;
/**
* Fetch object containing that details that will be used to display the sign-up UI
* inside the card component
* @private
*/
private fetchConsentDetails;
private initializeFastlaneInstance;
/**
* Creates the configuration for the Fastlane component
*
* @param authResult
* @private
*/
private createFastlaneComponentConfiguration;
/**
* Creates the configuration for the Card component, including Fastlane sign-up details if available
*
* @private
*/
private createCardComponentConfiguration;
private trackEvent;
private handlePageVisibilityChanges;
/**
* Returns the Info event subtype based on the 'authenticationState'
* @param authenticationState
* @private
*/
private getOtpAnalyticsSubtype;
}
declare function initializeFastlane(configuration: FastlaneSDKConfiguration): Promise;
declare class Core implements ICore {
session?: Session;
paymentMethodsResponse: PaymentMethods$1;
modules: CoreModules;
options: CoreConfiguration;
analyticsContext: string;
loadingContext: string;
cdnImagesUrl: string;
cdnTranslationsUrl: string;
private components;
static readonly metadata: {
version: string;
bundleType: string;
};
static readonly registry: {
componentsMap: Record;
supportedTxVariants: Set;
add(...items: NewableComponent[]): void;
getComponent(type: string): NewableComponent | undefined;
createComponentsMap(components: NewableComponent[]): {};
};
static setBundleType(type: string): void;
static register(...items: NewableComponent[]): void;
/**
* Used internally by the PaymentMethod components to auto-register themselves
* @internal
*/
register(...items: NewableComponent[]): void;
getComponent(txVariant: string): NewableComponent;
constructor(props: CoreConfiguration);
initialize(): Promise;
private initializeCore;
private validateCoreConfiguration;
/**
* Method used when handling redirects. It submits details using 'onAdditionalDetails' or the Sessions flow if available.
*
* @public
* @see {https://docs.adyen.com/online-payments/build-your-integration/?platform=Web&integration=Components&version=5.55.1#handle-the-redirect}
* @param details - Details object containing the redirectResult
*/
submitDetails(details: AdditionalDetailsData['data']): void;
private readonly afterAdditionalDetails;
/**
* Instantiates a new element component ready to be mounted from an action object
*
* @param action - action defining the component with the component data
* @param options - options that will be merged to the global Checkout props
* @returns new UIElement
*/
createFromAction(action: PaymentAction, options?: {}): UIElement;
/**
* Updates global configurations, resets the internal state and remounts each element.
*
* @param props - props to update
* @param options - Can be used to avoid remounting the elements
* @returns this - the Core instance
*/
update(props?: Partial>, { shouldReinitializeCheckout }?: {
shouldReinitializeCheckout?: boolean;
}): Promise;
/**
* Validates and propagates amount updates to all mounted components.
*
* @param amount - Primary payment amount object (required)
* @param secondaryAmount - Optional secondary amount for display purposes (e.g., converted currency)
* @internal
*/
private triggerAmountUpdate;
/**
* Remove the reference of a component
* @param component - reference to the component to be removed
* @returns this - the element instance
* // TODO: Do we need this?
*/
remove: (component: any) => this;
/**
* @internal
* Create or update the config object passed when AdyenCheckout is initialised (environment, clientKey, etc...)
*/
private setOptions;
/**
* @internal
* @returns props for a new UIElement
*/
getCorePropsForComponent(): any;
storeElementReference(element: UIElement): void;
/**
* @internal
*/
private handleCreateError;
private createPaymentMethodsList;
private createCoreModules;
/**
* Retrieve the parsed locale from the i18n module and assigns it to the core options.
*/
private assignLocaleToCore;
/**
* Request translations to the CDN. If an error occurs, it will be logged to the console in development mode.
*/
private requestTranslations;
private requestAnalyticsAttemptId;
}
declare function AdyenCheckout(props: CoreConfiguration): Promise;
declare namespace AdyenCheckout {
var register: (...items: (new (checkout: ICore, props: any) => UIElement)[]) => void;
var setBundleType: (type: string) => void;
}
export { ANCVElement as ANCV, AchElement as Ach, AddressElement as Address, AdyenCheckout, AdyenCheckoutError, Affirm, AfterPay, AfterPayB2B, AmazonPayElement as AmazonPay, ApplePayElement as ApplePay, Atome, BacsElement as BacsDirectDebit, BancontactElement as Bancontact, BankTransferElement as BankTransfer, BCMCMobileElement as BcmcMobile, BillDeskOnlineElement as BillDeskOnline, BillDeskWalletElement as BillDeskWallet, BlikElement as Blik, BoletoElement as Boleto, CardElement as Card, CashAppPay, ClickToPayElement as ClickToPay, Core, CustomCard, DokuElement as Doku, DonationElement as Donation, DotpayElement as Dotpay, DragonpayElement as Dragonpay, DropinElement as Dropin, DuitNowElement as DuitNow, EPSElement as EPS, EcontextElement as Econtext, FacilyPay10x as FacilPay10x, FacilyPay12x as FacilPay12x, FacilyPay3x as FacilPay3x, FacilyPay4x as FacilPay4x, FacilyPay6x as FacilPay6x, Fastlane, FastlaneSDK, GiftcardElement as Giftcard, GiropayElement as Giropay, GooglePay, Iris, IrisMode, KlarnaPayments as Klarna, MBWayElement as MBWay, MealVoucherFRElement as MealVoucherFR, MolPayEBankingMYElement as MolPayEBankingMY, MolPayEBankingTHElement as MolPayEBankingTH, MolPayEbankingVNElement as MolPayEBankingVN, MultibancoElement as Multibanco, OnlineBankingCZElement as OnlineBankingCZ, OnlineBankingFI, OnlineBankingINElement as OnlineBankingIN, OnlineBankingPL, OnlineBankingSKElement as OnlineBankingSK, OxxoElement as Oxxo, PayByBank, PayByBankPixElement as PayByBankPix, PayByBankUS, PayMeElement as PayMe, PayNowElement as PayNow, PaypalElement as PayPal, PayToElement as PayTo, PayuNetCashcardElement as PayuCashcard, PayuNetBankingElement as PayuNetBanking, PersonalDetailsElement as PersonalDetails, PixElement as Pix, PreAuthorizedDebitCanada, PromptPayElement as PromptPay, RatePay, RatePayDirectDebit, RedirectElement as Redirect, Riverty, SepaElement as SepaDirectDebit, SwishElement as Swish, ThreeDS2Challenge, ThreeDS2DeviceFingerprint, TrustlyElement as Trustly, TwintElement as Twint, UIElement, UPI, VippsElement as Vipps, WalletINElement as WalletIN, WeChatPayElement as WeChat, index_d as components, initializeFastlane };
export type { ANCVConfiguration, ANCVDataState, AchConfiguration, AchPlaceholders, ActionDescriptionType, ActionHandledReturnObject, AdditionalDetailsActions, AdditionalDetailsData, AddressData, AddressField, AmazonPayBackendConfiguration, AmazonPayButtonProps, AmazonPayButtonSettings, AmazonPayComponentProps, AmazonPayConfiguration, AmazonPayElementData, AmazonWindowObject, App, ApplePayButtonStyle, ApplePayButtonType, ApplePayConfiguration, ApplePayElementData, ApplePayPaymentAuthorizationResult, ApplePayPaymentOrderDetails, ApplePaySessionRequest, ApplePayWebConfiguration, AwaitComponentProps, AwaitConfiguration, BankDetailsSchema, BankTransferConfiguration, BankTransferSchema, BankTransferState, BeforeSubmitActions, BinLookupResponse, BinLookupResponseRaw, BoletoConfiguration, BoletoElementProps, BoletoInputDataState, BoletoInputErrorState, BoletoInputValidState, BrandConfiguration, BrandObject, BrowserInfo, CReqData, CardAllValidData, CardAutoCompleteData, CardBackendConfiguration, CardBinLookupData, CardBinValueData, CardBrandData, CardBrandsConfiguration, CardConfigSuccessData, CardConfiguration, CardElementData, CardErrorData, CardFieldValidData, CardFocusData, CardLoadData, CardPlaceholders, CashAppPayConfiguration, CashAppPayElementData, CashAppPayEventData, ChallengeData, ChallengeResolveData, ChallengeWindowSize, ChangeActionOptions, ChangePaymentDetailsButtonProps, ChargeAmount, CheckoutAdvancedFlowResponse, CheckoutDetailsRequest, CheckoutSession, CheckoutSessionConfig, ClickToPayConfiguration, ClickToPayPaymentData, ClickToPayProps, ClickToPayScheme, CommonVoucherProps, ComponentFocusObject, ComponentMethodsRef, CoreConfiguration, CoreModules, Currency, CustomCardConfiguration, CustomTranslations, DecodeObject, DeliverySpecifications, DokuVoucherResultProps, DonationCampaign, DonationCampaignOptions, DonationConfiguration, DonationOptions, DonationProps, DragonpayConfiguraton, DragonpayInputData, DragonpayInputIssuerItem, DragonpayInputProps, DragonpayVoucherResultProps, DropinComponentProps, DropinComponentState, DropinConfiguration, DropinStatus, DropinStatusProps, DualBrandButtons, DualBrandSelectElement, DualBrandingChangeHandler, EcontextConfiguration, EcontextInputSchema, EcontextVoucherResultProps, ErrorCodeObject, ExtendedMerchantInfo, FastlaneAddress, FastlaneAuthenticatedCustomerResult, FastlaneConfiguration, FastlaneConsentRenderState, FastlaneData, FastlaneOptions, FastlanePaymentMethodConfiguration, FastlaneProfile, FastlaneSDKConfiguration, FastlaneShipping, FastlaneShippingAddressSelectorResult, FastlaneSignupConfiguration, FastlaneWindowInstance, FieldsetVisibility, FingerPrintData, FingerprintResolveData, FundingSource, FundingSourceKeys, GiftCardBalanceCheckErrorType, GiftCardConfiguration, GiftCardElementData, GiftCardValidationError, GooglePayConfiguration, GooglePaymentDataRequest, ICore, IDropin, InstantPaymentTypes, Intent, IrisConfiguration, IrisData, IrisState, IssuerListConfiguration, IssuerListData, KlarnaAction, KlarnaAdditionalDetailsData, KlarnaComponentRef, KlarnaConfiguration, KlarnaSdkData, KlarnaWidgetAuthorizeResponse, KlarnaWidgetProps, LedgerCurrencies, LegacyChallengeResolveData, LegacyFingerprintResolveData, MandateFrequencyType, MandateType, OnChangeData, OpenInvoiceActiveFieldsets, OpenInvoiceConfiguration, OpenInvoiceFieldsetsRefs, OpenInvoiceProps, OpenInvoiceStateData, OpenInvoiceStateError, OpenInvoiceStateValid, OpenInvoiceVisibility, Order, OrderButtonProps, OrderStatus, PayPalConfiguration, PayToConfiguration, PayToData, PayToPlaceholdersType, PayloadJSON, PaymentAction, PaymentActionsType, PaymentAmount, PaymentCompletedData, PaymentData, PaymentFailedData, PaymentMethodBrand, PaymentMethodData, PaymentMethodGroup, PaymentMethodOptions, PaymentMethods, PaymentMethodsConfiguration, PaymentMethodsRequestData, PaymentMethodsResponse, PaymentResponseData, PersonalDetailsSchema, PixConfiguration, PixElementData, PostMsgParseErrorObject, PreAuthorizedDebitCanadaConfiguration, PreAuthorizedDebitCanadaPlaceholders, ProcessedPaymentStatusResponse, QRLoaderConfiguration, RawPaymentMethod, RawPaymentResponse, RawPaymentStatusResponse, RawStoredPaymentMethod, RecurringMetadata, RedirectConfiguration, Region, ResultCode, ResultObject, ResultValue, SepaConfiguration, SepaElementData, SessionsResponse, SignOutButtonProps, SocialSecurityMode, StatusFromAction, SubmitActions, SubmitData, SupportedLocale, SupportedPayPalFundingSources, ThreeDS2ActionProps, ThreeDS2ChallengeConfiguration, ThreeDS2ConfigProps, ThreeDS2DeviceFingerprintConfiguration, ThreeDS2FingerprintResponse, ThreeDS2FlowObject, ThreeDS2FlowProps, ThreeDS2Token, UIElementProps, UIElementStatus, UPIAppList, UPIConfiguration, UpdateAmazonCheckoutSessionRequest, UpiMode, UpiPaymentData, UpiType, ValidationError, VoucherConfiguration, VoucherDetail, VoucherProps, balanceCheckResponseType, onBalanceCheckCallbackType, onOrderCancelData, onOrderCancelType, onOrderRequestCallbackType, onRequiringConfirmationCallbackType };