The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
address feedback from coderabbit
Kiran Kdb3d4b80cd47
diff --git a/apps/web/lib/partners/constants.ts b/apps/web/lib/partners/constants.tsindex ae0d051b5f..5795b6a860 100644--- a/apps/web/lib/partners/constants.ts+++ b/apps/web/lib/partners/constants.ts@@ -1,4 +1,5 @@import Stripe from "stripe";+import { PaymentMethodOption } from "../types";export const PAYOUTS_SHEET_ITEMS_LIMIT = 10;export const REFERRALS_EMBED_EARNINGS_LIMIT = 8;@@ -27,7 +28,7 @@ export const DIRECT_DEBIT_PAYMENT_TYPES_INFO: {location: string;title: string;icon: string;- option: any;+ option: PaymentMethodOption;}[] = [{type: "us_bank_account",@@ -42,7 +43,7 @@ export const DIRECT_DEBIT_PAYMENT_TYPES_INFO: {title: "ACSS Debit",icon: "https://hatscripts.github.io/circle-flags/flags/ca.svg",option: {- currency: "usd",+ currency: "cad",mandate_options: {payment_schedule: "sporadic",transaction_type: "business",diff --git a/apps/web/lib/payment-methods.ts b/apps/web/lib/payment-methods.tsindex d8fff13667..bb20e872dc 100644--- a/apps/web/lib/payment-methods.ts+++ b/apps/web/lib/payment-methods.ts@@ -17,6 +17,10 @@ export const calculatePayoutFee = ({const planType = plan?.split(" ")[0] ?? "business";+ if (!Object.keys(PAYOUT_FEES).includes(planType)) {+ return null;+ }+if (["link", "card"].includes(paymentMethod)) {return PAYOUT_FEES[planType].card;}diff --git a/apps/web/lib/types.ts b/apps/web/lib/types.tsindex 2746d16e91..a12baa6e9b 100644--- a/apps/web/lib/types.ts+++ b/apps/web/lib/types.ts@@ -475,3 +475,11 @@ export type ProgramData = z.infer<typeof programDataSchema>;export type ProgramMetrics = z.infer<typeof ProgramMetricsSchema>;export type PayoutMethod = "stripe" | "paypal";++export type PaymentMethodOption = {+ currency?: string;+ mandate_options?: {+ payment_schedule?: string;+ transaction_type?: string;+ };+};