This commit is contained in:
 Илья Шалонин 2025-10-29 13:43:43 +05:00
commit 8538ab969a
434 changed files with 44051 additions and 0 deletions

View file

@ -0,0 +1,33 @@
export type CreateCheckoutLink = (params: {
type: "subscription" | "one-time";
productId: string;
email?: string;
name?: string;
redirectUrl?: string;
customerId?: string;
organizationId?: string;
userId?: string;
trialPeriodDays?: number;
seats?: number;
}) => Promise<string | null>;
export type CreateCustomerPortalLink = (params: {
subscriptionId?: string;
customerId: string;
redirectUrl?: string;
}) => Promise<string | null>;
export type SetSubscriptionSeats = (params: {
id: string;
seats: number;
}) => Promise<void>;
export type CancelSubscription = (id: string) => Promise<void>;
export type WebhookHandler = (req: Request) => Promise<Response>;
export type PaymentProvider = {
createCheckoutLink: CreateCheckoutLink;
createCustomerPortalLink: CreateCustomerPortalLink;
webhookHandler: WebhookHandler;
};