#Dara
1 messages ยท Page 1 of 1 (latest)
Hi, that is correct, you cannot update the version of the webhook endpoint, https://stripe.com/docs/api/webhook_endpoints/update. You'd need to create another endpoint, https://stripe.com/docs/api/webhook_endpoints/create#create_webhook_endpoint-api_version with the desired version.
Thanks. If the backend function code doesn't need to change, what is the trick to not break the flow of events in live mode?
What do you mean by what is the trick to not break the flow of events in live mode??
Because I have to disable the old webhook and enable the new webhook manually. I would think some events would be bypassed. So, we have to monitor them and fix manually if there are?
You do not need to disable the old one, you can create the new one and then disable the old one so you do not miss any events.
Ok, I'll try to do that. Thanks. Because no where in the documentation mention that this problem.
Another question I have is that we opened another account for another country the business is moving too. Would you have suggestion on handling code that manage 2 set of API keys?
Especially the webhooks. Because the object data doesn't include the account info at all.
๐ hopping in here since pgskc has to head out soon
We don't have any specific suggestions for handling the two API keys - it'll depend on how your code is set up/how your integration works
For the webhooks, you could have the same URL with a diffferent URL parameter so you can check that any know which account it's for
Oh, that's not a bad idea. Can you please be more specific about the URL parameter like /?stripeAccount=""?
I thought at first you said about 2 server endpoints with same code. lol
Yeah like you could do something like:
- Account A has a webhook endpoint like https://example.com/webhook?account=A
- Account B has https://example.com/webhook?account=B
and then your server code can check the account url param upfront to know which account it's for and then use the correct webhook secret/logic for that account
That's clever! It's just the info I needed.
๐
If I use the Stripe account code, it is a breach? Is it supposed to be confidential?
It starts with acct_
It's not a breach, but I personally wouldn't recommend it (you can never be too careful)
Ok good point. I had the same thought.
It's good. I can use the right key by knowing which account it came from. Then, pass some request. Normally, I wouldn't need to but I have to retrieve the expanded price object to save the recurrent amount of the subscription in my database. Thus, I wanted to know if changing the API version of the webhook would allow me to avoid the retrieve price request.
On the database, I'll just add a stripeAccount field on the user record.
I don't think an api version update would help in this case, but I'd need more details
It's fine, I'll run some webhook test with the new API version and compare the output with text-compare.com, and I'll know if it'll help my case. lol
๐