8

I am currently in test mode with Stripe. I cancelled a users subscription is Stripe dashboard, but the webhook I set up on my site's web server (which uses Laravel Cashier) does not fire i.e. the subscription data is unaffected on my site's web server. I thought this should happen. The webhook is otherwise tested and working.

dmulter
  • 2,608
  • 3
  • 15
  • 24
Mladen
  • 516
  • 1
  • 9
  • 20

2 Answers2

14

Whenever a subscription is canceled, the event customer.subscription.deleted will be generated on your account and sent to your webhook endpoint (assuming it listens for it). This is true whether the subscription is canceled automatically after too many failures, via the API or manually in the dashboard.

You can easily confirm this in the dashboard by looking at the Events section for your customer and see this event.

It's likely an issue in the configuration for your webhook or the code server-side with Cashier.

koopajah
  • 23,792
  • 9
  • 78
  • 104
  • 1
    I've tested the webhook in Stripe dashboard and the test runs fine, webhook returns a response. I'm currently talking to Stripe support, will post an update. – Mladen Apr 16 '18 at 12:36
  • Thanks it helped! I was listening to `customer.subscription.updated` but it turned out this webhook doesn't fire when upon cancellation. So weird. – Stalinko Feb 08 '22 at 05:15
  • I was listening for subscription_schedule.canceled instead of customer.subscription.deleted, so this answer helped me. – Alexander Online Media Jan 27 '23 at 01:44
1

For testing: also make sure, that you set "cancel subscription immediately" instead of at the end of the billing period otherwise it won't fire instantly. You could also test it with a test clock properly :)

peti2ty
  • 11
  • 3