-
Notifications
You must be signed in to change notification settings - Fork 384
Trigger command
The CLI will allow you to trigger a few test webhook events to conduct local testing. These test webhook events are real objects on the API and may trigger other webhook events as part of the test (e.g. triggering payment_intent.succeeded
will also trigger payment_intent.created
).
The webhook events we currently support are listed in the CLI help or on the wiki page.
To trigger an event, run:
$ stripe trigger <event>
Currently, the Stripe CLI supports triggering the following webhooks events:
charge.captured
charge.dispute.created
charge.failed
charge.refunded
charge.succeeded
checkout.session.completed
customer.created
customer.deleted
customer.updated
customer.source.created
customer.source.updated
customer.subscription.deleted
customer.subscription.updated
invoice.created
invoice.finalized
invoice.payment_failed
invoice.payment_succeeded
invoice.updated
payment_intent.created
payment_intent.payment_failed
payment_intent.succeeded
payment_method.attached
Events are triggered by making corresponding requests against the Stripe API, setting up additional objects as necessary. This means that triggering events will have side effects and will have properly backed API objects.
All triggers are defined in pkg/requests/examples.go
. They are setup as basic API requests so if you're comfortable, feel free to open a pull request adding new ones!
If you're having trouble adding a trigger, please open a feature request that we add one.