UNPKG

dodopayments-checkout

Version:

A TypeScript library for embedding Dodo Payments checkout (overlay and inline).

31 lines (29 loc) 980 B
/** * Core checkout functionality */ import { CheckoutConfig, OpenCheckoutOptions, DisplayType, CheckoutOptions, DodoCheckoutWebSDK } from "./types"; declare global { interface Window { DodoCheckoutWebSDK?: DodoCheckoutWebSDK; } } /** * Initialize the checkout SDK with configuration */ export declare function initializeCheckout(config: CheckoutConfig): void; /** * Open checkout iframe with specified options */ export declare function openCheckout(options: OpenCheckoutOptions): void; /** * Check if checkout is currently open */ export declare function isCheckoutOpen(): boolean; /** * Build checkout URL by adding /overlay or /inline after .com for session and payment link URLs * * @param url - The checkout URL to process * @returns The processed URL with /overlay or /inline path * @throws Error if URL format is invalid */ export declare function buildCheckoutUrl(url: string, displayType?: DisplayType, options?: CheckoutOptions): string;