Stripe CLI triggering random events instead of payment_intent.succeeded Stripe CLI triggering random events instead of payment_intent.succeeded express express

Stripe CLI triggering random events instead of payment_intent.succeeded


Answer from one of Stripe's dev:


When you trigger an event with the Stripe CLI, under the hood it's making all of the requisite API methods to result in that event firing. In this case, it is creating and confirming a PaymentIntent.

To get a resulting payment_intent.succeeded event, you'll need to create a PaymentIntent (payment_intent.created will fire for this one). Then you need to confirm the payment intent and actually collect payment (which results in: charge.created, charge.succeeded, and payment_intent.succeeded).

For other event types like checkout.session.completed, many other events will fire that represent the objects that are prerequisite to get to a valid checkout.session.completed event.

If you only want to forward the payment_intent.succeeded event locally, (and it's a good idea when in production to enable only selected event types for your webhook endpoint), then you might want to pass the -e argument to stripe listen with the comma separated list of specific events you want to listen for. In this case you might update your listen command to:

stripe listen --forward-to http://localhost:3000/webhook -e payment_intent.succeeded

Hope that helps. If you run into any issues, feel free to reach out to the team at support.stripe.com/contact or on IRC in the #stripe channel on Freenode.


I hope it helps somebody as much as it helped me!


I had this error, with my web api based on net core5, it cannot solve it, but when downgrading to net core 3.1 as well as the MVC, everything was solved.


I have the same experience. The same code, and the same listener running can trigger different webhooks.When I create or cancel a user subscription from Stripe's dashboard, it can trigger no webhook at all, Sometimes some invoice webhooks, sometimes a series of up to 10 webhooks, including the create/cancel subscription webhook I'm expecting.

Gosh, stripe can be very frustrating. There are bugs at every step of the implementation process. Some I have reported on their github, and that did not get any response. Some I did not even report.

I just downloaded the new stripe CLI .deb package. Even such a simple thing as typing their brand name, they did it wrong. It's spelt "tripe CLI utility".

Anyway, I can only suggest you make sure you have all the latest libraries. They often upgrade their libraries to newer versions.

Make sure your stripe CLI is up-to-date. Same with stripe on your node server. Also open a new ticket on their github. Unlike Google for instance, I don't think Stripe has any engineers who monitor new Stripe related issues on SO.