Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

update invoice with Fast ACH fees

Kiran K099e76f86ac0
diff --git a/apps/web/app/(ee)/app.dub.co/invoices/[invoiceId]/partner-payout-invoice.tsx b/apps/web/app/(ee)/app.dub.co/invoices/[invoiceId]/partner-payout-invoice.tsx
index d4b4f206f1..df26790db2 100644
--- a/apps/web/app/(ee)/app.dub.co/invoices/[invoiceId]/partner-payout-invoice.tsx
+++ b/apps/web/app/(ee)/app.dub.co/invoices/[invoiceId]/partner-payout-invoice.tsx
@@ -143,6 +143,14 @@ export async function PartnerPayoutInvoice({
label: `Platform fees (${Math.round((invoice.fee / invoice.amount) * 100)}%)`,
value: `${currencyFormatter(invoice.fee / 100)}`,
},
+ ...(invoice.paymentMethod === "ach_fast"
+ ? [
+ {
+ label: "Fast ACH fees",
+ value: "$25.00",
+ },
+ ]
+ : []),
{
label: "Invoice total",
value: `${currencyFormatter(invoice.total / 100)}${nonUsdTransactionDisplay}`,
diff --git a/apps/web/app/(ee)/app.dub.co/invoices/[invoiceId]/route.tsx b/apps/web/app/(ee)/app.dub.co/invoices/[invoiceId]/route.tsx
index 345b08db3c..cc725b14e4 100644
--- a/apps/web/app/(ee)/app.dub.co/invoices/[invoiceId]/route.tsx
+++ b/apps/web/app/(ee)/app.dub.co/invoices/[invoiceId]/route.tsx
@@ -36,7 +36,7 @@ export const GET = withSession(async ({ session, params }) => {
if (!userInWorkspace) {
throw new DubApiError({
code: "unauthorized",
- message: "You are not authorized to view this invoice",
+ message: "You are not authorized to view this invoice.",
});
}
@@ -61,7 +61,7 @@ export const GET = withSession(async ({ session, params }) => {
});
}
- return new Response(pdf, {
+ return new Response(new Uint8Array(pdf), {
headers: {
"Content-Type": "application/pdf",
"Content-Disposition": `inline; filename="Invoice-${invoice.number}.pdf"`,