Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

If I cancel user's subscription manually in Stripe dashboard, should a webhook endpoint I set up on my web server be notified of that?

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.

like image 786
Mladen Avatar asked Apr 12 '18 17:04

Mladen


People also ask

What happens when you cancel Stripe subscription?

If you choose to cancel immediately, the subscription cancels immediately without any prorating. A canceled subscription can't be restarted, so you must create a new one for the customer if you want to continue billing them.

Do I need Webhooks for Stripe?

Stripe uses webhooks to notify your application when an event happens in your account. Webhooks are particularly useful for asynchronous events like when a customer's bank confirms a payment, a customer disputes a charge, a recurring payment succeeds, or when collecting subscription payments.

What is a Stripe webhook endpoint?

A webhook is an HTTP endpoint that receives events from Stripe. Webhooks allow you to be notified about payment events that happen in the real world outside of your payment flow such as: Successful payments ( payment_intent. succeeded ) Disputed payments ( charge.

How do you create a webhook endpoint in Stripe?

Add a webhook endpointOpen the Webhooks page. Click Add endpoint. Add your webhook endpoint's HTTPS URL in Endpoint URL. If you have a Stripe Connect account, enter a description and select Listen to events on Connected accounts.


1 Answers

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.

like image 81
koopajah Avatar answered Oct 15 '22 04:10

koopajah