I try to use the cashier as subscription to a monthly or yearly and I really dont understand the docs. How to use the webhooks of stripe? I need an example or an explanation. If someone have any repo, tutorial or blog article is welcome...
@imwaller If you don’t understand the docs, then how is a reply paraphrasing those same docs going to help? 🤷♂️
You create a subscription. You accept a payment for that subscription. You don’t need to manually set up a webhook endpoint because Cashier comes with one out of the box; all you need to do is add the URL (by default, your app URL with /stripe/webhook added to the end) in the webhooks section of your Stripe dashboard. Your subscriptions database table will then be updated when subscriptions are updated in Stripe (i.e. when a card can’t be automatically charged and a subscription is automatically cancelled).
Tackle the implementation in steps. Concentrate on each step in turn so as not to overwhelm yourself. So, for your first step, create a subscription. When you can create subscriptions and charge a user, add the webhook URL to your Stripe dashboard, cancel a subscription, and see if the corresponding row in your subscriptions table also gets its stripe_status updated.