#i'm a cyborg but that's okay
1 messages · Page 1 of 1 (latest)
If you're using Checkout, you will never get the checkout.session.completed webhook if a payment fails during auto-charge.
So you should listen for checkout.session.completed and customer.subscription.updated
is there something like this for auto-charge payment fail? Mostly I want to handle when auto-charge fails, and I change user's subscription plan to free one.
Ah, so there's also invoice.payment_failed for all subsequent charges. So to summarize:
- use
checkout.session.completedfor successful first payment on newly created subscriptions - use
customer.subscription.updatedfor subscriptions that get updated/canceled by your customers (or yourself) - use
invoice.payment_failedfor all other failed payment attempts related to subscription payments
so, invoice.payment_failed will not fire when user's on the checkout page, and they cancel the payment(i.e. they click on go back button)?
Correct, because Checkout will attempt to auth the payment method being used and throw an error before a payment is ever attempted