storenest-commerce
Version:
Complete e-commerce SDK for Storenest platform with React components, multi-language support, secure checkout, and enterprise-grade security
63 lines (62 loc) • 1.74 kB
TypeScript
export interface OrderCalculation {
subtotal: number;
shipping: number;
taxes: number;
discounts: number;
total: number;
currency: string;
}
export interface PaymentData {
method: string;
token?: string;
cardData?: {
number: string;
expMonth: string;
expYear: string;
cvc: string;
};
billingAddress: {
firstName: string;
lastName: string;
address: string;
city: string;
state?: string;
zipCode: string;
country: string;
};
}
export interface OrderValidation {
valid: boolean;
errors: string[];
warnings: string[];
}
export interface FraudDetection {
risk: 'low' | 'medium' | 'high';
flags: string[];
score: number;
}
export declare class StorenestServerCheckout {
private apiBaseUrl;
private secretKey;
constructor();
calculateOrderTotal(cartId: string, shippingMethodId?: string): Promise<OrderCalculation>;
validateOrder(orderData: any): Promise<OrderValidation>;
processPayment(paymentData: PaymentData, orderId: string): Promise<any>;
detectFraud(orderData: any, clientIP: string): Promise<FraudDetection>;
applyDiscounts(cartId: string, discountCode?: string): Promise<{
applied: boolean;
discount: number;
message?: string;
}>;
createOrder(orderData: any): Promise<any>;
validateCheckoutSession(sessionId: string): Promise<{
valid: boolean;
session?: any;
}>;
checkRateLimit(clientIP: string, action: string): Promise<{
allowed: boolean;
remaining: number;
}>;
logSecurityEvent(event: string, data: any): Promise<void>;
}
export default StorenestServerCheckout;