From dbf8e9938ddef6e0050ca962e5ec260791bdb5a9 Mon Sep 17 00:00:00 2001 From: John Yeo Date: Wed, 5 Nov 2025 23:01:58 +0000 Subject: [PATCH] fix: invoice URL not working for account under master --- server/src/internal/invoices/InvoiceService.ts | 10 ++++++++-- server/src/internal/mainRouter.ts | 2 ++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/server/src/internal/invoices/InvoiceService.ts b/server/src/internal/invoices/InvoiceService.ts index 9a71bb609..bbb1b0d46 100644 --- a/server/src/internal/invoices/InvoiceService.ts +++ b/server/src/internal/invoices/InvoiceService.ts @@ -60,11 +60,17 @@ export class InvoiceService { with: { customer: { with: { - org: true, + org: { + with: { + master: true, + }, + }, }, }, }, - })) as Invoice & { customer: Customer & { org: Organization } }; + })) as Invoice & { + customer: Customer & { org: Organization & { master: Organization } }; + }; } static async list({ diff --git a/server/src/internal/mainRouter.ts b/server/src/internal/mainRouter.ts index a702901c0..426a68793 100644 --- a/server/src/internal/mainRouter.ts +++ b/server/src/internal/mainRouter.ts @@ -63,10 +63,12 @@ mainRouter.use( try { const org = invoice.customer.org; const env = invoice.customer.env; + const stripeCli = createStripeCli({ org, env, }); + const stripeInvoice = await stripeCli.invoices.retrieve( invoice.stripe_id, );