/** * Apple Pay branding for the inline wallet element. EARLY ACCESS. * * These fields are deliberately NOT declared on `CheckoutOptions` and this * module is deliberately NOT re-exported from `index.ts`. `index.ts` does * `export * from "./types"`, so anything added there would land in the * published `dist/types/index.d.ts` and advertise the feature to every * merchant. Selected merchants get a separate augmentation file instead. * * Only the inline display type uses this. Overlay renders no wallet element in * the merchant page, so there is nothing to brand. * * Two sources feed it, server first: * * 1. The `checkout.keys_provided` message from the checkout page. Those * values come from the checkout session, so the server attests them. * 2. `DodoPayments.Checkout.open({ options })` on the merchant page. Client * set, so a page controls what it says about its own product. * * Source 1 wins field by field. Source 1 is dormant until the checkout page * starts sending the block; nothing here breaks in the meantime. */ export type ApplePayButtonType = "plain" | "buy" | "set-up" | "donate" | "check-out" | "book" | "subscribe" | "reload" | "add-money" | "top-up" | "order" | "rent" | "support" | "contribute" | "tip"; export interface ApplePayRecurringConfig { /** Product name for the line item, e.g. "10 image gen credits". Leave the * billing period out; Apple prints it beside the amount. */ label: string; /** Where the buyer manages or cancels. Apple requires it. */ managementUrl: string; description?: string; billingAgreement?: string; intervalUnit?: "year" | "month" | "day" | "hour" | "minute"; intervalCount?: number; } /** One row above the total. Names what the buyer is paying for on a one-time * charge; a subscription names its product through `applePayRecurring`. */ export interface ApplePayLineItemConfig { label: string; /** Major-unit string, e.g. "11.99". Omit it for a single row and the * authorized total is used. Required once there are two or more rows. */ amount?: string; } export interface ApplePayBranding { merchantName?: string; applePayButtonType?: ApplePayButtonType; applePayLineItems?: ApplePayLineItemConfig[]; applePayRecurring?: ApplePayRecurringConfig; } /** * Pulls a branding block out of an untyped source, keeping only well-formed * values. The Dodo SDK validates the button type against its own list and * drops a malformed recurring block, so this only has to reject shapes that * are not worth forwarding. * * Accepts both camelCase (merchant page) and snake_case (checkout page). */ export declare function pickApplePayBranding(source: unknown): ApplePayBranding; /** Set from the merchant's `open()` options. Cleared on each open. */ export declare function setMerchantApplePayBranding(source: unknown): void; export declare function clearApplePayBranding(): void; /** * Merges the server block over the merchant block, field by field, and returns * only the keys that have a value. The result is spread straight into * `elements()`, so an empty object leaves the SDK's own defaults alone. */ export declare function resolveApplePayBranding(serverSource?: unknown): ApplePayBranding;