mirror of
https://github.com/documenso/documenso.git
synced 2025-11-16 17:51:49 +10:00
feat: delete user from db and unsubscribe from stripe
This commit is contained in:
10
packages/ee/server-only/stripe/delete-customer.ts
Normal file
10
packages/ee/server-only/stripe/delete-customer.ts
Normal 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);
|
||||
};
|
||||
Reference in New Issue
Block a user