#sean_event-signature

1 messages ยท Page 1 of 1 (latest)

raven kelpBOT
#

๐Ÿ‘‹ Welcome to your new thread!

โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always 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/1300504395649384510

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

surreal fjord
#

sean_event-signature

#

@umbral onyx I recommend reading https://docs.stripe.com/webhooks/signature end to end to understand what can cause this

Are those Events delivered to the same WebhookEndpoint or different ones for example? Are you properly using UTF-8 encoding?

umbral onyx
#

We have reviewed the signature documentation and are stuck on what is causing our issue

#

We have 5 endpoints for the different object types we consume events for. We updated our config to include SetupIntent for the Customer endpoint we already validated as working and we have the same behavior

#

If a single endpoint properly validates the signature for PaymentIntent events, but fails validation for SetupIntent events then I would assume the encoding is correct.

surreal fjord
#

That assumption might not be true though. Some Events might have characters that the other doesn't that break your code for example

#

Can you share 2 example Event ids: one that works and one that errors?

umbral onyx
#

Do you mean characters in the body of the event?

surreal fjord
#

yes

umbral onyx
#

Yes, one second

#

Sorry that is not correct. One second

#

Failed Event - evt_3QDp1pJmyu3lEqhg1n5NLKLv
Successful Event - evt_1QDBQTJmyu3lEqhgLiX1ncpO

surreal fjord
#

you pasted duplicate Event ids ๐Ÿ˜…

umbral onyx
#

And I misspoke in my original message. PaymentIntent and Charge are failing
Customer, SetupIntent, and Payout are successful

#

LOL

#

Sorry about that. Updated

surreal fjord
#

yeah so you see that failed Event has details such as an email address in there. So I wouldn't be surprised you have an encoding issue on your end that causes the signature verification to fail. We need the exact raw payload that we send you to verify the Event, any change to the content, including encoding, can fail verification

umbral onyx
#

OK, I need ot verify our APIG and SQS configuration in AWS because that is how we consume the WebHook events

surreal fjord
#

yeah it's possible

umbral onyx
#

It will take a little time to look through that. In teh meantime I will have one of my other Devs work on outputing the Event Payload we get within our Lambda function and we can see if anything in the payload might look incorrect compared to the Event messag in Stripe

#

I guess it is suspicious since Charge and PaymentIntent payloads are more similar to each other and are the ones failing

surreal fjord
#

yeah unfortunately this is really hard to debug especially just visually ๐Ÿ˜ฆ

umbral onyx
#

Yea, very much

#

I am going to start with our AWS definitions for APIG and SQS

surreal fjord
umbral onyx
#

So if this is accurate we are using UTF-8
OpenAPI Definition: Make sure your API Gateway's OpenAPI definition file specifies UTF-8 encoding for text payloads1
. This is typically done by setting the Content-Type header to application/json for JSON payloads2
.

#

Because we are using the application/json content type header

surreal fjord
#

possibly. Sorry I have no way to help you with the AWS specific part unfortunately

#

Can you try locally without AWS at all and debug your code to confirm it works as expected? This would help you narrow down the issue

umbral onyx
#

That will take a little more work on our end since we consume everything from SQS