#kosherslayer

1 messages · Page 1 of 1 (latest)

thorny kayakBOT
stuck egret
subtle void
#

Yeah but how can I distinguish then from a failed card payment (which would give me a payment status of unpaid) and an async payment?

I want to provision access on customer paid and async payments immediately, then only unprovision the async payment if it failed

#

ohh failed card payments dont trigger a checkout.session.completed event

#

So only instant successful payments and all async payments trigger checkout.session.completed?

stuck egret
#

If you want to get more details, you can listen to payment_intent.payment_failed for failed payments, and payment_intent.suceeded for succeeed payments.

subtle void
#

can you answer this:
So only instant successful payments and all async payments trigger checkout.session.completed?

stuck egret
#

Not 100% true. For payment methods that can't be confirmed immediately (i.e., status=pending), you'll also get the checkout.session.completed

subtle void
#

is that not an async payment tho?

#

I want to provision access on customer paid and async payments immediately, then only unprovision the async payment if it failed

I'll just provision access on all checkout.session.completed events and revoke it on async payment failed in invoice.payment_failed

#

that should handle it