#Olivia Wen

1 messages · Page 1 of 1 (latest)

shut sailBOT
ruby ocean
#

You listen to the checkout.session.completed webhook event. It will come for every successful payment

errant marlin
#

Does that include failed payments?

#

and how do I listen to it?

ruby ocean
#

No that won't. You can just listen to it for all successful payment and ignore the rest

errant marlin
#

So how do I achieve an effect like dashboard. Our business needs to know the status of each order payment

ruby ocean
#

Sure, then you can listen to payment_intent.succeed and payment_intent.failed instead. Keep in mind that those events could contains non-Checkout transactions too

errant marlin
#

Hello, are you still there?

ruby ocean
#

That's a bit different. Basically when you receive checkout.session.completed that's already a successful payment

errant marlin
#

Will there be any disadvantages if I use it?

ruby ocean
#

You won't catch the "real" failed payment_intent as you mentioned in Dashboard

errant marlin
#

real?what means?

ruby ocean
#

I mean if you listening to checkout.session.completed, you will only receive it when a successful payment came. This is good in most case. But since you mentioned you want to have both succeeded and failed payments as the Dashboard, this checkout.session.completed would not suit your need

errant marlin
# errant marlin

If I want success and failure, is it appropriate to determine that by the payment_status in this link?

ruby ocean
#

no

errant marlin
ruby ocean
#

Yep

shut sailBOT