#lt_webhooks

1 messages ยท Page 1 of 1 (latest)

vivid ginkgoBOT
#

๐Ÿ‘‹ Welcome to your new thread!

โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

๐Ÿ”— This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1232077236027260938

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

next flintBOT
#

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

narrow viper
#

Hi there!

#

Are there any other logs you can look at on your webhook endpoint to determine how it's handling the POST requests from Stripe?

#

I see we're attempting to make a request to your endpoint but the endpoint is returning a 400 response

tame scroll
#

Yes -- ill send a screenshot of the stripe CLI logs and then what i get in the dashboard

narrow viper
#

Ah, no, not the logs I'm referring to. Are there any logs you can pull from bookservo.com... that show the requests from Stripe?

tame scroll
#

well right now im working on this feature locally

#

if i get 200 responses on the cli, why does the dashboard show 400?

narrow viper
#

Okay. The 400 errors you see are tied to the requests we're making to bookservo.com/api/payments/update-vendor-status. That endpoint is returning an error when Stripe is making POST requests to it. It sounds like this is expected if you haven't already set up this endpoint to receive requests from Stripe though

tame scroll
#

how would i do that?

#

i believe i do have the endpoint set up. Are these the logs you were talking about

narrow viper
#

I removed the image since it included your webhook secret

tame scroll
#

thank you ๐Ÿ™

narrow viper
#

Yes, those are the logs I'm referring to. I recommend looking through your event handler code for this endpoint to see what logic is resulting in that 400 response to Stripe

#

In that particular case in the screenshot, it looked like there was an event type that was unhandled by your logic

tame scroll
#

so those logs all show 200 responses

#

that was expected; i have a switch case that shows deals with different events. The unhandled event types still return a 200 response. Let me send you a screenshot without the endpoint secret

#

My first question is: if i am in test mode on the stripe developer dashboard, shouldnt i be seeing those 200 responses?

#

and secondly, I have a compeltely different webhook endpoint that we are using for other functionality, and it works fine on production but this one keeps returning 400 errors "Bad Request" on production as well

#

this is the bad request error it gives me on production server:

narrow viper
#

My first question is: if i am in test mode on the stripe developer dashboard, shouldnt i be seeing those 200 responses?
Not exactly. Just to be clear, you're logged into the CLI as your platform account (the account that manages acct_1P8UGZC2c8GHeeye)? If so, you'll see the local listeners in the Dashboard but not the logs for these, just the listening status: https://dashboard.stripe.com/test/webhooks

tame scroll
#

Oh okay that makes sense.

narrow viper
#

Also, note that the webhook secret used for a local listener with the CLI is completely different from the webhook secret used for an endpoint

tame scroll
#

right. the webhook secret used for an endpoint is the signing secret, correct?

narrow viper
#

When you use stripe listen in the CLI, you'll see a webhook signing secret in your terminal window. This signing secret will not match any of the signing secrets tied to webhook endpoints you've set up in the Dashboard (or via the API)

tame scroll
#

Right. What am i supposed to do with the endpoint secret I get when setting it up on the dashboard

#

do i have the change the endpoint secret in this method?

narrow viper
#

If this is not the handler code you're using for local testing, endpoint_secret = ENV['STRIPE_ENDPOINT_SECRET'] should use the endpoint secret from the Dashboard

tame scroll
#

got it! makes much more sense now. Thank you for your help!

narrow viper
#

Sure thing!

vivid ginkgoBOT