Skip to content

Commit 8e452c0

Browse files
authored
fix(commerce): avoid overriding email when updating subscription (#6888)
1 parent 96c7b87 commit 8e452c0

File tree

1 file changed

+0
-14
lines changed
  • packages/services/commerce/src/stripe-billing

1 file changed

+0
-14
lines changed

packages/services/commerce/src/stripe-billing/index.ts

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { addDays, startOfMonth } from 'date-fns';
2-
import { Stripe } from 'stripe';
32
import { z } from 'zod';
43
import { publicProcedure, router } from '../trpc';
54

@@ -202,19 +201,6 @@ export const stripeBillingRouter = router({
202201
}
203202
}
204203
}
205-
206-
const updateParams: Stripe.CustomerUpdateParams = {};
207-
208-
if (organizationBillingRecord.billingEmailAddress) {
209-
updateParams.email = organizationBillingRecord.billingEmailAddress;
210-
}
211-
212-
if (Object.keys(updateParams).length > 0) {
213-
await ctx.stripeBilling.stripe.customers.update(
214-
organizationBillingRecord.externalBillingReference,
215-
updateParams,
216-
);
217-
}
218204
} else {
219205
throw new Error(
220206
`Failed to sync subscription for organization: failed to find find active record`,

0 commit comments

Comments
 (0)