import Stripe from 'stripe'; import type { CheckoutRequest, CheckoutResult, PaymentConfig } from '../types/index.js'; /** * Create a Stripe client instance. */ export declare function createStripeClient(config: PaymentConfig): Stripe; /** * Create a Stripe Checkout session. * Generalized from booking-baloon /api/checkout — works with any line items. */ export declare function createCheckoutSession(stripe: Stripe, request: CheckoutRequest, config: PaymentConfig): Promise; /** * Construct and verify a Stripe webhook event. */ export declare function handleWebhook(stripe: Stripe, body: string | Buffer, signature: string, secret: string): Promise; /** * Create a Stripe Billing (subscription) session. */ export declare function createBillingSession(stripe: Stripe, request: { customerId: string; priceId: string; successUrl: string; cancelUrl: string; trialDays?: number; metadata?: Record; }): Promise<{ url: string | null; sessionId: string; }>; /** * Create a Stripe Customer Portal session. */ export declare function createPortalSession(stripe: Stripe, customerId: string, returnUrl: string): Promise<{ url: string; }>; /** * Webhook handler callbacks for Stripe billing events. */ export interface WebhookHandlers { onCheckoutCompleted?: (session: any) => Promise; onInvoicePaid?: (invoice: any) => Promise; onSubscriptionUpdated?: (subscription: any) => Promise; onSubscriptionDeleted?: (subscription: any) => Promise; onPaymentFailed?: (invoice: any) => Promise; } /** * Handle Stripe billing webhooks with event-type dispatch. */ export declare function handleBillingWebhook(stripe: Stripe, body: string | Buffer, signature: string, secret: string, handlers: WebhookHandlers): Promise<{ received: boolean; type: string; }>; //# sourceMappingURL=stripe.d.ts.map