#k1ng

1 messages · Page 1 of 1 (latest)

topaz daggerBOT
void summit
#

hello!

When running into issues with checking/verifying the signature of a webhook event sent to your endpoint, there are typically one of two root causes:

  1. The webhook secret in your code does not match the one defined in the webhook. You would want to try logging the webhook secret during runtime to verify if it's correct.

Note : If you're using the Stripe CLI to forward events on to a local endpoint, you should make sure that you're using the CLI webhook secret instead. The CLI's webhook secret is different from the secret of the webhook endpoint(s) defined via the Dashboard/API.

  1. The data you're signing is simply different from the data Stripe signed. This can happen if you're using a framework that tries to be helpful and parses the event data as JSON. Because of this, when a user calculates their own signature, they do this on a string that is subtly different. For example, the order of properties might have changed or the indentation would be different. For the signatures to match, you need to calculate it on the exact same raw string as Stripe did. For this, you'll need to ensure that you get the raw body of the HTTP request that Stripe sends you, without any interference by your code or any other framework in the middle.
urban badger
#

hey @void summit i tried literally everything, can you hop on vc?

void summit
#

i'm afraid we don't do vc, can you paste what's the output of the raw req body, just before you use constructEvent?

topaz daggerBOT
urban badger
#

thats the buf variable right before
event = stripe.webhooks.constructEvent(buf, sig, webhookSecret)

fiery nexus
#

Hi @urban badger I'm taking over

urban badger
#

hey Jack

fiery nexus
#

Thanks for the ID

#

FUNCTION_INVOCATION_TIMEOUT```

This is the error that your server returns. I'd suggest you to check your server log and troubleshoot
urban badger
#

@fiery nexus im getting this: : No signatures found matching the expected signature for payload.

#

let me send u the server file to look at

fiery nexus
#

Can you double check if the webhook secret is the one you obtained from test mode Dashboard instead of Stripe CLI?

urban badger
#

@fiery nexus yep its from the dashboard

#

wait jack, it just worked