#iclasspropayne_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/1273006456786128999
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Have you tried using the API to create the endpoint?
https://docs.stripe.com/api/webhook_endpoints/create
You can set the api_version as the string explicitly
https://docs.stripe.com/api/webhook_endpoints/create#create_webhook_endpoint-api_version
That's great, I will try that, just a moment!
I can't update the version of an existing end-point with this ?
No, the update API doesnt' support that.
However, what you can do is create a new webhook endpoint with the same URL.
Does it have to be an API call or can I use the Stripe CLI?
You can use the CLI too
Sweet
if you create a new endpoint with the same URL then you'd need to update the webhook secret you're using in your code..
Is there an option to tell it that it's for Test Mode?
Stripe CLI should default to test mode
excellent
unless you're passing --live flag, it should target test mode
and once it's created I should be able to edit it in the dashboard to select additional events?
yup
stripe webhook_endpoints create -d "enabled_events[0]"="payment_intent.succeeded" --url="https://unifiedpay-testb-dispatch.azurewebsites.net/api/StripeReceiver" --api_version="2024-06-20"
unknown flag: --api_version
Do I have the order of the args wrong ?
stripe webhook_endpoints create requires exactly 0 positional arguments. See stripe webhook_endpoints create --help for supported flags and usage
The help text does say "api-version" as well - just not the docs on stripe.com
nvm that's just to specify the API version per request
that won't work
let me try something and get back to you
okay this should work
stripe webhook_endpoints create -d "enabled_events[0]"="payment_intent.succeeded"
--url="https://unifiedpay-testb-dispatch.azurewebsites.net/api/StripeReceiver"
-d "api_version=2024-06-20"
`stripe webhook_endpoints create` requires exactly 0 positional arguments. See `stripe webhook_endpoints create --help` for supported flags and usage
the code I shared above works for me
let me update my Stripe CLI and try again
Same error :/
stripe version 1.21.2
PS C:\Users\RobPayne> stripe webhook_endpoints create -d "enabled_events[0]"="payment_intent.succeeded" --url="https://unifiedpay-testb-dispatch.azurewebsites.net/api/StripeReceiver" -d "api_version=2024-06-20"
`stripe webhook_endpoints create` requires exactly 0 positional arguments. See `stripe webhook_endpoints create --help` for supported flags and usage
I'm on the same version and this works
stripe webhook_endpoints create -d "enabled_events[0]"="payment_intent.succeeded" --url="https://unifiedpay-testb-dispatch.azurewebsites.net/api/StripeReceiver" -d "api_version=2024-06-20"
I have to say I'm jealous
same result
can you try restart your console / command prompt? Maybe something is wonky with the environment
๐
Ok that appears to have done it! Thank you so much!