When you call Stripe_Charge :: create (), you really can, as you stated, register this as a successful transaction (provided that it does not work) and send a confirmation email.
Webhooks are extremely useful when using the lane for managing recurring payments, for example, when selling a subscription. According to this scenario, many things happen that are not directly triggered by a user request.
Suppose, for example, that a user signs up for your Gold Plan, which has a 30-day free trial. Three days before the end of the trial period, the webcam customer.subscription.trial_will_end is launched. You can answer this by sending an email to the client in which he thanked you for interviewing your subscription and remind him that his card will be charged.
Then, 3 days after his card is debited and the payment is successful, you can answer the charge. Received a webhook to send him an invoice every month.
Another very useful webhook is charge.failed. Depending on your retry settings, you can respond to this by informing the user that their card is declining and notify him that his subscription will be terminated in a few days.
In general, if you do not use subscriptions or invoices, websites have limited utility. But if so, they are indispensable.
source share