#anonymous_pc
1 messages · Page 1 of 1 (latest)
Hi
Flagging I already answered all those questions earlier today
I didn't understand you
The way you go from a PaymentIntent id pi_123 to a Checkout Session id cs_test_123 is using the List Checkout Sessions API: https://stripe.com/docs/api/checkout/sessions/list
2/ Refund -> PaymentIntent via the payment_intent: 'pi_123' property
3/ PaymentIntent -> Checkout Session via the https://stripe.com/docs/api/checkout/sessions/list API
4/ What's inside that Checkout Session via the line_items property
All the objects are related to each other, you need to take a few minutes to look at our API reference and connect the dots```
that's what I said earlier
const chargeRefunded: any = event.data.object;
const pi = await stripe.paymentIntents.retrieve(chargeRefunded.payment_intent);
const session = await stripe.checkout.sessions.list(chargeRefunded.payment_intent);
Something like this I assume
You can use this payment_intent as the unique ID for the session, correct?
You would need to pass {payment_intent: 'pi_123'} into that List request:
https://stripe.com/docs/api/checkout/sessions/list?lang=node#list_checkout_sessions-payment_intent
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
got ya
const session = await stripe.checkout.sessions.list({payment_intent: chargeRefunded.payment_intent});
like so
Yep!
Man, thank you! That other guy, is well, a typical Discord Mod.
man that was the 2 second nugget I needed.
The API docs are HUGE.
Thank you!
Glad it was helpful -- we're all working hard to help support you here
Understood, I'll practice patience. Cooking with fire now, thank you!