Files
id/src/Id/Concerns/ManagesTransactions.php
Maurice Preuß (envoyr) 1d2119a32b update resources
Signed-off-by: Maurice Preuß (envoyr) <hello@envoyr.com>
2025-05-02 06:27:53 +02:00

29 lines
695 B
PHP

<?php
namespace Anikeen\Id\Concerns;
use Anikeen\Id\ApiOperations\Request;
use Anikeen\Id\Exceptions\RequestRequiresClientIdException;
use Anikeen\Id\Resources\Transactions;
use Anikeen\Id\Result;
use Throwable;
trait ManagesTransactions
{
use Request;
/**
* Get transactions from the current user.
*
* @throws Throwable
*/
public function transactions(): Transactions
{
if (!isset($this->transactionsCache)) {
$this->transactionsCache = Transactions::builder(fn() => $this->request('GET', 'v1/transactions'))
->setBillable($this);
}
return $this->transactionsCache;
}
}