#luke.hatakeyama

1 messages ยท Page 1 of 1 (latest)

royal galeBOT
unkempt kindle
#

Interesting. Can you share an event id (evt_123) of an event where delivery was successful and one invoice.paid event id where it failed?

exotic spear
#

sure

#

checkout.session.completed, gets validated properly : "evt_1NXVYiC7VbsPBu2XyWFtoqCG"

#

invoid.paid, gets signature exception : "id": "evt_1NXVYiC7VbsPBu2XotIxH6CQ"

#

they are both triggered by the the same "checkout" event

unkempt kindle
#

Interesting. And you checked server logs to identify it's a signature verification issue?

#

What message did you see exactly?

exotic spear
#

yea

#

i debugged through it as well

#

i didn't screen shot the validated request, but the checkout session webhook gets processed because we don't hit this exceptioon

unkempt kindle
#

Ok. Can you share your webhook endpoint code?

exotic spear
#

sure here's the main handler :

royal galeBOT
exotic spear
unkempt kindle
#

Are you able to reproduce this consistently?

#

Or was this a one-off occurrance?

exotic spear
#

this kept happening, i tried on 3 different accounts

#

i haven't tried since last week though

#

but I tried our official company account in test mode, and two of our devs created personal accounts to try testing too.

we all connected to this hosted endpoint, would change the signing key accordingly (and other secrets / priceid / config values), and would get the same issue

#

But if its not a recognizable bug on your side, i can double check... maybe for some reason for only the invoice.paid requests, we're changing the body when we receive it, such that when we sign it, we get the wrong signature

#

We're also going to try it out in production, and see if we get the same error

violet iris
#

๐Ÿ‘‹ hopping in here to take a look as well - give me a minute to catch up

exotic spear
#

hi! thanks you both for helping

violet iris
#

Are you making sure to treat the event payload you get as UTF8?

#

That would be my guess of why it's failing - the Invoice line items have a description like "1 ร— product", where the "ร—" is a specific unicode character

#

My guess is that you're not handling it has utf8, and so it's being changed to an invalid character, which changes the payload

exotic spear
#

okay that's good to know, lemme look into it

violet iris
#

Yeah I'm pretty sure that's what it is - if you look at that screenshot you sent over with the signature verifcation error you can see that the "description" looks a bit wonky

exotic spear
#

yup i see that too

#

thank you

violet iris
#

๐Ÿ‘