#2Clutch-checkout-webhooks
1 messages · Page 1 of 1 (latest)
Hello! Give me one minute and then i'll be able to help
The checkout specific events you're referencing would only apply to the first payment of the subscription - when the customer is actually interacting with Checkout. All future recurring payments would trigger a different set of events
For webhooks in general, I'd suggest you start here: https://stripe.com/docs/webhooks/quickstart
For the customer portal session, a return_url is only required if one has not been set in your settings
Thanks a lot for the insightful answer. I really appreciate it.
https://stripe.com/docs/billing/subscriptions/integrating-customer-portal#webhooks
I also found the url above which points to the direction of knowing which events I should be listening to.
That being said, despite having gone through multiple pages of Stripe’s documentation, I’m still not sure I understand where endpoint_secret is supposed to come from.
endpoint_secret is something you get either from the dashboard after you've set up your endpoint secret, or from the Stripe CLI if you're just testing your endpoint locally (you'll see it in the output after you run stripe listen)
Great! That answers my question.
One last thing. Since the webhook endpoint doesn't take any parameter, what's the recommended way to retrieve the customer_id. I'm guessing it will always be part of the payload, but just in case it's not, I'd like to know the recommended way to do this.
What exactly are you trying to do?
create a portal session for subscribed users so that they can update their payment information or cancel their membership.
the functionality is handled by stripe, so my focus on generating the url.
Why are you doing this from a webhook endpoint though? The webhook endpoint has not way of sending that information back to your frontend