#LostInTheWorld

1 messages ยท Page 1 of 1 (latest)

tame ravineBOT
round wigeon
#

๐Ÿ‘‹ Happy to help

prime latch
#

Hi

round wigeon
#

It looks like evt_3M1JLCJ759XI51Ru0qzAB3gw didn't hit the webhook code and some script code was returned in the response

prime latch
#

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

round wigeon
#

Which key are you referring to?

prime latch
#

the secret

round wigeon
#

Do both keys belong to same account?

prime latch
#

yeah

round wigeon
#

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

prime latch
#

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]
round wigeon
#

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?

prime latch
#

It does after the confirm payment, using vue router, but not on server side

round wigeon
#

Does this fix your 307 issue?

prime latch
#

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

round wigeon
#

This response body might be able to give you some hints where the call led to

prime latch
round wigeon
#

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.

prime latch
#

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

prime latch
#

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

round wigeon
#

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?

prime latch
#

Okay I thought maybe it somehow like broadcast the message to hooks no matter what through stripe.

#

yes it does

round wigeon
prime latch
#

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]

round wigeon
#

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?

prime latch
#

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.

round wigeon
#

That's great! Glad to hear that webhook is working ๐Ÿ˜