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.

simplify the display

Kiran K49bf3d899f9d
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/billing/invoices/page-client.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/billing/invoices/page-client.tsx
index f7f6d8ee97..c6ff4be134 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/billing/invoices/page-client.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/billing/invoices/page-client.tsx
@@ -5,7 +5,6 @@ import useWorkspace from "@/lib/swr/use-workspace";
import { InvoiceProps } from "@/lib/types";
import { PayoutStatusBadges } from "@/ui/partners/payout-status-badges";
import { AnimatedEmptyState } from "@/ui/shared/animated-empty-state";
-import { PaymentMethod } from "@dub/prisma/client";
import {
Button,
buttonVariants,
@@ -110,7 +109,8 @@ const InvoiceCard = ({
invoice: InvoiceProps;
displayPaymentMethod: boolean;
}) => {
- const paymentMethod = getPaymentMethodDisplay(invoice.paymentMethod ?? "ach");
+ const paymentMethod =
+ PAYMENT_METHODS[invoice.paymentMethod ?? "us_bank_account"];
return (
<div
@@ -238,24 +238,3 @@ const InvoiceCardSkeleton = ({
</div>
);
};
-
-function getPaymentMethodDisplay(paymentMethod: PaymentMethod) {
- switch (paymentMethod) {
- case "ach":
- return PAYMENT_METHODS["us_bank_account"];
- case "ach_fast":
- return {
- ...PAYMENT_METHODS["us_bank_account"],
- label: "FAST ACH",
- duration: "2 business days",
- };
- case "card":
- return PAYMENT_METHODS["card"];
- case "sepa":
- return PAYMENT_METHODS["sepa_debit"];
- case "acss":
- return PAYMENT_METHODS["acss_debit"];
- default:
- return null;
- }
-}
diff --git a/apps/web/lib/payment-methods.ts b/apps/web/lib/payment-methods.ts
index 9249c9c29a..658e3db53b 100644
--- a/apps/web/lib/payment-methods.ts
+++ b/apps/web/lib/payment-methods.ts
@@ -55,4 +55,10 @@ export const PAYMENT_METHODS = Object.freeze({
icon: GreekTemple,
duration: "5 business days",
},
+ ach_fast: {
+ label: "Fast ACH",
+ type: "ach",
+ icon: GreekTemple,
+ duration: "2 business days",
+ },
});