From 2ee0d7787043f0412210492c541ef7488adc83d7 Mon Sep 17 00:00:00 2001 From: David Nguyen Date: Tue, 5 Aug 2025 12:30:02 +1000 Subject: [PATCH] fix: correctly set stripe customer names (#1939) Currently the Stripe customer name is set to the organisation name, which in some cases is just the organisation name. This update makes it so it uses the owner name instead. --- packages/trpc/server/enterprise-router/create-subscription.ts | 2 +- packages/trpc/server/enterprise-router/manage-subscription.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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, });