lemonsqueezy.php
lemonsqueezy.php copied to clipboard
[Bug]: getAllProducts() returns an array instead of a paginated result
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
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.