From a8964793af191c9fc7197dd08dec5433bc24f277 Mon Sep 17 00:00:00 2001 From: adueck Date: Thu, 13 Oct 2022 19:56:40 +0500 Subject: [PATCH] debug --- account/src/routers/payment-router.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/account/src/routers/payment-router.ts b/account/src/routers/payment-router.ts index fa71803..b97752a 100644 --- a/account/src/routers/payment-router.ts +++ b/account/src/routers/payment-router.ts @@ -8,6 +8,8 @@ const stripe = new Stripe(env.stripeSecretKey, { }); const paymentRouter = express.Router(); +const endpointSecret = env.stripeWebhookSecret; +console.log({ endpointSecret }); paymentRouter.post( '/webhook', @@ -18,12 +20,13 @@ paymentRouter.post( // If you are testing with the CLI, find the secret by running 'stripe listen' // If you are using an endpoint defined with the API or dashboard, look in your webhook settings // at https://dashboard.stripe.com/webhooks - const endpointSecret = env.stripeWebhookSecret; // Only verify the event if you have an endpoint secret defined. // Otherwise use the basic event deserialized with JSON.parse if (endpointSecret) { // Get the signature sent by Stripe const signature = request.headers['stripe-signature'] || ""; + console.log(request.headers); + console.log({ signature, endpointSecret }); try { event = stripe.webhooks.constructEvent( request.body,