This commit is contained in:
David Nguyen
2025-05-07 15:03:20 +10:00
parent 419bc02171
commit 7abfc9e271
390 changed files with 21254 additions and 12607 deletions

View File

@ -1,20 +1,23 @@
import { STRIPE_CUSTOMER_TYPE } from '@documenso/lib/constants/billing';
import { stripe } from '@documenso/lib/server-only/stripe';
type CreateTeamCustomerOptions = {
type CreateOrganisationCustomerOptions = {
name: string;
email: string;
};
/**
* Create a Stripe customer for a given team.
* Create a Stripe customer for a given Organisation.
*/
export const createTeamCustomer = async ({ name, email }: CreateTeamCustomerOptions) => {
export const createOrganisationCustomer = async ({
name,
email,
}: CreateOrganisationCustomerOptions) => {
return await stripe.customers.create({
name,
email,
metadata: {
type: STRIPE_CUSTOMER_TYPE.TEAM,
type: STRIPE_CUSTOMER_TYPE.ORGANISATION,
},
});
};