remove un-necessary JSON.parse

This commit is contained in:
Matteo Pagliazzi 2017-03-19 21:31:06 +01:00
parent 771d8f492a
commit 9d456e934c

View file

@ -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) {