#Dovpayment

1 messages · Page 1 of 1 (latest)

onyx kraken
#

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

hot linden
#

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.

onyx kraken
#

That you are leveraging the pagination parameters (limit, starting_after, ending_before) yourself.

#

But autopagination would be way easier

hot linden
#

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.

onyx kraken
#

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?

hot linden
#

Sure.

onyx kraken
#

My understanding is if you simply want to do pagination, then auto-pagination is easiest

hot linden
#

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.

onyx kraken
hot linden
#

That's correct.

onyx kraken
#

Which server language you are using?

#

like PHP or Ruby or etc

hot linden
#

PHP.

onyx kraken
#
$sessions = $stripe->checkout->sessions->all(['limit' => 100]);
foreach ($sessions->autoPagingIterator() as $session) {
  var_dump($session);
  // Do something more
}
#

How about this

hot linden
#

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.

onyx kraken
#

Um how above removing limit => 100?

hot linden
#

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?

onyx kraken
#

Yes, should be. You should also receive a checkout.session.completed webhook event