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.

rearrange

Steven Tey2ddaecf16336
diff --git a/apps/web/app/api/stripe/integration/webhook/checkout-session-completed.ts b/apps/web/app/api/stripe/integration/webhook/checkout-session-completed.ts
index 11a7e0f8d1..9cc498675b 100644
--- a/apps/web/app/api/stripe/integration/webhook/checkout-session-completed.ts
+++ b/apps/web/app/api/stripe/integration/webhook/checkout-session-completed.ts
@@ -200,8 +200,8 @@ export async function checkoutSessionCompleted(event: Stripe.Event) {
if (charge.currency && charge.currency !== "usd" && charge.amount_total) {
// support for Stripe Adaptive Pricing: https://docs.stripe.com/payments/checkout/adaptive-pricing
if (charge.currency_conversion) {
- charge.amount_total = charge.currency_conversion.amount_total;
charge.currency = charge.currency_conversion.source_currency;
+ charge.amount_total = charge.currency_conversion.amount_total;
// if Stripe Adaptive Pricing is not enabled, we convert the amount to USD based on the current FX rate
// TODO: allow custom "defaultCurrency" on workspace table in the future
@@ -212,8 +212,8 @@ export async function checkoutSessionCompleted(event: Stripe.Event) {
amount: charge.amount_total,
});
- charge.amount_total = convertedAmount;
charge.currency = convertedCurrency;
+ charge.amount_total = convertedAmount;
}
}