storenest-commerce
Version:
Complete e-commerce SDK for Storenest platform with React components, multi-language support, secure checkout, and enterprise-grade security
57 lines (56 loc) • 1.54 kB
TypeScript
export interface CheckoutConfig {
theme?: 'modern' | 'classic' | 'minimal';
currency?: string;
locale?: string;
showOrderSummary?: boolean;
enableGuestCheckout?: boolean;
}
export interface CheckoutSession {
id: string;
cartId: string;
expiresAt: number;
status: 'pending' | 'processing' | 'completed' | 'failed';
paymentIntent?: any;
}
export interface ShippingAddress {
firstName: string;
lastName: string;
email: string;
phone?: string;
address: string;
city: string;
state?: string;
zipCode: string;
country: string;
}
export interface ShippingMethod {
id: string;
name: string;
price: number;
estimatedDays: string;
description?: string;
}
export interface PaymentMethod {
id: string;
type: 'card' | 'paypal' | 'bank_transfer';
name: string;
description?: string;
icon?: string;
}
export declare class StorenestCheckout {
private config;
private apiBaseUrl;
constructor(config?: CheckoutConfig);
initiateCheckout(cartId: string): Promise<CheckoutSession>;
getShippingMethods(address: ShippingAddress): Promise<ShippingMethod[]>;
getPaymentMethods(): Promise<PaymentMethod[]>;
validateAddress(address: ShippingAddress): Promise<{
valid: boolean;
errors?: string[];
}>;
getCheckoutStatus(sessionId: string): Promise<CheckoutSession>;
formatPrice(amount: number): string;
getConfig(): CheckoutConfig;
private getHeaders;
}
export default StorenestCheckout;