/** * Custom error classes for checkout API */ export declare class CheckoutError extends Error { code: string; details?: Record; constructor(message: string, code?: string, details?: Record); } export declare class ValidationError extends CheckoutError { constructor(message: string, details?: Record); } export declare class PaymentError extends CheckoutError { constructor(message: string, details?: Record); } export declare class OrderError extends CheckoutError { constructor(message: string, details?: Record); } export declare class ElasticPathError extends CheckoutError { constructor(message: string, details?: Record); } export declare class StripeError extends CheckoutError { constructor(message: string, details?: Record); } /** * Error handling utilities */ /** * Handles Elastic Path API errors */ export declare function handleElasticPathError(error: any): CheckoutError; /** * Handles Stripe API errors */ export declare function handleStripeError(error: any): CheckoutError; /** * Handles validation errors with field-specific messages */ export declare function createValidationError(fieldErrors: Record, generalMessage?: string): ValidationError; /** * Logs errors with appropriate level and context */ export declare function logError(error: CheckoutError, context?: Record): void; /** * Converts errors to API response format */ export declare function errorToApiResponse(error: CheckoutError): { success: false; error: { message: string; code: string; details?: Record; }; }; /** * Safely extracts user-friendly error message */ export declare function getUserErrorMessage(error: any): string; /** * Determines if error should be retried */ export declare function isRetryableError(error: CheckoutError): boolean; /** * Creates appropriate HTTP status code for error */ export declare function getHttpStatusForError(error: CheckoutError): number;