From 9d456e934c16169fd652e2e7d70e49b932e11558 Mon Sep 17 00:00:00 2001 From: Matteo Pagliazzi Date: Sun, 19 Mar 2017 21:31:06 +0100 Subject: [PATCH] remove un-necessary JSON.parse --- website/server/libs/stripePayments.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/website/server/libs/stripePayments.js b/website/server/libs/stripePayments.js index 476c2d6e7f..a5ac73ae8b 100644 --- a/website/server/libs/stripePayments.js +++ b/website/server/libs/stripePayments.js @@ -286,11 +286,8 @@ api.handleWebhooks = async function handleWebhooks (options, stripeInc) { let stripeApi = stripe; if (stripeInc) stripeApi = stripeInc; - const eventJSON = JSON.parse(requestBody); - console.log(eventJSON); - // Verify the event by fetching it from Stripe - const event = await stripeApi.events.retrieve(eventJSON.id); + const event = await stripeApi.events.retrieve(requestBody.id); console.log(event); switch (event.type) {