#i'm a cyborg but that's okay

1 messages · Page 1 of 1 (latest)

balmy urchinBOT
south wharf
#

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

tiny escarp
south wharf
#

Ah, so there's also invoice.payment_failed for all subsequent charges. So to summarize:

  • use checkout.session.completed for successful first payment on newly created subscriptions
  • use customer.subscription.updated for subscriptions that get updated/canceled by your customers (or yourself)
  • use invoice.payment_failed for all other failed payment attempts related to subscription payments
tiny escarp
#

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)?

south wharf
#

Correct, because Checkout will attempt to auth the payment method being used and throw an error before a payment is ever attempted