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.

handle huf and twd

Steven Tey8b5fe601f381
diff --git a/apps/web/app/(ee)/api/stripe/connect/webhook/balance-available.ts b/apps/web/app/(ee)/api/stripe/connect/webhook/balance-available.ts
index e39638894e..1923c2c122 100644
--- a/apps/web/app/(ee)/api/stripe/connect/webhook/balance-available.ts
+++ b/apps/web/app/(ee)/api/stripe/connect/webhook/balance-available.ts
@@ -171,6 +171,12 @@ export async function balanceAvailable(event: Stripe.Event) {
availableBalance = updatedBalance.available[0].amount;
}
+ if (["huf", "twd"].includes(currency)) {
+ // For HUF and TWD, Stripe requires payout amounts to be evenly divisible by 100
+ // We need to round down to the nearest 100 units
+ availableBalance = Math.floor(availableBalance / 100) * 100;
+ }
+
const payout = await stripe.payouts.create(
{
amount: availableBalance,