import { PublicMedia } from './Checkout'; import { Currency } from './Currency'; import { Pricing } from './Pricing'; export interface Cart { id?: string; items: CartItem[]; conditions?: CartCondition[]; subtotal: number; total: number; currency: Currency; } export type CartItem = { id: string | number; gid: string; name: string; image?: PublicMedia; total: number; quantity: number; pricing: Pricing; options: CartItemOption[]; }; export type CartItemOption = { key: string; value: string; }; export type CartItemInput = { gid: string; quantity?: number; }; type CartCondition = { name: string; target: string; order?: number; attributes: CartAttribute[]; }; type CartAttribute = { key: string; value: any; }; export interface CartItemUpdateOptions { quantity?: number; } export declare enum CartCheckoutRequestStatus { /** * The checkout is completed. No payment or further confirmation required. */ ACCEPTED = "ACCEPTED", /** * The booking requires payment and has an active attached checkout. */ REQUIRES_PAYMENT = "REQUIRES_PAYMENT", /** * The checkout contains bookable items and booking date is required. */ DELIVERY_DATE_REQUIRED = "DELIVERY_DATE_REQUIRED", /** * Provided cart is not found or is invalid. */ NO_CART = "NO_CART", /** * An error occurred. */ ERROR = "ERROR" } export interface CartCheckoutResult { status: CartCheckoutRequestStatus; checkoutUrl?: string; errors: { codes: string[]; messages: string[]; }; } export interface CartCheckoutInput { success_url?: string; cancel_url?: string; order_notes?: string; } export {};