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 create-sale.ts

Kiran K12854dff662c
diff --git a/apps/web/lib/integrations/shopify/create-sale.ts b/apps/web/lib/integrations/shopify/create-sale.ts
index 4e87afa00e..2629447ac9 100644
--- a/apps/web/lib/integrations/shopify/create-sale.ts
+++ b/apps/web/lib/integrations/shopify/create-sale.ts
@@ -23,11 +23,13 @@ export async function createShopifySale({
workspaceId: string;
leadData: z.infer<typeof leadEventSchemaTB>;
}) {
+ const order = orderSchema.parse(event);
+
const {
checkout_token: checkoutToken,
confirmation_number: invoiceId,
current_subtotal_price_set: { shop_money: shopMoney },
- } = orderSchema.parse(event);
+ } = order;
const currency = shopMoney.currency_code;
const amount = Number(shopMoney.amount) * 100;
@@ -57,7 +59,7 @@ export async function createShopifySale({
amount,
currency,
invoice_id: invoiceId,
- metadata: JSON.stringify(event),
+ metadata: JSON.stringify(order),
};
const [_sale, link, workspace, customer] = await Promise.all([
@@ -157,7 +159,7 @@ export async function createShopifySale({
eventId,
paymentProcessor,
},
- metadata: event,
+ metadata: order,
});
waitUntil(