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 payment-methods.ts

Kiran K7e5a013728b2
diff --git a/apps/web/lib/payment-methods.ts b/apps/web/lib/payment-methods.ts
index 6184e303eb..4a362a2464 100644
--- a/apps/web/lib/payment-methods.ts
+++ b/apps/web/lib/payment-methods.ts
@@ -8,7 +8,7 @@ export const computePayoutFeeForMethod = ({
paymentMethod: Stripe.PaymentMethod.Type;
payoutFee: number | undefined;
}) => {
- if (!paymentMethod || !payoutFee) {
+ if (!paymentMethod || payoutFee === undefined || payoutFee === null) {
throw new Error("Invalid payment method or payout fee.");
}
@@ -19,4 +19,6 @@ export const computePayoutFeeForMethod = ({
if (DIRECT_DEBIT_PAYMENT_METHOD_TYPES.includes(paymentMethod)) {
return payoutFee;
}
+
+ throw new Error(`Unsupported payment method ${paymentMethod}.`);
};