update resources

Signed-off-by: Maurice Preuß (envoyr) <hello@envoyr.com>
This commit is contained in:
2025-05-02 06:27:53 +02:00
parent 1725ec68de
commit 1d2119a32b
33 changed files with 303 additions and 320 deletions

View File

@@ -6,7 +6,7 @@ use Anikeen\Id\ApiOperations\Request;
use Anikeen\Id\Exceptions\RequestRequiresClientIdException;
use Anikeen\Id\Resources\Transactions;
use Anikeen\Id\Result;
use GuzzleHttp\Exception\GuzzleException;
use Throwable;
trait ManagesTransactions
{
@@ -15,12 +15,15 @@ trait ManagesTransactions
/**
* Get transactions from the current user.
*
* @throws RequestRequiresClientIdException
* @throws GuzzleException
* @throws Throwable
*/
public function transactions(): Transactions
{
return (new Transactions($this->request('GET', 'v1/transactions')))
->setBillable($this);;
if (!isset($this->transactionsCache)) {
$this->transactionsCache = Transactions::builder(fn() => $this->request('GET', 'v1/transactions'))
->setBillable($this);
}
return $this->transactionsCache;
}
}