From 53656446bc045c220517f70ec7c8c54dc60a8d99 Mon Sep 17 00:00:00 2001 From: Zak Timson Date: Sun, 22 Jul 2018 19:12:46 -0400 Subject: [PATCH] More logging --- functions/src/index.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/functions/src/index.ts b/functions/src/index.ts index 11e41be..0014980 100644 --- a/functions/src/index.ts +++ b/functions/src/index.ts @@ -33,6 +33,7 @@ export const checkout = functions.https.onRequest((request, response) => { // Fill in information from DB let promises = []; + console.log(request.body); let cart = request.body.cart.filter(row => row.quantity > 0); cart.forEach(async row => promises.push( @@ -46,6 +47,7 @@ export const checkout = functions.https.onRequest((request, response) => { let products = await Promise.all(promises); req.transactions[0].item_list.items = products.map((row, i) => { const data = row.data(); + console.log(data); return {name: data.name, sku: data.name, price: data.price, currency: 'CAD', quantity: cart[i].quantity}; }); req.transactions[0].amount.total = req.transactions[0].item_list.items.reduce((acc, row, i) => {