lemonsqueezy.php icon indicating copy to clipboard operation
lemonsqueezy.php copied to clipboard

[Bug]: getAllProducts() returns an array instead of a paginated result

Open kevinpapst opened this issue 2 years ago • 1 comments

What happened?

The API only returns the first 10 results, see https://docs.lemonsqueezy.com/api#pagination

Instead the API Product::getAllProducts() should return a ProductPage extends PaginatedResult.

Where PaginatedResult is an abstract class with a couple of methods:

  • countPages()
  • nextPage()
  • previousPage()
  • firstPage()
  • lastPage()
  • getResults()

Additionally getAllProducts(PageQuery $query) method should accept a query object with params:

  • pageSize
  • number
  • ...

How to reproduce the bug

See above

Package Version

x

PHP Version

8.2

Which operating systems does with happen with?

macOS

Notes

No response

kevinpapst avatar May 18 '23 11:05 kevinpapst

To explain why I changed this from a bug to an enhancement, Pagination was defined in the initial Roadmap, and it's not set as Done. I was expecting to work on this by the end of the development, but as you require this, I will make sure to include this after the discounts.

ricardov03 avatar May 27 '23 02:05 ricardov03