#asd-webhook-redirect

1 messages · Page 1 of 1 (latest)

undone ivyBOT
grave bloom
#

Hello 👋
Did you add more logging to your server-side code as suggested in the previous thread?

uncut oak
#

gimme a sec and I add it

#

added

#

and it seems to hit the server

grave bloom
#

are you able to print $sig_header ?

uncut oak
#

all right

#

I printed it

grave bloom
#

What value do you see?

uncut oak
#

nothing

#

it seems an empty string

grave bloom
#

I think that's the issue here
What happens if you print $_SERVER ?

uncut oak
#

it prints this

grave bloom
#

Try printing $_SERVER['HTTP_STRIPE_SIGNATURE']

uncut oak
#

still empty string

#

and this error

lime dawn
#

How are you sending these webhooks to your endpoint? Is this with the CLI or by making things happen on the account? Or are you manually sending them with something like Postman?

uncut oak
#

I'm just clicking on the link of my webhook, 'cause I don't have the stripe signature headers to send the request with postman

lime dawn
#

As in you are just navigating to the URL of your webhook in a browser, rather than sending events there?

uncut oak
#

yep

#

I know that it is not the right way to send requests to the webhook

lime dawn
#

Gotcha, it would be expected for that header to be empty then

#

That header is something that Stripe sets on our servers before sending the event out. It only makes sense in the context of a Stripe event and only Stripe makes them, so that header won't show up outside of that context

uncut oak
#

okay, but that problem appears even if it is stripe to send it

#

He tested that and it returned the same error

lime dawn
#

That sounds like it failed similarly but in a different way. Can you try sending an event from Stripe to your endpoint and send me what happens when you print $_SERVER from that if it still can't find that header?

uncut oak
#

I can't see the response because it gives me 301 status code

uncut oak
lime dawn
#

If your code doesn't execute when you send an event, it sounds like something in your server's config is causing that

uncut oak
#

it executes the code, but only if an error occurs it redirects it to an error landing page

#

so I cannot see the first page that has been requested

uncut oak
# uncut oak

he could see it, if you send me a curl to make requests with signature header to the endpoint I could see that too

lime dawn
#

Right, that would happen for me too. Now the question is more why this is happening and unfortunately ynoj and I can't figure that out on our side.

uncut oak
#

okay I'll try, but it is strange 'cause if it is stripe to send the event how is possible that it doesn't find the signature header?

lime dawn
#

That would either be because Stripe isn't setting it or because your application is modifying something after the event is received. If you have a specific event ID sent to your endpoint from our side, I can double check that we sent the header properly, but you'll need to actually send an event to check that

#

That being said. I've never not seen this properly set on an event, so it is more likely to be a server side error

uncut oak
#

okay now I send you an event id

#

evt_3MRedFBWfwutbSUW0nNwUtXF

lime dawn
#

We definitely sent that header for that event.

#

Looks like we actually got the 301 there

uncut oak
lime dawn
uncut oak
#

can't you check what is the location where it was redirected?

lime dawn
#

I DM'd you the URL

dense torrent
#

asd-webhook-redirect

uncut oak
#

it is the same url that I put in the webhook

dense torrent
#

sure, that's a common problem. It still really just means your own server is doing the redirect. We (Stripe) don't control any of this

#

so you have to debug this on your end