mirror of
https://github.com/documenso/documenso.git
synced 2025-11-14 00:32:43 +10:00
16 lines
393 B
TypeScript
16 lines
393 B
TypeScript
import { stripe } from '@documenso/lib/server-only/stripe';
|
|
|
|
export type GetPortalSessionOptions = {
|
|
customerId: string;
|
|
returnUrl?: string;
|
|
};
|
|
|
|
export const getPortalSession = async ({ customerId, returnUrl }: GetPortalSessionOptions) => {
|
|
const session = await stripe.billingPortal.sessions.create({
|
|
customer: customerId,
|
|
return_url: returnUrl,
|
|
});
|
|
|
|
return session.url;
|
|
};
|