billbeeio / billbee-php-sdk

🔌 The official Billbee API SDK for PHP 💻
MIT License
22 stars 25 forks source link

missing pagination in CustomersEndpoint getCustomers() #51

Open gbsnj opened 2 years ago

gbsnj commented 2 years ago

missing pagination signature and implementation in getCustomers() results in not getting all customers.

Function should look like:

public function getCustomers($page = 1, $pageSize = 50, \DateTime $minCreatedAt = null) { $query = [ 'page' => max(1, $page), 'pageSize' => max(1, $pageSize), ];

if ($minCreatedAt !== null && $minCreatedAt instanceof \DateTime) {
    $query['minCreatedAt'] = $minCreatedAt->format('c');
}
return $this->client->get(
    'customers',
    $query,
    Response\GetCustomersResponse::class
);

}