Files
id/src/Id/Resources/Invoices.php
Maurice Preuß (envoyr) 4b23f6ddbb refactored code
Signed-off-by: Maurice Preuß (envoyr) <hello@envoyr.com>
2025-04-30 03:45:10 +02:00

26 lines
609 B
PHP

<?php
namespace Anikeen\Id\Resources;
use Anikeen\Id\Concerns\HasBillable;
use Anikeen\Id\Exceptions\RequestRequiresClientIdException;
use Anikeen\Id\Result;
use GuzzleHttp\Exception\GuzzleException;
class Invoices extends BaseCollection
{
use HasBillable;
/**
* {@inheritDoc}
*/
public function find(string $id): ?Invoice
{
$result = $this->billable->request('GET', sprintf('v1/invoices/%s', $id));
return $result->success()
? (new Invoice($result))
->setBillable($this->billable)
: null;
}
}