import type { BillingAdapter } from "./types.js"; export interface CompleteCheckoutOptions { /** * The org the payment belongs to. Omit for the SIGNUP case, where the workspace does not * exist until this returns — the caller creates it from `metadata` and then calls again (or * passes `attachTo`). */ orgId?: string; /** * Whether the address typed at checkout should STAY as the workspace's billing address. * * Default true, which is Stripe's own behaviour and what most purchases mean. `false` * restores whatever was there before, from the values `createCheckoutSession` carried on * the session — see the note above for why it cannot simply be prevented. */ keepBillingAddress?: boolean; /** The plan this session was buying, when the catalogue cannot be reached from the price. */ plan?: string | null; } export interface CompleteCheckoutResult { paid: boolean; customerId: string | null; subscriptionId: string | null; /** What the session was created with — a workspace name, the user it belongs to. */ metadata: Record; /** "subscription" | "payment" | "setup". */ mode: string | null; /** The plan recorded on the org, when this was a subscription purchase. */ plan: string | null; /** Steps that did not complete. Non-empty means finish by hand: the payment SUCCEEDED, so * this is never a reason to refuse the customer what they bought. */ warnings: string[]; } /** * Verify a Checkout Session and record everything that follows from it. * * Safe to call twice — every step is idempotent (the customer pointer is only written when * absent, the metadata write is the same value, the mirror is the same plan), which matters * because a return URL is a page a browser reloads. */ export declare function completeCheckout(adapter: BillingAdapter, sessionId: string, opts?: CompleteCheckoutOptions): Promise; //# sourceMappingURL=complete-checkout.d.ts.map