#soma-payments

1 messages ยท Page 1 of 1 (latest)

glacial horizon
#

Hello!

#

Let's back up for a second here - what exactly are you trying to do?

thin swallow
#

Hello Mr @glacial horizon

#

I need to be able to have a list of all the usage for a paymentlink

#

I mean:

#

date of use, who, that sort of things

#

an usage's log for a paymentlink

glacial horizon
#

That's something you can get if you're listening for webhook events - are events something you have integrated akready?

thin swallow
#

no

#

I haven't

#

are you suggesting me to listen for events and store them into a local database?

#

I mean paymentlink related events?

glacial horizon
#

You can listen for checkout_session.completed events and check payment_link to see which payment link the checkout session comes from, to know when customers complete payment through a payment link and then store that in the DB

thin swallow
#

so, payment intents arenot meant for this?

#

I thank you for your time... I think I will dig a little more in the docs and will run some more "test and try". I refuse to believe the only way is to hook this to an event listener.

glacial horizon
#

an event listener is not the only way, but it is the most fool proof way - what were you hoping for instead?

thin swallow
#

payment intents have such a suggestive name

glacial horizon
#

I need to head out, but @candid marten can help you out

thin swallow
#

fine

glacial horizon
#

For context, payment intents are what power our payments under the hood - by using payment links, a payment intent is automatically created.

thin swallow
#

that is exactly what I wanted to know

#

also

glacial horizon
#

But Checkout Sessions are better for linking usage directly to a Payment Link, since the Payment Intent has to go through a couple of levels to be directly linked to it's associated Payment Link

thin swallow
#

interesting

#

can you describe for me these levels you just mentioned?

candid marten
#

Hi there ๐Ÿ‘‹ taking over for karbi

Give me a second to get caught up

thin swallow
#

Sure! hello Mr. @candid marten

#

Mr. karbi just told me something that was unclear to me in the docs, it is that launching a paymentlink will create automatically a payment intent

candid marten
#

Getting any amount of Payment Link data from the Payment Intent requires traversing many different objects to get to it, whereas you can get that info from the Checkout Session itself without having to make any additional calls: https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-payment_link

thin swallow
#

I see