#ced001

1 messages ยท Page 1 of 1 (latest)

pliant tigerBOT
dusty tinsel
#

Hi there ๐Ÿ‘‹ the most common reasons for that error being encountered, are either the wrong webhook signing secret being used, or the payload body being passed has been altered.

Each webhook endpoint generates it's own signing secret, as well as the Stripe CLI. So if you're deploying this code on a fresh endpoint I would recommend triple checking that value is correct and that there aren't any leading/trailing characters that got included when the key was being copy/pasted.

The other common problem is with the payload body. Typically what happens there is another part of the ingress layer tries to be helpful by starting to parse the data. Our verification process is very sensitive right now, and even changes in whitespace within the request body will cause it to fail. When you log the request body to your console, does it look like it may be getting trimmed or adjusted?

swift stream
#

Thank you, will quadrupplecheck the secret.

The body is the raw buffer. And that's the way it should be passed back, right?

dusty tinsel
#

Yup, I try to use the raw buffer whenever I'm testing that flow, and that has worked well for me.

swift stream
#

I've triec the whsec_...-secret that was generated in the "tutorial" when I created the hook, and the we_-secret that is visible on the webhook page after creation.

The data objects are identical from what I can tell... This is weird

#

the payload*

dusty tinsel
#

You should be using the whsec_ value from the webhook endpoint page in your dashboard, or the secret that was provided in the API response if you created the endpoint programmatically.

#

To find the right secret after creating an endpoint:

swift stream
#

Oh thats it! ๐Ÿ˜„ That was not well documented? How come I got hold of two other secrets before you told me that? x)

#

Thank you so much! ๐Ÿ˜„

#

Ooooh, NOW I read the comment in the "tutorial" // This is your Stripe CLI webhook secret for testing your endpoint locally.

#

Thanks for ducking! ๐Ÿฆ†

dusty tinsel
#

Any time!

#

Glad to hear you were able to get that resolved.

swift stream
#

This service was amazing I have to say... Wow