stripe-cli icon indicating copy to clipboard operation
stripe-cli copied to clipboard

Allow specifying different endpoints for each event for the listen command.

Open SmashingQuasar opened this issue 8 months ago • 0 comments

Problem

Stripe allows production environment to use different URLs for each event (for example /stripe/webhook/coupon/created for coupon.created and so on). This is great because it's best practice to avoid having a switch of death on one single route that will dispatch all events. As of today, it seems this cannot be done using the Stripe CLI without having to start as many commands as there are events to listen to. Obviously when working with a fully automated local environment using Docker it is not viable to start as many Stripe CLI containers as there are events type to listen to.

Feature

It would be good to be able to specify which event to route where when using the Stripe CLI. Ideally this would be done using the configuration file to avoid having a super long (and possibly confusing) command line.

Examples

Let's have some toml example:

[webhooks]
coupon.created = 'https://my.local.environment.dev/stripe/webhook/coupon/created'

SmashingQuasar avatar Nov 14 '23 14:11 SmashingQuasar