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.

round to nearest cent

Steven Tey3b80be5a891a
diff --git a/apps/web/app/(ee)/api/shopify/integration/webhook/orders-paid.ts b/apps/web/app/(ee)/api/shopify/integration/webhook/orders-paid.ts
index a2e4a77be4..b208d75135 100644
--- a/apps/web/app/(ee)/api/shopify/integration/webhook/orders-paid.ts
+++ b/apps/web/app/(ee)/api/shopify/integration/webhook/orders-paid.ts
@@ -15,7 +15,6 @@ export async function ordersPaid({
const { customer: orderCustomer, checkout_token: checkoutToken } =
orderSchema.parse(event);
- // If no customer, th
if (orderCustomer) {
const { id: externalId } = orderCustomer;
diff --git a/apps/web/lib/integrations/shopify/create-sale.ts b/apps/web/lib/integrations/shopify/create-sale.ts
index b8fddd86f3..674dfaf175 100644
--- a/apps/web/lib/integrations/shopify/create-sale.ts
+++ b/apps/web/lib/integrations/shopify/create-sale.ts
@@ -31,7 +31,7 @@ export async function createShopifySale({
current_subtotal_price_set: { shop_money: shopMoney },
} = order;
- const amount = Number(shopMoney.amount) * 100;
+ const amount = Math.round(Number(shopMoney.amount) * 100); // round to nearest cent
const { link_id: linkId } = leadData;
const currency = shopMoney.currency_code.toLowerCase();