#wullvie
1 messages · Page 1 of 1 (latest)
hey alex
hello! i'm not sure i understand correctly, why would you want to start / stop a webhook listening?
so currently I have firebase cloud functions set up with a function URL as the endpoint url for the webhook i set up on stripe
I'm trying to find a way though to be able to run an http request call from our application, and await a callback with the result of a checkout session URL
the current setup works, as the webhook is listening for checkout session results, so we from there just use our cloud to tell our client what happened with the checkout. trying to see if there is a better way to keep it contained to: 1) app starts a checkout, 2) calls a function (that listens for stripe), and awaits the response
your description is not how webhooks work though - a webhook endpoint should always be online and ready to receive webhook events
well that's the reason of my inquiry - to see if there is alternative, perhaps something that can be contained to a per-request function
i didn't think so but i figured i would ask here
it's not impossible, but neither is it recommended to depend entirely on a callback function - the user could close the page before the processing completes, in which case, your function wouldn't end up running
if you really want to do it, you could try passing in an id defined in the query parameters of the Checkout's Session success_url when the customer is redirected there. When the customer is redirected to the success page, your success page can make a request using that unique id defined in the query parameters in your backend server to verify if Checkout Session is successfully completed and do whatever logic you need
this way in case of an interruption, the checkout session either doesn't get completed at all, or it does and our server sees it and can handle it
that was originally what we were going to do until we got the webhook up and running on our server
this way we don't have to worry about the client interrupting anything - only errors on stripe or google side
ok i feel good about how things are set up now actually - thanks for the help alex 👍