import { components } from '@amos.com/node'; import { Appearance, ApplePayButtonElementProps, ConfirmPaymentResult, ConfirmSetupResult, GooglePayButtonElementProps, Message, PaymentMethodFormDefaultValues, PaymentMethodFormField } from './types'; type Iframe = HTMLIFrameElement | null | undefined; /** * Resolve the Amos embed origin from an iframe's configured `src`. * * Integrators are expected to set `src` via the SDK's `get*Src` helpers * before calling messaging functions. */ export declare function getIframeTargetOrigin(iframe: HTMLIFrameElement): string; /** * Notify the embedded iframe that the host page is ready to receive * messages. The SDK calls this internally after receiving an * `IFRAME_READY` event from the iframe. */ export declare function sendParentReadyMessage(iframe: Iframe): void; /** * Push appearance overrides into the embedded iframe. * * Uses a replace model for `themeVariables`, `fonts`, and `rules`: each * message that includes those keys sets the full override set. Omit a * key to leave the previous value unchanged. Pass `fonts: []` or * `rules: {}` to clear. * * Card, bank, and wallet listeners send Inter (`fonts` + * `--font-family`) on the first handshake when the merchant omitted * them. This function posts the payload as given. */ export declare function updateAppearance({ iframe, appearance, }: { iframe: Iframe; appearance?: Appearance; }): void; /** * Push name and billing-address defaults into the embedded card or bank * iframe. Provided keys overwrite matching form fields, including ones * the customer already edited. Omitted keys are left as-is. */ export declare function updateDefaultValues({ iframe, defaultValues, }: { iframe: Iframe; defaultValues?: PaymentMethodFormDefaultValues; }): void; /** * Focus a named control inside the embedded card or bank iframe. * * No-op if the iframe is not ready, the field is not rendered (for * example hidden cardholder name, or street fields in `country` billing * mode), or Plaid Embedded Institution Search is showing instead of * the bank form. Call from a user-gesture handler; some browsers * ignore focus that is not tied to a click or keydown. */ export declare function focusField({ iframe, field, }: { iframe: Iframe; field: PaymentMethodFormField; }): void; /** * Push Apple Pay button visual options and contact flags into the * embedded iframe. */ export declare function updateApplePayButton({ iframe, props, height, phoneRequired, shippingAddressRequired, }: { iframe: Iframe; props: ApplePayButtonElementProps; height?: string; phoneRequired?: boolean; shippingAddressRequired?: boolean; }): void; /** * Push Google Pay button visual options and contact flags into the * embedded iframe. */ export declare function updateGooglePayButton({ iframe, props, height, phoneRequired, shippingAddressRequired, }: { iframe: Iframe; props: GooglePayButtonElementProps; height?: string; phoneRequired?: boolean; shippingAddressRequired?: boolean; }): void; /** * Push the express-checkout amount into the embedded wallet iframe. * `amount` is a major-currency decimal string (e.g. `"50.00"` for $50.00). */ export declare function updateAmount({ iframe, amount, }: { iframe: Iframe; amount: string; }): void; /** * Push the user-visible merchant name into the embedded Google Pay * iframe. */ export declare function updateMerchantName({ iframe, merchantName, }: { iframe: Iframe; merchantName: string; }): void; /** * Ask the embedded credit-card or bank-account iframe form to validate * its inputs. * * 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({ iframe }: { iframe: Iframe; }): Promise; /** * Ask the bank iframe to mint a Plaid Link token (`POST /plaid_link_tokens` * on embed). Resolves with `link_token`, or rejects on error / timeout. */ export declare function requestPlaidLinkToken({ iframe, }: { iframe: Iframe; }): Promise; /** * Clear all field values and API errors in the embedded credit-card or * bank-account iframe form. */ export declare function resetForm({ iframe }: { iframe: Iframe; }): void; /** * Confirm a payment intent in the embedded iframe flow. * * Pass the embed JWT (`token`) returned by your server's * `POST /payment_intents` call. The matching `payment_intent_id` is * extracted from the JWT payload and forwarded to the iframe. * * Optional `defaultValues` are applied immediately before building the * payment method payload (including hidden name and extra billing * fields). They do not replace the last mount/`update` defaults used by * {@link resetForm}. * * Resolves `{ status: "succeeded", paymentIntent }` after processor * authorization, `{ status: "failed", paymentIntent? }` on decline, or * `{ status: "failed", error: "timeout" }` if the iframe does not post * `CONFIRMATION_RESULT` within {@link CONFIRM_TIMEOUT_MS} (15s; embed * `/confirm` aborts at 10s). A timeout is not a decline — the charge * may still settle; do not retry as a new payment. * Capture may still finish asynchronously. */ export declare function confirmPayment({ iframe, token, defaultValues, }: { iframe: Iframe; defaultValues?: PaymentMethodFormDefaultValues; } & Pick): Promise; /** * Confirm a setup intent in the embedded iframe flow. * * Pass the embed JWT (`token`) returned by your server's * `POST /setup_intents` call. The matching `setup_intent_id` is * extracted from the JWT payload and forwarded to the iframe. * * Optional `defaultValues` are applied immediately before building the * payment method payload. They do not replace the last mount/`update` * defaults used by {@link resetForm}. * * Resolves `{ status: "succeeded", setupIntent }` after verification, * `{ status: "failed", setupIntent? }` on decline, or * `{ status: "failed", error: "timeout" }` if the iframe does not post * `CONFIRMATION_RESULT` within {@link CONFIRM_TIMEOUT_MS}. Same * uncertain-vs-decline rule as {@link confirmPayment}. */ export declare function confirmSetup({ iframe, token, defaultValues, }: { iframe: Iframe; defaultValues?: PaymentMethodFormDefaultValues; } & Pick): Promise; /** * Notify the iframe that confirmation finished with a failure (used by * wallet `onConfirm` when creating the payment intent rejects). */ export declare function sendConfirmationResult({ iframe, result, }: { iframe: Iframe; result: Extract["result"]; }): void; export {};