#troymeout_webhooks
1 messages ¡ Page 1 of 1 (latest)
đ 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/1262482844857401415
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
I'm calling the Stripe CLI with "stripe events resend evt_1PctXhJZ7tosECMgAYBis8YJ -v 2022-11-15"
Hello
Looking at the initial event in the dashboard, it has the correct version already.
Webhooks are created as a snapshot based on the versions of the endpoints and the default on your account. If you are trying to resend, you can only resend in one of those versions in which it was created.
I am trying to resend in the version it was created
Event id in the Stripe Dashboard shows "2022-11-15" for "evt_1PctagJZ7tosECMgEaQgTc8w"
Are you viewing it as a platform?
What do yo umean as a platform?
I can see that Webhook was sent to platforms and the merchant account itself.
Ah hold on
So running the CLI locally, what do i need to do to maintain the version that it was originally sent as?
sure thing.
I do see one of the endpoints has that version
Right, it doesn't look like it was resent to that endpoint since you didn't pass --webhook-endpoint (see: https://docs.stripe.com/cli/events/resend)
Try adding --webhook-endpoint=we_1PLc81JZ7tosECMg21wIOs5w to your command
Yeah that looks like it sent it to the actual endpoint that it initially went to.
I'm working on something locally so need it to go to my localhost
You should be able to forward to localhost in that case.
AKA called this earlier: stripe-listen --forward-to http://localhost/inksoft/config/stripewebhook
And I'm getting the webhook but it has the wrong version so it fails. I can't get it to pass the correct version.
Even if you do that and you resend using the endpoint I stated above?
Idk what happens when i send to the endpoint you sent me. it doesn't come to my localhost when i do that, sends it to the version that is out on the server
I would expect this parameter to fix the issue but it doesn't change anything:
-v, --stripe-version <version>
string
Specify the Stripe API version to use for this request.
Interesting, can you send me the ID of an event that you resent with a specific version so that I can take a look?
Can you please sent the text of the event ID?
It is a lot easier than typing it out
I am not having much luck finding what is happening here. I am fairly certain that the issue is that webhooks are what define the version, I think the --version flag may refer to the Stripe API version of the request that asks for a resend.
One way that I know of to get events in a specific version is by creating an endpoint via the API that specifies a version. You can specify arbitrary versions through that API call https://docs.stripe.com/api/webhook_endpoints/create#create_webhook_endpoint-api_version
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
I will try to confirm that this isn't specifyable via the resend command with my colleagues, but that is my understanding.
Well the webhook endpoint that it was originally sent to has the right version. And I can't call my localhost from a webhook configured in Stripe. So that is where the version parameter would come into play.
Maybe because there are multiple webhooks that received that event it's messing something up? Idk...
I also was testing event "evt_1PcsmzJZ7tosECMgJaePf5Up" and it worked as expected. But only has one webhook associated to it and it has the version i needed.
As in when you resent evt_1PcsmzJZ7tosECMgJaePf5Up with the --stripe-version flag, it got resent in the correct API version?
I didn't even pass the version flag. It just came through correctly
Gotcha. Thank you for the info, looking in to how exactly this works with my colleagues and I will get back to you.
Hey, thank you for your patience. Unfortunately it looks like it isn't possible to re-render older events in a new API version at the moment. We can resend in any of the versions that the event was originally sent in, but we don't support re-rendering in other versions.
So the reccommendation is to generate new events that do initially get sent in that API version and testing with those. I understand that that is not ideal, but that is where our event testing capabilities are at the moment.
So I think you would want to:
- Create an endpoint for that specific version in the API that is subscribed to the right event type
- Either use
stripe triggeror do the appropriate actions in test mode to get the event sent to that endpoint. - Run
resendon that event as appropriate
So that event has the right API Version
Well for the webhook I want. And when i resend it via the dashboard, my CLI still pulls it wrong. Anywho, I'll find a workaround. Thanks.
Right, I was more speaking to other events like evt_1PctagJZ7tosECMgEaQgTc8w that weren't initially sent in that version.
Also FWIW, you can reach out to our support team if you want to have your account's default set to an arbitrary older version. That can be useful for things like test accounts that are created now, but that you want to test a specific version on.