import { C as Subscription, E as getSchema, S as Session, T as User, _ as PaystackPlan, a as getMetadataBoolean, b as PaystackTransaction, c as hasPaystackMetadata, d as AnyPaystackOptions, f as ChargeRecurringSubscriptionInput, g as PaystackOptions, h as PaystackInitializeResult, i as createRenewalMetadata, l as parsePaystackMetadata, m as PaystackClientLike, n as createCheckoutMetadata, o as getMetadataNumber, p as ChargeRecurringSubscriptionResult, r as createProrationMetadata, s as getMetadataString, t as PaystackMetadata, u as stringifyPaystackMetadata, v as PaystackProduct, w as SubscriptionOptions, x as PaystackTransactionResponse, y as PaystackSyncResult } from "./metadata-BQrgMYcE.mjs"; import { AuthContext, BetterAuthPlugin, GenericEndpointContext, MiddlewareInputContext, MiddlewareOptions, StrictEndpoint, defineErrorCodes } from "better-auth"; import { z } from "zod"; //#region src/routes.d.ts declare const paystackWebhook:

(options: AnyPaystackOptions, path?: P) => StrictEndpoint; declare const initializeTransaction:

(options: AnyPaystackOptions, path?: P) => StrictEndpoint; product: z.ZodOptional; amount: z.ZodOptional; currency: z.ZodOptional; email: z.ZodOptional; metadata: z.ZodOptional>; referenceId: z.ZodOptional; callbackURL: z.ZodOptional; quantity: z.ZodOptional; scheduleAtPeriodEnd: z.ZodOptional; cancelAtPeriodEnd: z.ZodOptional; prorateAndCharge: z.ZodOptional; }, z.core.$strip>; use: (((getValue: (ctx: GenericEndpointContext) => string | string[]) => (inputContext: MiddlewareInputContext) => Promise) | ((inputContext: MiddlewareInputContext) => Promise))[]; }, PaystackInitializeResult | undefined>; declare const createSubscription:

(options: AnyPaystackOptions, path?: P) => StrictEndpoint; product: z.ZodOptional; amount: z.ZodOptional; currency: z.ZodOptional; email: z.ZodOptional; metadata: z.ZodOptional>; referenceId: z.ZodOptional; callbackURL: z.ZodOptional; quantity: z.ZodOptional; scheduleAtPeriodEnd: z.ZodOptional; cancelAtPeriodEnd: z.ZodOptional; prorateAndCharge: z.ZodOptional; }, z.core.$strip>; use: (((getValue: (ctx: GenericEndpointContext) => string | string[]) => (inputContext: MiddlewareInputContext) => Promise) | ((inputContext: MiddlewareInputContext) => Promise))[]; }, PaystackInitializeResult | undefined>; declare const upgradeSubscription:

(options: AnyPaystackOptions, path?: P) => StrictEndpoint; product: z.ZodOptional; amount: z.ZodOptional; currency: z.ZodOptional; email: z.ZodOptional; metadata: z.ZodOptional>; referenceId: z.ZodOptional; callbackURL: z.ZodOptional; quantity: z.ZodOptional; scheduleAtPeriodEnd: z.ZodOptional; cancelAtPeriodEnd: z.ZodOptional; prorateAndCharge: z.ZodOptional; }, z.core.$strip>; use: (((getValue: (ctx: GenericEndpointContext) => string | string[]) => (inputContext: MiddlewareInputContext) => Promise) | ((inputContext: MiddlewareInputContext) => Promise))[]; }, PaystackInitializeResult | undefined>; declare const cancelSubscription:

(options: AnyPaystackOptions, path?: P) => StrictEndpoint; subscriptionCode: z.ZodString; emailToken: z.ZodOptional; atPeriodEnd: z.ZodOptional; }, z.core.$strip>; use: (((getValue: (ctx: GenericEndpointContext) => string | string[]) => (inputContext: MiddlewareInputContext) => Promise) | ((inputContext: MiddlewareInputContext) => Promise))[]; }, { status: string; }>; declare const restoreSubscription:

(options: AnyPaystackOptions, path?: P) => StrictEndpoint; subscriptionCode: z.ZodString; emailToken: z.ZodOptional; atPeriodEnd: z.ZodOptional; }, z.core.$strip>; use: (((getValue: (ctx: GenericEndpointContext) => string | string[]) => (inputContext: MiddlewareInputContext) => Promise) | ((inputContext: MiddlewareInputContext) => Promise))[]; }, { status: string; }>; declare const verifyTransaction:

