#mr_pablo-list-payments

1 messages ยท Page 1 of 1 (latest)

foggy leaf
#

Hello ๐Ÿ‘‹
I'd retrieve Checkout Session and expand the PaymentIntent on it which should give you

  • Line Items
  • Total amount
supple basin
foggy leaf
supple basin
#

when you say "expand" what do you mean?

#

from your docs, it looks like all calls to get line items are additional calls

foggy leaf
supple basin
#

so why can't i just use PaymentIntents.List with line items expanded?

foggy leaf
#

PaymentIntents don't have line items

supple basin
#

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.

foggy leaf
#

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 the line_items and 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'],
      });
supple basin
#

Seems the documentation is wrong then

#

I can see line_items, but payment_intent is null

foggy leaf
#

do you have an example session object I can dig into?

supple basin
#

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?

foggy leaf
#

what docs are you looking at?

supple basin
#

the code sample on the right just has customer where, to be fair, the big block of text mentions data.customer

#

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

foggy leaf
#

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 using data.* 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 labeled expandable
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?

supple basin
#

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

foggy leaf
#

right, so that won't show up because the payment wasn't made using Stripe checkout

supple basin
#

๐Ÿคฆโ€โ™‚๏ธ

#

I did ask "If I want to show a customer a list of their payments, and the line items for each payment, should I be using PaymentIntents, CheckoutSessions or Invoices?"

#

I just want the customers payments with line items, from all sources