#Beninate-line_items

1 messages ยท Page 1 of 1 (latest)

static pier
#

hello @rare lodge! Can you share the PaymentIntent id so that i can take a closer look?

rare lodge
#

pi_3Jv0nmK8IruJbDfX1f2PQG0N

static pier
rare lodge
#

mmm and i guess i can't access the CheckoutSession from the PaymentIntent?

#

well there must be a way ๐Ÿค”

static pier
#

yeah, the PaymentIntent doesn't contain a reference to the Checkout Session

#

it's the other way round, the Checkout Session will contain a reference to the underlying PaymentIntent

rare lodge
static pier
#

we have some underlying logic to show that, but the header for that section mentions Checkout Summary

rare lodge
#

mm ok

#

so with only a PaymentIntent, there's not really anything i can do?

static pier
#

yep, you would want to make use of the Checkout Session to retrieve all the data you want instead

rare lodge
#

bummer... much bum...

static pier
#

the Checkout Session also contains the PaymentIntent though. Is there any reason you need to start with the PaymentIntent specifically?

rare lodge
#

no no, i hear you, it's just that i am needing to backfill some missing data in our DB, and to date, we've only been storing the payment_intent_id from Stripe, so that's all we have

#

obviously, in retrospect, it sounds like the checkout_session_id would have been the way to go, but alas it aints what i got

static pier
#

when retrieving the list of Checkout Sessions, remember to expand the line_items parameter so that you don't have to make an additional call

#

then you would need to link them up in your DB based on the PaymentIntent

#

does that work?

rare lodge
#

oh! Stripe::Checkout::Session.list(payment_intent: 'foo') seem to work!

static pier
#

yep!

rare lodge
#

ok ok ok

#

i think i can do what i need with this ๐Ÿ™

static pier
#

great! feel free to reach out again if you have any questions ๐Ÿ˜„

rare lodge
#

Thank you Alex Stripe. what a serendipitous last name!

#

one more thing though

#

i can't call .line_items on a CheckoutSession ๐Ÿค”

static pier
rare lodge
static pier
#

did you expand it?

rare lodge
#

๐Ÿ“– reading

#

sick ok. i think i got it

static pier
#

yay!