import { components } from '@amos.com/node'; import { ConfirmPaymentResult, GooglePayButtonElementProps, WalletContactRequirements, WalletCustomerCreateAttributes } from './types'; /** * Build the iframe `src` URL for the embedded Google Pay button. */ export declare function getGooglePayButtonSrc(renderToken: string): string; /** * Default iframe pixel height for the Google Pay button. */ export declare function getGooglePayButtonInitialHeight(): string; /** * Options accepted by {@link attachGooglePayButtonListeners}. */ export type GooglePayButtonListenerOptions = WalletContactRequirements & { /** * 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; /** A user-visible merchant name. */ merchantName: string; /** * Painted Google Pay 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. Compact: `buttonSizeMode: "static"` and * `style.width`. */ buttonProps?: GooglePayButtonElementProps; /** * Called whenever the iframe asks the host page to resize it. Update * the iframe's `height` style here. */ onHeightChange?: (height: string) => void; /** * Called once the iframe has applied the requested appearance and is * ready to be revealed. */ onAppearanceReady?: () => void; /** * Called when the iframe posts `IFRAME_READY` (embed JS is running). */ onIframeReady?: () => void; /** * Called when the buyer authorizes in the Google Pay sheet. Create a * payment intent on your server, then `await confirmPayment(token)`. * `customerCreateAttributes` is {@link WalletCustomerCreateAttributes}, * not Amos `CreateCustomerInput`. */ onConfirm: ({ paymentIntentCreateAttributes, customerCreateAttributes, confirmPayment, }: { paymentIntentCreateAttributes: components["schemas"]["CreatePaymentIntentInput"]; customerCreateAttributes: WalletCustomerCreateAttributes; confirmPayment: (token: string) => Promise; }) => Promise; }; /** * Controller returned by {@link attachGooglePayButtonListeners} and * {@link mountAmosGooglePayButton}. */ export type GooglePayButtonController = { /** * Update one or more listener options without re-attaching the * message listener. Pass `amount` or `merchantName` to push the new * value into the iframe; pass `height`, `buttonProps`, * `phoneRequired`, or `shippingAddressRequired` to restyle the Google * Pay button or change sheet contact fields. */ update: (patch: Partial) => void; /** * Detach the iframe message listener. */ destroy: () => void; }; /** * Wire up the host-page side of the Google Pay iframe message protocol * on an existing `