#Alain

1 messages · Page 1 of 1 (latest)

sacred cliffBOT
cobalt pawn
#

Hi there

#

Can you share your webhook endpoint code?

#

It sounds like your signature verification is failing

vernal karma
#

Here the following code in python which is working in test mode :

cobalt pawn
#

Which is likely due to your server manipulating the raw body in some way

#

But let's look

#

Yeah so see how you are using request.body()

#

That is likely the issue

#

You should just be using request.data

#

If you manipulate this body at all then the verification will fail

#

The other thing to check on is that you are using the correct endpoint secret

#

Did you change that to your live one?

vernal karma
#

ones for the test mode and other ones for the production stripe mode

#

what I was struggling to understand is why this exact same code was working in stripe test mode even with the 'request.body()'

cobalt pawn
#

Are you using the same server in test? Or you were testing locally?

vernal karma
#

I'm using the same server for the stripe test and live mode

#

just using different server variable envs

cobalt pawn
#

Hmm then I'm not sure. Something had to have changed.

#

First thing to do would be to switch back to test mode right now and run another test

#

Without changing your code

#

And see if that succeeds

vernal karma
#

Yes it succeeds

#

already tried that 15 mn ago

#

what I plan to do is to try with your suggestion : request.data in test mode

#

and then to switch in prod mode

#

and see if it works

cobalt pawn
#

Yeah that would be a good thing to try as well

#

Very strange that it succeeds in test but not live. It makes me think that it may have to do more with your server config variables than your code

#

But worth trying what you are proposing

vernal karma
#

I'll make an update in this thread as soon as I ran the test

cobalt pawn
#

Sounds good