#lyubo_api

1 messages ยท Page 1 of 1 (latest)

charred sinewBOT
#

๐Ÿ‘‹ Welcome to your new thread!

โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

๐Ÿ”— This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1417280056933220474

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

vagrant radish
#

hello! can you explain what you mean by "list items"? can you provide an example charge ID i can look at as an example?

vast rose
#

Hi there

#

Can you see the items for this charge, there is literally a single product there "HTML & CSS"

#

I need to get that name

#

but I have to do it from ->charges because charges hold all the other values that I need for my file

#

I am using charges because I am manually filtering the successful ones

vagrant radish
#

ok, so you want to look up a checkout session's line_items starting from a charge ID?

vast rose
#

Unfortunately no. I have read the article you have given me, but it is not what I need. I am retrieving this as static sales. You can check my full method

#

i just want to get the list items for each transaction thats all. I need to find all the products that have been bought in each transaction

#

Do I need to change the logic for the purchase in order to get the purchased products for each transaction later?

vagrant radish
#

i am still a little confused, it doesn't look like there is anything there that would not work if you replaced your call to List all Charges with List all Checkout Sessions and then looked at the payment_intent.latest_charge.status instead
https://docs.stripe.com/api/checkout/sessions/list

vast rose
#

Sure, let me try and I will get back to you in a few minutes of possible for you to wait

vagrant radish
#

yeah for sure!

vast rose
#

ok great, so this works with the expand

#

Since I want to get only the successful payments

#

I assume I need to take a look at payment_status: "paid" in order to filter the succesfull ones

#

instead of doing this:

#

I need to check the payment_status of the session to be "paid". If it is not paid, then I don't want it

#

Btw, is there a better way in general to do this? I assumed that putting the bought products as list items is a good approach when you are doing a single payment checkout. Do you think that there is maybe a simpler logic when pruchasing a product or maybe you are not sure?

#

Actually when I look at the code, it seems that Stripe does it by itself lol. Since I am just putting the product id and it just adds it to the list items haha

vagrant radish
#

ok cool! let me know if you have any more questions ๐Ÿ™‚

vast rose
#

thats all for now haha sorry I probably confused you a lot. The Stripe API is massive lol