feat: delete user from db and unsubscribe from stripe

This commit is contained in:
Ephraim Atta-Duncan
2024-01-20 23:30:56 +00:00
parent f652ca9b73
commit a3e560899a
6 changed files with 98 additions and 15 deletions

View File

@ -0,0 +1,10 @@
import { stripe } from '@documenso/lib/server-only/stripe';
import type { User } from '@documenso/prisma/client';
export const deleteStripeCustomer = async (user: User) => {
if (!user.customerId) {
return null;
}
return await stripe.customers.del(user.customerId);
};