nestjsstripe-paymentspayment

How to distinguish payment status in stripe `checkout.session.expired` event


I am implementing payment integration with stripe in NestJs. Use case is:

  1. User pays in checkout session using async payment method
  2. Payment is processing for long time
  3. Stripe checkout session expires
  4. Async payment method succeeds I came across this problem while handling checkout.session.expired, how to distinguish payment which still can be paid by async payment method from session which for sure wont be paid (because customer didnt use any of payment methods).

Solution

  • You use checkout.session.async_payment_succeeded (docs) to know when an async payment succeeds. Overall, you can't complete an expired Checkout Session, which is what triggers the async payment method to begin processing, so this shouldn't really be an issue.