-
Couldn't load subscription status.
- Fork 888
Open
Labels
Description
When the autoPagingInterator() is used with deletes, only 1 page can be processed, because the last item of the current collection has been deleted, therefore the pager cannot find it to build the 2nd page.
For example (PHP)
$products = $stripe->products->all(['limit' => 100]);
foreach ($products->autoPagingIterator() as $product)
{
$product->delete();
}
The above will crash with No such product: 'prod_LIvx6FPSkqMLyL' because the last item in the collection no longer exists.
This can be a problem in a number of cases, i.e.
- Looping through and deleting duplicated saved payment methods based on fingerprint data.
- Test suites where Stripe test data must be cleared before the test suite starts.
- Synchronizing local products with Stripe products in cron jobs.
- etc
ZacharyDuBois