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.

Add currency handling in Shopify sale creation

Kiran K41c7ee54f8e1
diff --git a/apps/web/lib/integrations/shopify/create-sale.ts b/apps/web/lib/integrations/shopify/create-sale.ts
index 4466c1cd82..ab7e488709 100644
--- a/apps/web/lib/integrations/shopify/create-sale.ts
+++ b/apps/web/lib/integrations/shopify/create-sale.ts
@@ -34,6 +34,7 @@ export async function createShopifySale({
const amount = Number(shopMoney.amount) * 100;
const { link_id: linkId } = leadData;
+ const currency = shopMoney.currency_code.toLowerCase();
// Skip if invoice id is already processed
const ok = await redis.set(
@@ -57,7 +58,7 @@ export async function createShopifySale({
event_name: "Purchase",
payment_processor: "shopify",
amount,
- currency: shopMoney.currency_code.toLowerCase(),
+ currency,
invoice_id: invoiceId,
metadata: JSON.stringify(order),
};
@@ -158,6 +159,7 @@ export async function createShopifySale({
amount,
earnings: saleEarnings,
invoiceId,
+ currency,
},
});