pay-rails / pay

Payments for Ruby on Rails apps
https://github.com/pay-rails/pay
MIT License
1.98k stars 316 forks source link

Add link to create Stripe webhook with all the required events #1065

Closed marckohlbrugge closed 2 months ago

marckohlbrugge commented 2 months ago

Pull Request

Summary: Manually setting up a new Stripe webhook and selecting each event is is rather tedious. This makes it a lot easier.

Description: There's no way to copy/paste all the required webhook events into Stripe and enable them in one go. I have made a feature request to Stripe, but in the mean time we can use this trick instead.

When creating a new webhook, I noticed Stripe automatically updates the URL to include each selected event. So I thought: why not provide the full list of events we need and see if those are automatically added when the page is loaded. And guess what, they are!

So we can link to https://dashboard.stripe.com/webhooks/create?events=comma,separated,list,of,events and those events will be be pre-selected. Comma's need to URL encoded. (%2C). Clicking this link does nothing to the user's Stripe account. Nothing is automatically saved. It simply pre-selects each event as shown in the screenshot.

Testing:

I tried clicking the link and it works for me. See screenshot.

Screenshots (if applicable):

image

Checklist:

Additional Notes: Feel free to change the text.

excid3 commented 2 months ago

Great addition @marckohlbrugge 👍