fix: add items from stash

This commit is contained in:
Mythie
2023-08-30 16:36:22 +10:00
parent c3f11afaf9
commit d7bd8fcd37
11 changed files with 129 additions and 10 deletions

View File

@ -0,0 +1,19 @@
'use server';
import { stripe } from '@documenso/lib/server-only/stripe';
export type GetPortalSessionOptions = {
customerId: string;
returnUrl: string;
};
export const getPortalSession = async ({ customerId, returnUrl }: GetPortalSessionOptions) => {
'use server';
const session = await stripe.billingPortal.sessions.create({
customer: customerId,
return_url: returnUrl,
});
return session.url;
};