#LostInTheWorld
1 messages ยท Page 1 of 1 (latest)
๐ Happy to help
Hi
Error 500 was returned from your server to Stripe. I'd recommend checking the error message that your server returned here: https://dashboard.stripe.com/test/events/evt_3M1JLCJ759XI51Ru0qzAB3gw
It looks like evt_3M1JLCJ759XI51Ru0qzAB3gw didn't hit the webhook code and some script code was returned in the response
The 500 seem to be I think okay and header based from what I read because the key different possibly from when the payment intent is created
Which has a different key then the one from the hook
Which key are you referring to?
the secret
Do both keys belong to same account?
yeah
If both keys belong to same account, then it doesn't matter
Even if the key is different, you should be able to see your logging since signature verification is after this logging
This is likely some configurations in your server that causes event not reaching to the webhook endpoint and throws 500 before that
hmm... I guess confused because there is those success ones in between
I know if I make it http as the listen forward it ends up redirect with 307
2022-11-06 18:11:17 <-- [307] POST http://localhost:8000/webhook/stripe [evt_3M1KnwJ759XI51Ru1pbvqlG1]
2022-11-06 18:11:30 --> payment_intent.succeeded [evt_3M1KnwJ759XI51Ru1cBAcIkc]
2022-11-06 18:11:30 <-- [307] POST http://localhost:8000/webhook/stripe [evt_3M1KnwJ759XI51Ru1cBAcIkc]
2022-11-06 18:11:30 --> charge.succeeded [evt_3M1KnwJ759XI51Ru1BWr3ZT4]
2022-11-06 18:11:30 <-- [307] POST http://localhost:8000/webhook/stripe [evt_3M1KnwJ759XI51Ru1BWr3ZT4]
All these response codes were returned from your server to Stripe, so we do not have information about your server configurations.
Does your server/configuration perform any redirection somewhere?
It does after the confirm payment, using vue router, but not on server side
I figured the 307 was cause this though https://stackoverflow.com/questions/64432992/symfony-5-stripe-webhook-redirection-307
Does this fix your 307 issue?
yeah, but then has those 500 errors when I use this as my listen .\stripe.exe listen -f https://localhost:8000/webhook/stripe and I don't see logs happening so it doesn't seem like getting hit
Based on your response to Stripe (https://dashboard.stripe.com/test/events/evt_3M1JLCJ759XI51Ru0qzAB3gw), it looks like there might be some configuration issue that didn't reach to your webhook endpoint correctly and return this script.
This response body might be able to give you some hints where the call led to
That is where I am confused because that seems okay since it hits a different route. And that intent it made client side. When I look on log in stripe nothing looks out of place.
It's likely the route configuration isn't correct. I'd recommend starting with a smaller scaled POST /hello-world endpoint with 200 returned in the server and test it with postman or cURL. Once you get the configuration working, then you apply the same to stripe webhook.
that seems fine ``` curl -d https://localhost:8000/webhook/stripe
StatusCode : 200
StatusDescription : OK
Content : helloWorld
RawContent : HTTP/1.1 200 OK
X-Debug-Token: 931f69
X-Debug-Token-Link: https://localhost:8000/_profiler/931f69
X-Robots-Tag: noindex
Connection: close
Content-Length: 10
Cache-Control: no-cache, private
Con...
Forms : {}
Headers : {[X-Debug-Token, 931f69], [X-Debug-Token-Link, https://localhost:8000/_profiler/931f69],
[X-Robots-Tag, noindex], [Connection, close]...}
Images : {}
InputFields : {}
Links : {}
ParsedHtml : mshtml.HTMLDocumentClass
RawContentLength : 10
Okay I found the message in the server log so @hollow dagger thanks. It must of been lost in the many logs. So it is hitting that endpoint correctly. @round wigeon As far as those 500 errors it must be related to this https://github.com/stripe/stripe-cli/issues/857 in combination i'm thinking with https://groups.google.com/a/lists.stripe.com/g/api-discuss/c/HhfsApXFMwM/m/vLDDI8zJCwAJ bullet point two. "this endpoint might be running in a context where the incoming request is not actually a webhook โ note that a webhook endpoint should be be a separate endpoint and route in your system from perhaps the success_url of a CheckoutSession or the endpoint for charging a payment token, in case there is any confusion there." kind of makes sense, but hoping you can share more light on that if that seems correct
This paragraph refers to that the endpoint in success_url in Checkout Session creation should be different from the one used for receiving webhook endpoint
It's a different context in this case since you're receiving webhook event directly with Stripe CLI
If you don't implement any Stripe webhook code and return 200 directly, does it work?
Okay I thought maybe it somehow like broadcast the message to hooks no matter what through stripe.
yes it does
Even when checkout.session.completed event is received?
yep
I am no so familiar with all events in stripe yet so I am thinking yes based on intent.succeeded ```2022-11-06 18:36:13 <-- [204] POST https://localhost:8000/webhook/stripe [evt_3M1LBjJ759XI51Ru1n2f5a5d]
2022-11-06 18:37:12 --> payment_intent.created [evt_3M1LD1J759XI51Ru0lGkEViJ]
2022-11-06 18:37:13 <-- [204] POST https://localhost:8000/webhook/stripe [evt_3M1LD1J759XI51Ru0lGkEViJ]
2022-11-06 18:37:25 --> charge.succeeded [evt_3M1LD1J759XI51Ru0en125RC]
2022-11-06 18:37:25 --> payment_intent.succeeded [evt_3M1LD1J759XI51Ru0lyTDWJm]
2022-11-06 18:37:26 <-- [204] POST https://localhost:8000/webhook/stripe [evt_3M1LD1J759XI51Ru0en125RC]
2022-11-06 18:37:26 <-- [204] POST https://localhost:8000/webhook/stripe [evt_3M1LD1J759XI51Ru0lyTDWJm]
2022-11-06 18:53:26 --> payment_intent.created [evt_3M1LSjJ759XI51Ru0Pgm1zNC]
2022-11-06 18:53:27 <-- [204] POST https://localhost:8000/webhook/stripe [evt_3M1LSjJ759XI51Ru0Pgm1zNC]
2022-11-06 18:54:36 --> payment_intent.succeeded [evt_3M1LSjJ759XI51Ru0CnioIYE]
2022-11-06 18:54:36 --> charge.succeeded [evt_3M1LSjJ759XI51Ru0Njvz7cs]
2022-11-06 18:54:36 <-- [204] POST https://localhost:8000/webhook/stripe [evt_3M1LSjJ759XI51Ru0CnioIYE]
2022-11-06 18:54:37 <-- [204] POST https://localhost:8000/webhook/stripe [evt_3M1LSjJ759XI51Ru0Njvz7cs]
Receiving webhook events work all the same, so it doesn't matter what the event type is
If you implement original code line by line, i.e. add one line and test webhook event, then move on to add new line only after it succeeds, where does error start to return?
Looks like working fine ๐คฆโโ๏ธ I think was my own fault with error_log() passing in the wrong message type the whole type was throwing 500s and not saying anything. Thanks for your help everything seems good now.
That's great! Glad to hear that webhook is working ๐