import { CreationOptional, DataTypes, FindOptions, InferAttributes, InferCreationAttributes } from 'sequelize'; import type { LiteralUnion } from 'type-fest'; import { TenantModel } from '../tenant-model'; import type { CurrencyConversion, CustomField, CustomerDetail, InvoiceData, LineItem, NftMintDetails, NftMintSettings, PaymentDetails, PaymentIntentData, ServiceAction, SubscriptionData } from './types'; export declare const nextCheckoutSessionId: (size?: number) => string; export declare class CheckoutSession extends TenantModel, InferCreationAttributes> { id: CreationOptional; livemode: boolean; instance_did?: string; client_reference_id?: string; currency_id: string; invoice_id?: string; customer_id?: string; customer_did?: string; payment_link_id?: string; subscription_id?: string; enable_subscription_grouping?: boolean; subscription_groups?: Record; success_subscription_count?: number; recovered_from?: string; payment_intent_id?: string; setup_intent_id?: string; mode: LiteralUnion<'payment' | 'setup' | 'subscription', string>; status: LiteralUnion<'complete' | 'open' | 'expired', string>; payment_status: LiteralUnion<'paid' | 'unpaid' | 'no_payment_required', string>; line_items: LineItem[]; amount_subtotal: string; amount_total: string; slippage_percent?: number; total_details?: { amount_discount?: string; amount_shipping?: string; amount_tax?: string; breakdown?: { discounts?: { amount?: string; discount?: string; }[]; taxes?: { amount?: string; rate?: string; }[]; }; }; url?: string; cancel_url?: string; success_url?: string; currency_conversion?: CurrencyConversion; customer_details?: CustomerDetail; customer_creation: LiteralUnion<'if_required' | 'always', string>; customer_update?: { address: LiteralUnion<'auto' | 'never', string>; name: LiteralUnion<'auto' | 'never', string>; shipping: LiteralUnion<'auto' | 'never', string>; }; after_expiration?: { recovery: { enabled: boolean; allow_promotion_codes?: boolean; }; }; allow_promotion_codes?: boolean; consent_collection?: { promotions?: LiteralUnion<'auto' | 'none', string>; terms_of_service?: LiteralUnion<'required' | 'none', string>; }; consent?: { promotions?: LiteralUnion<'opt_in', string>; terms_of_service?: LiteralUnion<'accepted', string>; }; custom_fields?: CustomField[]; custom_text?: { shipping_address?: string; submit?: string; }; expires_at: number; invoice_creation?: { enabled: boolean; invoice_data?: InvoiceData; }; payment_method_types: string[]; phone_number_collection?: { enabled: boolean; }; submit_type: LiteralUnion<'auto' | 'book' | 'donate' | 'pay', string>; metadata?: Record; billing_address_collection?: LiteralUnion<'auto' | 'required', string>; subscription_data?: SubscriptionData & { service_actions?: ServiceAction[]; billing_cycle_anchor?: number; metadata?: Record; proration_behavior?: LiteralUnion<'create_prorations' | 'none', string>; trial_end?: number; trial_settings?: { end_behavior: { missing_payment_method: LiteralUnion<'cancel' | 'pause' | 'create_invoice', string>; }; }; days_until_due?: number; days_until_cancel?: number; no_stake?: boolean; }; payment_details?: PaymentDetails; payment_intent_data?: PaymentIntentData; nft_mint_status: LiteralUnion<'disabled' | 'pending' | 'minted' | 'sent' | 'error', string>; nft_mint_settings?: NftMintSettings; nft_mint_details?: NftMintDetails; cross_sell_behavior?: LiteralUnion<'auto' | 'required', string>; discounts?: Array<{ coupon?: string; promotion_code?: string; discount_amount?: string; verification_method?: string; verification_data?: Record; }>; fulfillment_status?: LiteralUnion<'pending' | 'processing' | 'completed' | 'failed' | 'cancelled' | 'max_retries_exceeded' | 'return_requested' | 'sent' | 'returning' | 'returned', string>; vendor_info?: Array<{ vendor_id: string; vendor_key: string; vendor_type: string; order_id: string; status: 'pending' | 'processing' | 'completed' | 'failed' | 'cancelled' | 'max_retries_exceeded' | 'return_requested' | 'sent' | 'returned'; service_url?: string; app_url?: string; error_message?: string; amount: string; attempts?: number; lastAttemptAt?: string; returnRetry?: number; completedAt?: string; commissionAmount?: string; returnRequest?: { reason: string; requestedAt: string; status: 'pending' | 'accepted' | 'rejected'; returnDetails?: string; }; }>; created_at: CreationOptional; created_via: LiteralUnion<'api' | 'dashboard' | 'portal', string>; updated_at: CreationOptional; static readonly GENESIS_ATTRIBUTES: { id: { type: DataTypes.StringDataType; primaryKey: boolean; allowNull: boolean; defaultValue: (size?: number) => string; }; livemode: { type: DataTypes.AbstractDataTypeConstructor; allowNull: boolean; }; client_reference_id: { type: DataTypes.StringDataType; allowNull: boolean; }; currency_id: { type: DataTypes.StringDataType; allowNull: boolean; }; invoice_id: { type: DataTypes.StringDataType; allowNull: boolean; }; customer_id: { type: DataTypes.StringDataType; allowNull: boolean; }; customer_did: { type: DataTypes.StringDataType; allowNull: boolean; }; payment_link_id: { type: DataTypes.StringDataType; allowNull: boolean; }; subscription_id: { type: DataTypes.StringDataType; allowNull: boolean; }; recovered_from: { type: DataTypes.StringDataType; allowNull: boolean; }; payment_intent_id: { type: DataTypes.StringDataType; allowNull: boolean; }; mode: { type: DataTypes.EnumDataType<"subscription" | "payment" | "setup">; allowNull: boolean; }; status: { type: DataTypes.EnumDataType<"expired" | "open" | "complete">; allowNull: boolean; }; payment_status: { type: DataTypes.EnumDataType<"paid" | "unpaid" | "no_payment_required">; allowNull: boolean; }; line_items: { type: DataTypes.AbstractDataTypeConstructor; allowNull: boolean; }; amount_subtotal: { type: DataTypes.StringDataType; allowNull: boolean; }; amount_total: { type: DataTypes.StringDataType; allowNull: boolean; }; slippage_percent: { type: DataTypes.DecimalDataType; allowNull: boolean; defaultValue: number; }; total_details: { type: DataTypes.AbstractDataTypeConstructor; allowNull: boolean; }; url: { type: DataTypes.StringDataType; allowNull: boolean; }; cancel_url: { type: DataTypes.StringDataType; allowNull: boolean; }; success_url: { type: DataTypes.StringDataType; allowNull: boolean; }; currency_conversion: { type: DataTypes.AbstractDataTypeConstructor; allowNull: boolean; }; after_expiration: { type: DataTypes.AbstractDataTypeConstructor; allowNull: boolean; }; allow_promotion_codes: { type: DataTypes.AbstractDataTypeConstructor; defaultValue: boolean; }; consent_collection: { type: DataTypes.AbstractDataTypeConstructor; allowNull: boolean; }; consent: { type: DataTypes.AbstractDataTypeConstructor; allowNull: boolean; }; custom_fields: { type: DataTypes.AbstractDataTypeConstructor; defaultValue: never[]; }; custom_text: { type: DataTypes.AbstractDataTypeConstructor; allowNull: boolean; }; customer_creation: { type: DataTypes.EnumDataType<"if_required" | "always">; allowNull: boolean; }; customer_update: { type: DataTypes.AbstractDataTypeConstructor; defaultValue: { address: string; name: string; shipping: string; }; }; expires_at: { type: DataTypes.IntegerDataTypeConstructor; allowNull: boolean; }; invoice_creation: { type: DataTypes.AbstractDataTypeConstructor; allowNull: boolean; }; payment_method_types: { type: DataTypes.AbstractDataTypeConstructor; defaultValue: never[]; }; phone_number_collection: { type: DataTypes.AbstractDataTypeConstructor; allowNull: boolean; }; billing_address_collection: { type: DataTypes.EnumDataType<"auto" | "required">; defaultValue: string; allowNull: boolean; }; submit_type: { type: DataTypes.EnumDataType<"auto" | "book" | "donate" | "pay">; allowNull: boolean; }; subscription_data: { type: DataTypes.AbstractDataTypeConstructor; allowNull: boolean; }; payment_details: { type: DataTypes.AbstractDataTypeConstructor; allowNull: boolean; }; metadata: { type: DataTypes.AbstractDataTypeConstructor; allowNull: boolean; }; created_at: { type: DataTypes.DateDataTypeConstructor; defaultValue: DataTypes.AbstractDataTypeConstructor; allowNull: boolean; }; created_via: { type: DataTypes.EnumDataType<"api" | "dashboard" | "portal">; }; updated_at: { type: DataTypes.DateDataTypeConstructor; defaultValue: DataTypes.AbstractDataTypeConstructor; allowNull: boolean; }; }; static initialize(sequelize: any): void; static associate(models: any): void; static findByPkOrClientRefId(id: string, options?: FindOptions): Promise; static cleanupExpiredSessions(): Promise; isImmutable(): boolean; static findBySubscriptionId(subscriptionId: string, options?: FindOptions): Promise; static findByPaymentIntentId(paymentIntentId: string): Promise; static findByInvoiceId(invoiceId: string): Promise; } export type TCheckoutSession = InferAttributes;