Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implements Pagination #52

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions src/Endpoint/CustomersEndpoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,23 @@ public function __construct(ClientInterface $client, SerializerInterface $serial
/**
* Get a list of all customers
*
* @param int $page The start page
* @param int $pageSize The page size
* @return Response\GetCustomersResponse The Response
*
* @throws QuotaExceededException If the maximum number of calls per second exceeded
* @throws Exception If the response cannot be parsed
*/
public function getCustomers()
public function getCustomers($page = 1, $pageSize = 50)
{
$query = [
'page' => max(1, $page),
'pageSize' => max(1, $pageSize),
];

return $this->client->get(
'customers',
[],
$query,
Response\GetCustomersResponse::class
);
}
Expand Down