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

Add missing event types to the `trigger` command

Open ob-stripe opened this issue 5 years ago • 11 comments

The trigger command supports only a subset of all possible event types. You can view which event types are supported by running stripe trigger --help.

Adding support for new event types is a simple but hard to automate process, so for the moment we add support for new event types when someone requests it. If you want us to add support for a new event type, please ask in this thread and we'll look into it promptly.

Note however that at this time there are some event types that cannot be triggered by the CLI. This is because under the hood, the trigger command works by sending a series of API requests (see #295 for a more detailed explanation). This means that the CLI can only trigger events that are a direct consequence of API requests. Some events are triggered asynchronously by Stripe and cannot be triggered simply by sending API requests.

We do want to eventually support all possible event types, but supporting those events will require a bit more work as it cannot be done purely on the CLI's end.

List of supported events

As of v1.2.5:

  balance.available
  charge.captured
  charge.dispute.created
  charge.failed
  charge.refunded
  charge.succeeded
  checkout.session.completed
  customer.created
  customer.deleted
  customer.source.created
  customer.source.updated
  customer.subscription.created
  customer.subscription.deleted
  customer.subscription.updated
  customer.updated
  invoice.created
  invoice.finalized
  invoice.payment_failed
  invoice.payment_succeeded
  invoice.updated
  payment_intent.amount_capturable_updated
  payment_intent.canceled
  payment_intent.created
  payment_intent.payment_failed
  payment_intent.succeeded
  payment_method.attached
  setup_intent.canceled
  setup_intent.created
  setup_intent.setup_failed
  setup_intent.succeeded

List of events that cannot be supported at this time

  customer.source.expiring
  customer.subscription.trial_will_end

(and probably a few others)

ob-stripe avatar Nov 06 '19 22:11 ob-stripe

Hi @ob-stripe @tomer-stripe , can you please add setup_intent.succeed? Given a user successfully saves a card, on my server-side I create a Customer object with the payment method from setup_intent. I would very much like to test this! Thank you in advance!

ericpgreen2 avatar Nov 20 '19 12:11 ericpgreen2

Hi @greenep12, sorry for the long delay. v1.2.5 adds support for all setup_intent.* events.

ob-stripe avatar Dec 10 '19 20:12 ob-stripe

@ob-stripe Can you please add charge.expired event? I want to re-authorize card when authorized payment is expired because my order processing time is more than 7 days and stripe hold amount only for 7 days not more so I am implementing this and want to test this in local.

Thank you..

plusoneinfo avatar Dec 16 '19 11:12 plusoneinfo

@plusoneinfo Unfortunately I think charge.expired is in the category of events that cannot be triggered directly by the API and thus cannot be triggered by the CLI at this time. Sorry! (It's on our 2020 roadmap to find a solution to this problem so that the CLI can trigger all event types.)

Unrelated to the CLI: the reason the maximum hold period is 7 days is because banks typically don't like longer authorizations. I would recommend reaching out to Stripe's support at https://support.stripe.com/email to explain your business model and use case and make sure they tell you your approach is okay.

ob-stripe avatar Dec 17 '19 03:12 ob-stripe

Would it be possible to emulate a payment_method.automatically_updated event?

alexweissman avatar Jan 29 '21 16:01 alexweissman

Everything about payment_method would be great.

jsgoupil avatar Apr 01 '21 16:04 jsgoupil

A way to trigger sigma.scheduled_query_run.created would be useful

georgefelixsmith avatar Apr 21 '21 09:04 georgefelixsmith

I would like to request checkout.session.expired please so I don't have to wait 1 hour to test some new code.

pegasusnotunicorn avatar Sep 15 '21 21:09 pegasusnotunicorn

I would like to request checkout.session.expired please so I don't have to wait 1 hour to test some new code.

I second this, a workaround would be to test the endpoint on a live API but that is risky

tiaringhio avatar Dec 16 '21 15:12 tiaringhio

I would like to trigger charge.expired

MosesEjim avatar May 16 '24 10:05 MosesEjim