(options: AnyPaystackOptions, path?: P) => StrictEndpoint; use: (((getValue: (ctx: GenericEndpointContext) => string | string[]) => (inputContext: MiddlewareInputContext) => Promise) | ((inputContext: MiddlewareInputContext) => Promise))[]; }, { status: string; reference: string; data: { id: number; domain: string; status: string; reference: string; receipt_number: string | null; amount: number; message: string | null; gateway_response: string; channel: string; currency: string; ip_address: string | null; metadata: (string | Record | number) | null; log: { start_time: number; time_spent: number; attempts: number; errors: number; success: boolean; mobile: boolean; input: unknown[]; history: { type: string; message: string; time: number; }[]; } | null; fees: number | null; fees_split: unknown; authorization: { authorization_code?: string; bin?: string | null; last4?: string; exp_month?: string; exp_year?: string; channel?: string; card_type?: string; bank?: string; country_code?: string; brand?: string; reusable?: boolean; signature?: string; account_name?: string | null; receiver_bank_account_number?: string | null; receiver_bank?: string | null; }; customer: { id: number; first_name: string | null; last_name: string | null; email: string; customer_code: string; phone: string | null; metadata: Record | null; risk_action: string; international_format_phone?: string | null; }; plan: (string | Record) | null; split: Record | null; order_id: unknown; paidAt: string | null; createdAt: string; requested_amount: number; pos_transaction_data: unknown; source: unknown; fees_breakdown: unknown; connect: unknown; transaction_date: string; plan_object: { id?: number; name?: string; plan_code?: string; description?: unknown; amount?: number; interval?: string; send_invoices?: boolean; send_sms?: boolean; currency?: string; }; subaccount: Record | null; }; }>; declare const listSubscriptions:

(options: AnyPaystackOptions, path?: P) => StrictEndpoint; }, z.core.$strip>; use: (((getValue: (ctx: GenericEndpointContext) => string | string[]) => (inputContext: MiddlewareInputContext) => Promise) | ((inputContext: MiddlewareInputContext) => Promise))[]; }, { subscriptions: Subscription[]; }>; declare const listTransactions:

(options: AnyPaystackOptions, path?: P) => StrictEndpoint; }, z.core.$strip>; use: (((getValue: (ctx: GenericEndpointContext) => string | string[]) => (inputContext: MiddlewareInputContext) => Promise) | ((inputContext: MiddlewareInputContext) => Promise))[]; }, { transactions: PaystackTransaction[]; }>; declare const disablePaystackSubscription:

(options: AnyPaystackOptions, path?: P) => StrictEndpoint; subscriptionCode: z.ZodString; emailToken: z.ZodOptional; atPeriodEnd: z.ZodOptional; }, z.core.$strip>; use: (((getValue: (ctx: GenericEndpointContext) => string | string[]) => (inputContext: MiddlewareInputContext) => Promise) | ((inputContext: MiddlewareInputContext) => Promise))[]; }, { status: string; }>; declare const enablePaystackSubscription:

(options: AnyPaystackOptions, path?: P) => StrictEndpoint; subscriptionCode: z.ZodString; emailToken: z.ZodOptional; atPeriodEnd: z.ZodOptional; }, z.core.$strip>; use: (((getValue: (ctx: GenericEndpointContext) => string | string[]) => (inputContext: MiddlewareInputContext) => Promise) | ((inputContext: MiddlewareInputContext) => Promise))[]; }, { status: string; }>; declare const getSubscriptionManageLink:

(options: AnyPaystackOptions, path?: P) => StrictEndpoint; use: (((getValue: (ctx: GenericEndpointContext) => string | string[]) => (inputContext: MiddlewareInputContext) => Promise) | ((inputContext: MiddlewareInputContext) => Promise))[]; }, { link: string | null; }>; declare const listProducts:

(_options: AnyPaystackOptions, path?: P) => StrictEndpoint; declare const listPlans:

(_options: AnyPaystackOptions, path?: P) => StrictEndpoint) => Promise<{ session: { session: Record & { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record & { id: string; createdAt: Date; updatedAt: Date; email: string; emailVerified: boolean; name: string; image?: string | null | undefined; }; }; }>)[]; }, { plans: PaystackPlan[]; }>; declare const getConfig:

