/** * Donation checkout types — supports inline price_data so apps don't * need pre-created Stripe products. Zero Stripe Dashboard setup needed. */ /** A named donation tier with fixed amount and optional recurrence. */ interface DonationTier { /** Unique key for the tier (e.g., 'fan', 'referee', 'gold_patron'). */ id: string; /** Display name (e.g., 'Gold Patron'). */ name: string; /** Description shown to the user and on the Stripe receipt. */ description: string; /** Amount in the smallest currency unit (e.g., 300 = $3.00 USD). */ amountCents: number; /** Whether this tier recurs monthly. Default: false (one-time). */ recurring?: boolean; } /** Options for creating a donation checkout session. */ interface DonationCheckoutOptions { /** * Either a tier ID (resolved from the tiers map) or 'custom'. * When 'custom', `customAmountCents` must be provided. */ tier: string; /** Amount in cents for custom donations. Required when tier is 'custom'. */ customAmountCents?: number; /** Whether a custom donation should recur monthly. Default: false. */ customRecurring?: boolean; /** URL to redirect to on successful checkout. */ successUrl: string; /** URL to redirect to on cancelled checkout. */ cancelUrl: string; /** Additional metadata to attach to the Stripe session. */ metadata?: Record; /** Existing Stripe customer ID (optional). */ customerId?: string; /** Allow Stripe promo codes. Default: true. */ allowPromotionCodes?: boolean; /** Collect billing address. Default: 'auto'. */ billingAddressCollection?: 'auto' | 'required'; } /** Result of a successful donation checkout session creation. */ interface DonationCheckoutResult { /** The Stripe checkout session ID. */ sessionId: string; /** The URL to redirect the user to for payment. */ url: string | null; } export type { DonationTier as D, DonationCheckoutOptions as a, DonationCheckoutResult as b };