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,