#Dovpayment
1 messages · Page 1 of 1 (latest)
Hi, lines details means the product and price detail? It's correct that they are not available on the Payment Intent, but on the Checkout Session
You can try auto-pagination https://stripe.com/docs/api/pagination/auto?lang=ruby
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
I'll delve a little further in what I'm doing. I'm saving the most recent ID returned from the payload and using that in the next call in the starting_after parameter.
That you are leveraging the pagination parameters (limit, starting_after, ending_before) yourself.
But autopagination would be way easier
How does that work with new results only?
I don't want the previous results to show after they have been called up.
Actually you may have answered the question by leading me to come at it form a different angle. If the starting_after will not work I will simply use the limit only and ignore duplicates.
Annoying workaround but it will work.
Glad to hear you may figured it out, but TBH I still don't follow the use case. What if we take a step back and you can explain what you want to achieve in the first place?
Sure.
My understanding is if you simply want to do pagination, then auto-pagination is easiest
As mentioned, I want to get a list of all payments. In the list of payments I need to get the list of items as it has a reference in there.
The checkout API has this information so I'm querying it however I don't want to re-query it again if that makes sense.
Kind of like a line in the sand.
So you are calling the List All Checkout Session API https://stripe.com/docs/api/checkout/sessions/list?
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
That's correct.
PHP.
$sessions = $stripe->checkout->sessions->all(['limit' => 100]);
foreach ($sessions->autoPagingIterator() as $session) {
var_dump($session);
// Do something more
}
How about this
I'm already doing that but it's just going to show me the same 100 records (until a new one comes along and then it's 99).
I need to get results newer than the last set of results.
Um how above removing limit => 100?
I have it working already now by iterating over the results and not inserting any duplicates. I'm not sure if there is any other way.
I may not be explaining myself correctly.
It's not that I then want 99 records, I only want the 1 records that was new AFTER the 100 was already retrieved.
As in IDs 1-100 have all been retrieved, I need >100 on the next query run. If there are 5 on that run, I want >105 on the run thereafter.
Anyway, I'l see how my solution works out.
On another note - I just want to clarify - if the checkout is status is 'paid', that's a successful event, correct? As in the money has been debited/credited accordingly?
Yes, should be. You should also receive a checkout.session.completed webhook event