@phygrid/checkout
Version:
62 lines (61 loc) • 1.54 kB
TypeScript
import { Customer, TransactionPayment } from "./payment";
export interface TransactionResponse {
id: string;
tenantId: string;
status: TransactionStatusEnum;
items: TransactionItem[];
totalAmount: number;
subtotalAmount: number;
totalTaxAmount: number;
totalDiscountAmount: number;
totalShippingAmount: number;
currency: string;
metadata?: unknown;
createdAt: string;
updatedAt: string;
payment?: TransactionPayment;
customer?: Customer;
}
export declare enum TransactionStatusEnum {
Pending = "pending",
Success = "success",
Failed = "failed",
Cancelled = "cancelled"
}
export interface TransactionItem {
productId: string;
name: string;
description?: string;
unitAmount: number;
discountAmount: number;
subtotalAmount: number;
totalAmount: number;
quantity: number;
taxAmount?: number;
taxRate?: number;
metadata?: unknown;
alerts?: any[];
}
export interface CreateTransactionPayload {
spaceId: string;
currency: string;
items: {
quantity: number;
productId?: string;
productData: {
productId: string;
name: string;
description: string;
unitAmount: number;
taxRate?: number;
customProperties?: {
key: string;
value: string;
productId?: string;
};
};
}[];
metadata?: unknown;
payment?: string;
salesEmployeeId?: string;
}