#mr_pablo-list-payments
1 messages ยท Page 1 of 1 (latest)
Hello ๐
I'd retrieve Checkout Session and expand the PaymentIntent on it which should give you
- Line Items
- Total amount
But retrieving a single Payment Intent, https://stripe.com/docs/api/payment_intents/retrieve, doesnt give the line items in the returned data
right, that's why you'd retrieve the checkout session first
Also, almost forgot that you'd need to expand the line_items too
https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-line_items
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
when you say "expand" what do you mean?
from your docs, it looks like all calls to get line items are additional calls
https://stripe.com/docs/api/expanding_objects?lang=node
const session = await stripe.checkout.sessions.retrieve(
'session_id',
{ expand: ['line_items', 'payment_intent' ] }
);
so why can't i just use PaymentIntents.List with line items expanded?
PaymentIntents don't have line items
why not? when you said expanding the paymentintents from the checkout session does have them
This code gives an error
await this.stripe.checkout.sessions.list({
customer: user.Item.stripeCustomerId,
limit: 10,
expand: ['line_items', 'payment_intent'],
});
This property cannot be expanded (line_items). You may want to try expanding 'data.line_items' instead.
why not? when you said expanding the paymentintents from the checkout session does have them
Ah sorry for the confusion. The checkout session object will have theline_itemsand then you can expand the PaymentIntent to get to the amount
This code gives an error
Try this
await this.stripe.checkout.sessions.list({
customer: user.Item.stripeCustomerId,
limit: 10,
expand: ['data.line_items', 'data.payment_intent'],
});
Seems the documentation is wrong then
I can see line_items, but payment_intent is null
do you have an example session object I can dig into?
ah, nvm, some were null, some are populated
right, could you look at making sure the documentation is corrected in regards as to the expanded field names?
what docs are you looking at?
the code sample on the right just has customer where, to be fair, the big block of text mentions data.customer
and https://stripe.com/docs/api/checkout/sessions/list makes no mention of expand as a parameter
the whole thing about expandable fields is not explain very well at all to be honest
A payment made in the Stripe dashboard is not showing for a customer in checkout sessions
https://stripe.com/docs/api/expanding_objects
the code sample on the right just has customer where, to be fair, the big block of text mentions data.customer
you'd need to expand usingdata.*when you're working with an array as opposed to an object as the example shows. So there's nothing to correct there.
https://stripe.com/docs/api/checkout/sessions/list makes no mention of expand as a parameter
the whole thing about expandable fields is not explain very well at all to be honest
We don't call out expand as a parameter as it actually is passed separately in a different object. If you look at the core object, you'll find fields that are labeledexpandable
https://stripe.com/docs/api/checkout/sessions/object
A payment made in the Stripe dashboard is not showing for a customer in checkout sessions
don't think I follow. What's happening here?
I'm trying to show all payments for a customer, using checkout session list, passing the customer ID. A payment created in the stripe dashboard is not showing in the results
right, so that won't show up because the payment wasn't made using Stripe checkout