#matrix-webhooks

1 messages · Page 1 of 1 (latest)

loud oriole
#

sure, what's the question?

granite spear
#

I have a checkout session for one off purchases and for subscriptions. I would like to know which event I should monitor to confirm the payment was successful. I am currently looking for invoice.paid but it is not triggered for one off purchases (only for subscription)

#

I have seen there is also a payment_intent.success which is triggered in both cases

#

what is the best practise here?

#

there is also a checkout session completed event

loud oriole
#

checkout.session.completed yes

#

you can get all the other information you might want(like the PaymentIntent object for a single payment, or the Subscription object) by expanding (https://stripe.com/docs/expand) fields on the CheckoutSession object or making API calls while handling that event

granite spear
#

it looks like checkout.session.completed is not triggered for subscription?

loud oriole
#

it is

#

well, assuming you are using Checkout to create the Subscription(as opposed to calling the Subscriptions API directly)

granite spear
#

i am using connect

#

i am using checkout on a connected account using direct charges

#

have a look at this subscription pi_3K3SMJC3gxK3y4G91E4rkscf

#

i cant see any checkout completed in the logs

loud oriole
#

yep as it happens on the connected account's logs/events instead

#

that endpoint will receive the checkout.session.completed events

granite spear
#

where can I see the checkout.session.completed in my dashboard

#

i can see the payment intent, the
invoice.created, payment_intent.created, etc but not checkout session completed

loud oriole
#

are you looking at your dashboard of the dashboard of this connected account?

granite spear
#

i am logged in with my account but i look at the conneted account dashbaord

#

Here is where i see the connected account logs

#

I cant see a checkout session completed

loud oriole
#

maybe scroll up? Is it that event that is cut off at the top?

granite spear
#

on the other end if I do a one off payment i see the checkout session complted

loud oriole
#

fair enough, I guess it's not shown

granite spear
#

this one is for the subscription and it is the last log. there is not checkout session completed

loud oriole
#

anyway, it 100% exists, I gave you the ID and how to access it from a webhook. If you want to see it in the dashboard you have to fully log into the account, I guess the dashboard is weird sometimes

#

and then go to Developers>Events there

granite spear
#

ok

#

I cant find any event in Developers>Event related to this subscription (5 Dec at 21 at 21:35). I can only see my events (for example when I charge my customer without connect or when i use connect but get an application fee). In the subscription example i referecned, i am not collecting application fees

loud oriole
#

sounds like you're not viewing the dashboard of the connected account

granite spear
#

maybe because this is all a test?

loud oriole
#

click the button in '...' menu (when looking at the connected account in your own dashboard) that I showed above

#

and then you'll be in their dashboard and can see their events

#

it's nothing to with this being in test, it all works the same in test and live mode

granite spear
#

I get it now

#

now i can see all events

#

i need to log in in their account as my company

#

thanks I have learned something

#

anyway I don't think checkout completed is good event to confirm the user has paid, right? checkout completed just mean the payment was authorized but not paid

#

what is the difference between invoice.paid and payment_intent.succeeded?

#

does invoice.paid trigger automatically when payment_intent.succeeded?

loud oriole
#

checkout completed just mean the payment was authorized but not paid
that's not true no

loud oriole
loud oriole
granite spear
#

ok very clear, thanks

#

the only thing I am not sure on is the checkout event. In the page you sent, it is written that the payment can fail

#

BUT i see it is related to certain payment methods. Shall i then assume that IF I use cards, then checkout completed == payment done?

loud oriole
#

if it's for cards then yes, .completed means the payment is done

#

it's only for methods like bank debits that can take a few days to complete where you will get a later event (async_completed I think it's called)

granite spear
#

this chat was very useful to make me understand a lot of things. Many thanks for the support.

#

your support team in discord is superb!