///
import { Appearance, ApplePayButtonElementProps, BillingAddressRequirement, ConfirmPaymentResult, ConfirmSetupResult, CreditCardAdditionalFields, GooglePayButtonElementProps, PaymentMethodFormDefaultValues, PaymentMethodFormField, WalletCustomerCreateAttributes } from '@amos.com/amos-js';
import { components } from '@amos.com/node';
import { ComponentProps, Ref, RefObject } from 'react';
export * from '@amos.com/amos-js';
type IframeRef = RefObject | undefined;
/**
* Validate the embedded card/bank iframe form before payment
* confirmation.
*
* Resolves to `true` if the form is valid, `false` if it is not, or
* `false` if the iframe does not respond within 5 seconds.
*/
export declare function validateForm({ iframeRef, }: {
iframeRef: IframeRef;
}): Promise;
/**
* Confirm a payment intent in the embedded iframe flow.
*
* Pass the embed JWT (`token`) returned by your server's
* `POST /payment_intents` call.
*
* Resolves `{ status: "succeeded", paymentIntent }` after authorization,
* `{ status: "failed", paymentIntent? }` on decline, or
* `{ status: "failed", error: "timeout" }` if the iframe does not post
* `CONFIRMATION_RESULT` within 15 seconds (`CONFIRM_TIMEOUT_MS`). Use
* `isConfirmTimeout(result)` — a timeout is not a decline; the charge
* may still settle. Embed `/confirm` aborts at 10s and posts the same
* timeout result.
*/
export declare function confirmPayment({ iframeRef, token, defaultValues, }: {
iframeRef: IframeRef;
defaultValues?: PaymentMethodFormDefaultValues;
} & Pick): Promise;
/**
* Confirm a setup intent in the embedded iframe flow. Use this when
* saving a payment method for future use.
*
* Pass the embed JWT (`token`) returned by your server's
* `POST /setup_intents` call.
*
* Resolves `{ status: "succeeded", setupIntent }` after verification,
* `{ status: "failed", setupIntent? }` on decline, or
* `{ status: "failed", error: "timeout" }` if the iframe does not
* respond within 15 seconds. Same `isConfirmTimeout` rule as
* {@link confirmPayment}.
*/
export declare function confirmSetup({ iframeRef, token, defaultValues, }: {
iframeRef: IframeRef;
defaultValues?: PaymentMethodFormDefaultValues;
} & Pick): Promise;
/**
* Clear all field values and API errors in the embedded card/bank iframe
* form. Call after a failed confirm when the customer wants to try again.
*/
export declare function resetForm({ iframeRef }: {
iframeRef: IframeRef;
}): void;
/**
* Focus a named control inside the embedded card/bank iframe. No-op if
* the field is not rendered, or while Plaid Embedded Institution Search
* is showing. Call from a click or keydown handler.
*/
export declare function focusField({ iframeRef, field, }: {
iframeRef: IframeRef;
field: PaymentMethodFormField;
}): void;
type ForwardedIframeRef = Ref | undefined;
type IframePassthroughProps = Omit, "src" | "title" | "name" | "role" | "allow">;
type PostalCodeChangeHandler = (event: {
postalCode: string | null;
country: string;
}) => void;
type AmosCreditCardPaymentMethodFormProps = IframePassthroughProps & {
renderToken: string;
appearance?: Appearance;
/**
* Called when form validity changes. `isValid` is true when all
* required fields are present and valid. Does not include PCI data.
*/
onValidityChange?: (event: {
isValid: boolean;
}) => void;
/**
* Called when the detected card brand changes. `brand` is the matched
* network, or `null` when the field is empty or the digits do not
* match a known brand. Does not include PCI data.
*/
onCardBrandChanged?: (event: {
brand: "visa" | "mastercard" | "amex" | "discover" | "diners" | "jcb" | null;
}) => void;
/**
* Called when the customer commits a billing postal code, or clears
* one. `postalCode` is null when a finished code becomes incomplete.
* Incomplete keystrokes and `defaultValues` writes are omitted.
*/
onPostalCodeChange?: PostalCodeChangeHandler;
/**
* Called when the customer presses Escape in the iframe. PCI-safe —
* no field values. Use this to close a host modal that contains the
* iframe. Not fired while an iframe dropdown or address suggestion
* list is open, or while Plaid Embedded Institution Search is
* showing.
*/
onEscapeKeyPressed?: () => void;
additionalFields?: CreditCardAdditionalFields;
billingAddressRequirement?: BillingAddressRequirement;
/**
* Seed cardholder name and billing address. Provided keys overwrite
* matching fields, including ones the customer already edited. Values
* are sent on confirm even when those inputs are hidden.
*/
defaultValues?: PaymentMethodFormDefaultValues;
};
export declare function AmosCreditCardPaymentMethodForm({ ref, renderToken, appearance, onValidityChange, onCardBrandChanged, onPostalCodeChange, onEscapeKeyPressed, additionalFields, billingAddressRequirement, defaultValues, style, ...rest }: AmosCreditCardPaymentMethodFormProps): import('react').JSX.Element;
type AmosBankAccountPaymentMethodFormProps = IframePassthroughProps & {
renderToken: string;
appearance?: Appearance;
/**
* Called when form validity changes. `isValid` is true when all
* required fields are present and valid, or when Plaid Embedded Link
* has returned credentials. Does not include PCI data.
*/
onValidityChange?: (event: {
isValid: boolean;
}) => void;
/**
* Called when the customer presses Escape in the iframe. PCI-safe —
* no field values. Use this to close a host modal that contains the
* iframe. Not fired while an iframe dropdown or address suggestion
* list is open, or while Plaid Embedded Institution Search is
* showing.
*/
onEscapeKeyPressed?: () => void;
/**
* Called when the customer commits a billing postal code, or clears
* one. `postalCode` is null when a finished code becomes incomplete.
* Incomplete keystrokes and `defaultValues` writes are omitted.
*/
onPostalCodeChange?: PostalCodeChangeHandler;
billingAddressRequirement?: BillingAddressRequirement;
/**
* Seed account holder name and billing address. Provided keys
* overwrite matching fields, including ones the customer already
* edited.
*/
defaultValues?: PaymentMethodFormDefaultValues;
/**
* When true, hide the routing/account iframe and mount Plaid Embedded
* Institution Search in the parent. A 350px pulse skeleton covers the
* slot until Plaid's `onLoad` (1.5s fallback). Ignored when `intent`
* is `"setup"` (setup always shows Plaid) or when the render token
* disables verification.
*
* Changing this prop hides or shows Link; it does not remount the
* bank form or destroy the Embedded handler.
*
* @default false
*/
requireAchVerification?: boolean;
/**
* `"setup"` saves a bank account for later charges and always shows
* Plaid (unless the render token disables verification). `"payment"`
* uses {@link AmosBankAccountPaymentMethodFormProps.requireAchVerification}.
*
* @default "payment"
*/
intent?: "payment" | "setup";
};
export declare function AmosBankAccountPaymentMethodForm({ ref, renderToken, appearance, onValidityChange, onPostalCodeChange, onEscapeKeyPressed, billingAddressRequirement, defaultValues, requireAchVerification, intent, style, ...rest }: AmosBankAccountPaymentMethodFormProps): import('react').JSX.Element;
type AmosGooglePayButtonProps = {
ref?: ForwardedIframeRef;
renderToken: string;
/**
* Major-currency decimal string shown in the Google Pay sheet
* (e.g. `"50.00"` for $50.00). Converted to cents in
* `paymentIntentCreateAttributes.amount`.
*/
amount: string;
merchantName: string;
/**
* Painted button height. CSS length (e.g. `"48px"`).
* @default "48px"
*/
height?: string;
/**
* Native Google Pay button attributes and inner style. Omitted
* fields keep Amos paint defaults (`buttonType: "plain"`,
* `buttonSizeMode: "fill"`). The button fills the iframe — size the
* mount slot, not the button.
*/
buttonProps?: GooglePayButtonElementProps;
/**
* Collect a phone number in the Google Pay sheet.
* @default false
*/
phoneRequired?: boolean;
/**
* Collect a shipping postal address. Name, email, and billing
* address are always required.
* @default false
*/
shippingAddressRequired?: boolean;
/** Props applied to the host-page `