#Nukesforbreakfast

1 messages ยท Page 1 of 1 (latest)

rough axleBOT
proper gate
#

hello! afaik i would use the time of the payment_intent.succeeded event

#

what are you trying to do with that time out of curiosity?

vivid quiver
#

I have an existing system where we can track payment amounts manually, such as if they paid with a check. When I get the webhook that an online payment succeeded, I use metadata to tie it back to the right account and create a payment object in our DB. I need to set a timestamp on that payment object corresponding to when the payment was completed.

#

the only attributes that appear to be timestamps are created_at and cancelled_at, but I don't believe those correspond to when the status became succeeded.

proper gate
#

aaaah

#

but yeah, those don't correspond to when the status became succeeded

vivid quiver
#

ok

#

another question about payment intents:

#

I'm using checkout with connect, destination charges, and on_behalf_of set.

#

how do I get the transfer information and the destination payment? There's some metadata I wanted to set on the payment that ends up on the connected account's side.

#

I don't see the same on the payment_intent.

proper gate
#

can you share your account id? i want to see what API version you're currently using

vivid quiver
#

acct_1DrGYIB7kbjcJ8Qq

#

I'm definitely on an old API version. Working to move to a newer one.

proper gate
#

hmmm, everything recent in test mode is via the Dashboard

#

anyway, a PaymentIntent still creates a Charge object, so you can refer to the corresponding Charge object

vivid quiver
#

there should be a bunch of payment_intents created by CI tests that have run recently.

proper gate
#

maybe you can share the PaymentIntent id?

vivid quiver
#

or over the past few nights anyways.

#

does a newer API version contain the link to the transfer?

#

in the docs I only see transfer_data and transfer_group

proper gate
#

maybe share an example PaymentIntent id with me? i can point you to it then

vivid quiver
#

ok one second let me see if I can find one.

#

I just sorted by the really old ones since more recently I've been doing a lot of unrelated webhook testing, but hopefully this still works: pi_1G9DgEB7kbjcJ8QqQyF98f5W

proper gate
#

that's a bit too old ๐Ÿ˜…

#

it's 2020

#

generally within the past week would be good

vivid quiver
#

I don't think I've done one in the past week to be honest.

#

not in test mode anyways

#

would a live payment work?

proper gate
#

what i wanted to highlight is that on the latest API version : https://stripe.com/docs/upgrades#2022-11-15

The charges property on PaymentIntent has been removed. You can use the latest_charge property instead.
and
Charge no longer auto-expands

#

a live payment would work too yes

vivid quiver
#

pi_3Mm3EyB7kbjcJ8Qq0UdQ44k2

proper gate
#

and you can see the Transfer here

vivid quiver
#

OK, so there's no direct access from the payment intent.

proper gate
#

but if you upgrade to the latest API (and also update your webhook API version to the latest), you will no longer see the Charge autoexpanded in the payment_intent.suceeded event

vivid quiver
#

but confirming I needed to look at the charge object that's related to the PI and not the PI itself is what I wanted to check on.

proper gate
#

if you want to future proof, yes, look at the Charge object

vivid quiver
#

are charge.succeeded and payment_intent.succeeded basically the same event, just from different objects?

proper gate
#

yep!

#

it's the same concept

vivid quiver
#

alright.

#

is there anywhere I can go for more information on what the roadmap for this feature is?

proper gate
vivid quiver
#

if it gets to the point of being able to embedd the invoice management part, it might be exactly what I've been looking for.