import { s as PaymentGatewayAdapter } from "../payment.adapter-BOT9T6jQ.js"; //#region src/adapters/lemonsqueezy.adapter.d.ts interface LemonSqueezyConfig { /** API key (from https://app.lemonsqueezy.com/settings/api) */ apiKey: string; /** Store ID that owns the variants/customers */ storeId: string | number; /** Webhook signing secret for X-Signature verification */ webhookSecret?: string; /** API base URL (defaults to production) */ apiUrl?: string; } /** Lemon Squeezy subscription status */ type LemonSqueezySubscriptionStatus = "on_trial" | "active" | "paused" | "past_due" | "unpaid" | "cancelled" | "expired"; /** Error thrown by the Lemon Squeezy adapter */ declare class LemonSqueezyAdapterError extends Error { readonly statusCode?: number | undefined; readonly gatewayError?: unknown | undefined; constructor(message: string, statusCode?: number | undefined, gatewayError?: unknown | undefined); } /** * Create a Lemon Squeezy payment adapter for subscriptions. * * **Notes on Lemon Squeezy's model**: * * - Subscriptions are created exclusively through hosted checkouts; there is * no API to create a subscription server-side, so `createSubscription()` * throws a descriptive error. Use `createCheckoutSession()` instead and * handle the resulting `subscription_created` webhook. * - `createCheckoutSession()` passes `metadata` through as `checkout_data.custom`, * which Lemon Squeezy echoes back in webhook `meta.custom_data` - use it to * carry your internal `subscriberId`. * - Cancellations are always at period end (`ends_at = renews_at`); immediate * cancellation is not supported by the API. * - Off-session charges (`chargePayment()`) are not supported - Lemon Squeezy * is merchant-of-record and manages all renewals itself. * * @example * ```typescript * import { lemonSqueezyAdapter } from '@abshahin/subscriptions/adapters/lemonsqueezy'; * * const payment = lemonSqueezyAdapter({ * apiKey: process.env.LEMONSQUEEZY_API_KEY!, * storeId: process.env.LEMONSQUEEZY_STORE_ID!, * webhookSecret: process.env.LEMONSQUEEZY_WEBHOOK_SECRET!, * }); * ``` */ declare function lemonSqueezyAdapter(config: LemonSqueezyConfig): PaymentGatewayAdapter; //#endregion export { LemonSqueezyAdapterError, LemonSqueezyConfig, LemonSqueezySubscriptionStatus, lemonSqueezyAdapter }; //# sourceMappingURL=lemonsqueezy.adapter.d.ts.map