#mulo_node-webhook-silentfail

1 messages ยท Page 1 of 1 (latest)

sinful muralBOT
topaz acornBOT
#

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

sinful muralBOT
#

๐Ÿ‘‹ Welcome to your new thread!

โฒ๏ธ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).

โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can start a new thread if you have another question.

๐Ÿ”— This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1253764906591715358

๐Ÿ“ Have more to share? Add details, code, screenshots, videos, etc. below.

trim locust
#

Hi ๐Ÿ‘‹

What is your actual question here?

thin imp
#
(request, response) {
  const data = request.body;
  const invoice = data.data.object;
 const customMetadata = invoice.lines.data[0].metadata.custom;

    console.log(customMetadata, '<<<<<<<< stripe') //THIS IS GETTING LOGGED
    const sig = request.headers['stripe-signature'];
  let event;
  try {
    event = stripe.webhooks.constructEvent(request.body, sig, 'weboohkey');
    } catch (err) {
   console.log(err)//NO err
}
 console.log('STRIPE PAYMENT') // This is NOT logged
#

console.log('STRIPE PAYMENT') // This is NOT logged

trim locust
#

Still not a question

thin imp
#

is like as if the execution stops at the try catch without errors

#

is the

  event = stripe.webhooks.constructEvent(request.body, sig, 'weboohkey');
``` look correct?
trim locust
#

Then you should put some logging inside the try block

#

No

thin imp
trim locust
#

Unless you are substituting the 'wehoohkey' with an actual webhook key

thin imp
#

yes i am

#

ofc

trim locust
#

And No, that log is not INSIDE the try block

#

the only line inside the try block is the event = stripe.webhooks.constructEvent(request.body, sig, 'weboohkey');

#

Between the curly braces {}

thin imp
#
try {
      event = stripe.webhooks.constructEvent(request.body, sig, 'we_1PSG3D.....m26JA5aB');
    } catch (err) {
      console.log(err)
      response.status(400).send(`Webhook Error: ${err.message}`);
      return;
    }
trim locust
#

Still nope

thin imp
#

that is what I have, there were chars limitation on the embed

trim locust
#
try {
      // Put some logging here
      event = stripe.webhooks.constructEvent(request.body, sig, 'we_1PSG3D.....m26JA5aB');
    } catch (err) {
      console.log(err)
      response.status(400).send(`Webhook Error: ${err.message}`);
      return;
    }
#

Also I want to make sure you are aware of known issues with Node and Express and our webhooks. It's explained pretty well here: https://github.com/stripe/stripe-node/issues/331

But you haven't reached the point where your signature verification is failing yet.