(options: AnyPaystackOptions, path?: P) => StrictEndpoint; //#endregion //#region src/version.d.ts declare const PACKAGE_VERSION = "3.0.0"; //#endregion //#region src/operations.d.ts declare function syncPaystackProducts(ctx: GenericEndpointContext, options: AnyPaystackOptions): Promise; declare function syncPaystackPlans(ctx: GenericEndpointContext, options: AnyPaystackOptions): Promise; declare function chargeSubscriptionRenewal(ctx: GenericEndpointContext, options: AnyPaystackOptions, input: ChargeRecurringSubscriptionInput): Promise; //#endregion //#region src/reconciliation.d.ts type PaystackReconciliationSource = "webhook" | "queue" | "admin" | "server" | "browser"; interface ReconcilePaystackTransactionInput { reference: string; source?: PaystackReconciliationSource; referenceId?: string; actor?: { user: User; session: Session; }; throwOnError?: boolean; } interface PaystackReconciliationError { code: string; message: string; status?: number; } interface PaystackReconciliationSummary { transaction: { found: boolean; updated: boolean; referenceId?: string; previousStatus?: string; status?: string; }; subscription: { found: boolean; updated: boolean; id?: string; status?: string; prorationApplied: boolean; }; customer: { saved: boolean; referenceId?: string; customerCode?: string; model?: "user" | "organization"; }; product: { synced: boolean; name?: string; }; } interface ReconcilePaystackTransactionSuccess extends PaystackReconciliationSummary { ok: true; source: PaystackReconciliationSource; status: string; reference: string; data: PaystackTransactionResponse; error?: undefined; } interface ReconcilePaystackTransactionFailure extends PaystackReconciliationSummary { ok: false; source: PaystackReconciliationSource; status: string; reference: string; data: PaystackTransactionResponse | null; error: PaystackReconciliationError; } type ReconcilePaystackTransactionResult = ReconcilePaystackTransactionSuccess | ReconcilePaystackTransactionFailure; declare function reconcilePaystackTransaction(ctx: GenericEndpointContext, options: AnyPaystackOptions, input: ReconcilePaystackTransactionInput): Promise; //#endregion //#region src/index.d.ts declare module "better-auth" { interface BetterAuthPluginRegistry { paystack: { creator: typeof paystack; }; } } declare const INTERNAL_ERROR_CODES: ReturnType; type BetterAuthEndpoint = NonNullable[string]; interface PaystackPluginEndpoints extends Record { initializeTransaction: ReturnType; verifyTransaction: ReturnType; listSubscriptions: ReturnType; paystackWebhook: ReturnType; listTransactions: ReturnType; getConfig: ReturnType; disableSubscription: ReturnType; enableSubscription: ReturnType; getSubscriptionManageLink: ReturnType; subscriptionManageLink: ReturnType; createSubscription: ReturnType; upgradeSubscription: ReturnType; cancelSubscription: ReturnType; restoreSubscription: ReturnType; listProducts: ReturnType; listPlans: ReturnType; } type PaystackHookHandler = (...args: unknown[]) => unknown; interface PaystackPluginInitResult { options: { databaseHooks: Record & { organization: { create: { after: PaystackHookHandler; }; }; }; }; } type PaystackPluginInit = ((ctx: AuthContext) => PaystackPluginInitResult) & NonNullable; type PaystackPluginInstance = Omit & { id: "paystack"; version: typeof PACKAGE_VERSION; endpoints: PaystackPluginEndpoints; schema: ReturnType; init: PaystackPluginInit; $ERROR_CODES: typeof INTERNAL_ERROR_CODES; options: NoInfer; }; declare const createPaystackPlugin: = PaystackOptions>(options: O) => PaystackPluginInstance; declare const paystack: typeof createPaystackPlugin; type PaystackPlugin = PaystackOptions> = ReturnType>; //#endregion export { type ChargeRecurringSubscriptionResult, type PaystackClientLike, type PaystackInitializeResult, type PaystackMetadata, type PaystackOptions, type PaystackPlan, PaystackPlugin, type PaystackProduct, type PaystackReconciliationError, type PaystackReconciliationSource, type PaystackReconciliationSummary, type PaystackSyncResult, type PaystackTransactionResponse, type ReconcilePaystackTransactionFailure, type ReconcilePaystackTransactionInput, type ReconcilePaystackTransactionResult, type ReconcilePaystackTransactionSuccess, type Subscription, type SubscriptionOptions, chargeSubscriptionRenewal, createCheckoutMetadata, createProrationMetadata, createRenewalMetadata, getMetadataBoolean, getMetadataNumber, getMetadataString, hasPaystackMetadata, parsePaystackMetadata, paystack, reconcilePaystackTransaction, stringifyPaystackMetadata, syncPaystackPlans, syncPaystackProducts }; //# sourceMappingURL=index.d.mts.map