mirror of
https://github.com/anikeen-com/id.git
synced 2026-03-14 06:06:18 +00:00
29 lines
695 B
PHP
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;
|
|
}
|
|
} |