first
This commit is contained in:
commit
8538ab969a
434 changed files with 44051 additions and 0 deletions
33
packages/payments/types.ts
Normal file
33
packages/payments/types.ts
Normal 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;
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue