import { Hono } from 'hono';
import type { AppEnv } from '../hono-env.js';
declare const checkout: Hono<AppEnv, import("hono/types").BlankSchema, "/">;
export interface WorkerBalanceSyncResponse {
    balance_cents: number;
    registered: boolean;
    updated_at?: string;
    email?: string | null;
    refunds: Array<{
        id: string;
        amount_cents: number;
        stripe_refund_id: string;
        stripe_payment_intent_id: string;
        reason: string | null;
        created_at: string;
    }>;
}
/**
 * Build the Stripe checkout success_url pointing to the MCP server's callback route.
 * The MCP HTTP server handles the redirect, syncs the payment, then redirects to the dashboard.
 */
export declare function getCheckoutSuccessUrl(): string;
/**
 * Call the Cloudflare Worker checkout proxy.
 * Throws on network errors, timeouts, or non-2xx responses with full context.
 */
export declare function callWorker<T>(path: string, body: Record<string, unknown>): Promise<T>;
/**
 * Credit balance directly — used by the internal/credit endpoint (Worker webhook callback).
 * The Worker has ALREADY verified the Stripe payment before calling this endpoint,
 * so we do NOT call back to the Worker (that would create a circular dependency).
 *
 * Steps:
 * 1. Validate payment_intent_id format
 * 2. Check idempotency (don't double-credit)
 * 3. Insert payment record
 * 4. Credit user's balance with HMAC signing
 */
export declare function creditBalance(userId: string, amountCents: number, paymentIntentId: string): {
    payment_id: string;
    amount_cents: number;
    balance_cents: number;
    already_synced?: boolean;
};
/**
 * Sync a completed Stripe checkout session — used by dashboard sync flow and sync-by-key.
 * This flow DOES call the Worker to verify the payment via Stripe API, because the
 * user is clicking "sync" after returning from Stripe checkout (no prior verification).
 * Returns payment info or null if already synced, throws on error.
 */
export declare function syncCheckoutPayment(userId: string, sessionId: string): Promise<{
    payment_id: string;
    amount_cents: number;
    balance_cents: number;
    already_synced?: boolean;
}>;
export default checkout;
