Skip to content

The Open Source DocuSign Alternative.

fix: correctly set stripe customer names (#1939)

David Nguyen2ee0d7787043
diff --git a/packages/trpc/server/enterprise-router/create-subscription.ts b/packages/trpc/server/enterprise-router/create-subscription.ts
index db0ab302d..ddaf603aa 100644
--- a/packages/trpc/server/enterprise-router/create-subscription.ts
+++ b/packages/trpc/server/enterprise-router/create-subscription.ts
@@ -54,7 +54,7 @@ export const createSubscriptionRoute = authenticatedProcedure
if (!customerId) {
const customer = await createCustomer({
- name: organisation.name,
+ name: organisation.owner.name || organisation.owner.email,
email: organisation.owner.email,
});
diff --git a/packages/trpc/server/enterprise-router/manage-subscription.ts b/packages/trpc/server/enterprise-router/manage-subscription.ts
index de621ad06..2a66ebd9e 100644
--- a/packages/trpc/server/enterprise-router/manage-subscription.ts
+++ b/packages/trpc/server/enterprise-router/manage-subscription.ts
@@ -77,7 +77,7 @@ export const manageSubscriptionRoute = authenticatedProcedure
// If the customer ID is still missing create a new customer.
if (!customerId) {
const customer = await createCustomer({
- name: organisation.name,
+ name: organisation.owner.name || organisation.owner.email,
email: organisation.owner.email,
});