import * as zod_v4_core from 'zod/v4/core'; import * as zod from 'zod'; import { AdapterHealth as AdapterHealth$1, CheckoutParams as CheckoutParams$1, CheckoutResult as CheckoutResult$1, PaymentCheckoutInput as PaymentCheckoutInput$1, PaymentCheckoutSession as PaymentCheckoutSession$1, PaymentPlanContract as PaymentPlanContract$1, PaymentSubscriptionContract as PaymentSubscriptionContract$1, PaymentsAdapter as PaymentsAdapter$1, PaymentsContractError as PaymentsContractError$1, PaymentsProviderAdapter as PaymentsProviderAdapter$1, Plan as Plan$1, Subscription as Subscription$1 } from '@geenius/adapters'; /** * Health result returned by payments providers after checking checkout, * subscription, and feature-gate availability. * * @example * ```ts * const health: AdapterHealth = await payments.getHealth(); * ``` */ type AdapterHealth = AdapterHealth$1; /** * Legacy checkout request accepted by the root `PaymentsAdapter` contract. * * @example * ```ts * const params: CheckoutParams = { planId: "pro", userId: "user_1" }; * ``` */ type CheckoutParams = CheckoutParams$1; /** * Legacy checkout response returned by the root `PaymentsAdapter` contract. * * @example * ```ts * const result: CheckoutResult = { url: "https://pay.example.com/checkout", sessionId: "cs_1" }; * ``` */ type CheckoutResult = CheckoutResult$1; /** * Provider-neutral checkout creation payload accepted by payments providers. * * @example * ```ts * const input: PaymentCheckoutInput = { planId: "pro", identityId: "user_1" }; * ``` */ type PaymentCheckoutInput = PaymentCheckoutInput$1; /** * Provider-neutral checkout session record returned after checkout creation. * * @example * ```ts * const session: PaymentCheckoutSession = { * id: "cs_1", * planId: "pro", * identityId: "user_1", * url: "https://pay.example.com/checkout", * status: "created", * createdAt: new Date().toISOString(), * }; * ``` */ type PaymentCheckoutSession = PaymentCheckoutSession$1; /** * Payment plan record used by provider adapters for plan catalog responses. * * @example * ```ts * const plan: PaymentPlanContract = { id: "pro", name: "Pro", currency: "USD", amount: 2000, interval: "month", features: ["exports"] }; * ``` */ type PaymentPlanContract = PaymentPlanContract$1; /** * Subscription lifecycle record returned by payments provider adapters. * * @example * ```ts * const subscription: PaymentSubscriptionContract = { * id: "sub_1", * planId: "pro", * identityId: "user_1", * status: "active", * currentPeriodStart: new Date().toISOString(), * currentPeriodEnd: new Date().toISOString(), * cancelAtPeriodEnd: false, * createdAt: new Date().toISOString(), * updatedAt: new Date().toISOString(), * metadata: {}, * }; * ``` */ type PaymentSubscriptionContract = PaymentSubscriptionContract$1; /** * Root payments adapter contract used by legacy local/dev and UI bindings. * * @example * ```ts * const plans = await payments.getPlans(); * ``` */ type PaymentsAdapter = PaymentsAdapter$1; /** * SDK-free payments provider contract implemented by downstream provider * packages and app-owned billing modules. * * @example * ```ts * const checkout = await provider.createCheckout({ planId: "pro", identityId: "user_1" }); * ``` */ type PaymentsProviderAdapter = PaymentsProviderAdapter$1; /** * Legacy plan record returned by the root `PaymentsAdapter.getPlans()` method. * * @example * ```ts * const plan: Plan = { id: "pro", name: "Pro", price: 2000, currency: "USD", interval: "month", features: ["exports"] }; * ``` */ type Plan = Plan$1; /** * Legacy subscription record returned by the root payments adapter contract. * * @example * ```ts * const subscription: Subscription = { id: "sub_1", userId: "user_1", planId: "pro", status: "active", currentPeriodEnd: new Date().toISOString(), cancelAtPeriodEnd: false }; * ``` */ type Subscription = Subscription$1; /** * Runtime validator for the common payments adapter health response. * * @example * ```ts * const health = AdapterHealthSchema.parse({ ok: true, checkedAt: new Date().toISOString() }); * ``` */ declare const AdapterHealthSchema: zod.ZodObject<{ ok: zod.ZodBoolean; checkedAt: zod.ZodString; latencyMs: zod.ZodOptional; message: zod.ZodOptional; }, zod_v4_core.$strip>; /** * Runtime validator for provider-neutral checkout creation payloads. * * @example * ```ts * const input = PaymentCheckoutInputSchema.parse({ planId: "pro", identityId: "user_1" }); * ``` */ declare const PaymentCheckoutInputSchema: zod.ZodObject<{ planId: zod.ZodString; identityId: zod.ZodString; successUrl: zod.ZodOptional; cancelUrl: zod.ZodOptional; }, zod_v4_core.$strip>; /** * Runtime validator for provider-neutral checkout session records. * * @example * ```ts * const session = PaymentCheckoutSessionSchema.parse({ id: "cs_1", planId: "pro", identityId: "user_1", url: "https://pay.example.com/checkout", status: "created", createdAt: new Date().toISOString() }); * ``` */ declare const PaymentCheckoutSessionSchema: zod.ZodObject<{ id: zod.ZodString; planId: zod.ZodString; identityId: zod.ZodString; url: zod.ZodString; status: zod.ZodEnum<{ completed: "completed"; created: "created"; expired: "expired"; }>; createdAt: zod.ZodString; }, zod_v4_core.$strip>; /** * Runtime validator for payment plan contract records. * * @example * ```ts * const plan = PaymentPlanContractSchema.parse({ id: "pro", name: "Pro", currency: "USD", amount: 2000, interval: "month" }); * ``` */ declare const PaymentPlanContractSchema: zod.ZodObject<{ id: zod.ZodString; name: zod.ZodString; currency: zod.ZodString; amount: zod.ZodNumber; interval: zod.ZodEnum<{ month: "month"; year: "year"; "one-time": "one-time"; }>; features: zod.ZodDefault>; }, zod_v4_core.$strip>; /** * Runtime validator for subscription lifecycle records. * * @example * ```ts * const subscription = PaymentSubscriptionContractSchema.parse({ id: "sub_1", planId: "pro", identityId: "user_1", status: "active", currentPeriodStart: new Date().toISOString(), currentPeriodEnd: new Date().toISOString(), createdAt: new Date().toISOString(), updatedAt: new Date().toISOString() }); * ``` */ declare const PaymentSubscriptionContractSchema: zod.ZodObject<{ id: zod.ZodString; planId: zod.ZodString; identityId: zod.ZodString; status: zod.ZodEnum<{ active: "active"; cancelled: "cancelled"; past_due: "past_due"; trialing: "trialing"; incomplete: "incomplete"; unpaid: "unpaid"; }>; currentPeriodStart: zod.ZodString; currentPeriodEnd: zod.ZodString; cancelAtPeriodEnd: zod.ZodDefault; cancelledAt: zod.ZodOptional; createdAt: zod.ZodString; updatedAt: zod.ZodString; metadata: zod.ZodDefault>; }, zod_v4_core.$strip>; /** * Contract-layer error for invalid payments payloads or provider-boundary * violations before a concrete payments SDK receives the request. * * @example * ```ts * throw new PaymentsContractError("Invalid checkout session"); * ``` */ declare const PaymentsContractError: typeof PaymentsContractError$1; export { type AdapterHealth, AdapterHealthSchema, type CheckoutParams, type CheckoutResult, type PaymentCheckoutInput, PaymentCheckoutInputSchema, type PaymentCheckoutSession, PaymentCheckoutSessionSchema, type PaymentPlanContract, PaymentPlanContractSchema, type PaymentSubscriptionContract, PaymentSubscriptionContractSchema, type PaymentsAdapter, PaymentsContractError, type PaymentsProviderAdapter, type Plan, type Subscription };