mirror of
https://github.com/anikeen-com/id.git
synced 2026-03-15 06:36:14 +00:00
update resources
Signed-off-by: Maurice Preuß (envoyr) <hello@envoyr.com>
This commit is contained in:
@@ -5,7 +5,7 @@ namespace Anikeen\Id\Concerns;
|
||||
use Anikeen\Id\ApiOperations\Request;
|
||||
use Anikeen\Id\Exceptions\RequestRequiresClientIdException;
|
||||
use Anikeen\Id\Resources\Addresses;
|
||||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Throwable;
|
||||
|
||||
trait ManagesAddresses
|
||||
{
|
||||
@@ -14,21 +14,23 @@ trait ManagesAddresses
|
||||
/**
|
||||
* Get addresses from the current user.
|
||||
*
|
||||
* @throws RequestRequiresClientIdException
|
||||
* @throws GuzzleException
|
||||
* @throws Throwable
|
||||
*/
|
||||
public function addresses(): Addresses
|
||||
{
|
||||
return (new Addresses($this->request('GET', 'v1/addresses')))
|
||||
->setBillable($this);
|
||||
if (!isset($this->addressesCache)) {
|
||||
$this->addressesCache = Addresses::builder(fn() => $this->request('GET', 'v1/addresses'))
|
||||
->setBillable($this);
|
||||
}
|
||||
|
||||
return $this->addressesCache;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the current user has a default billing address.
|
||||
*
|
||||
* @see \Anikeen\Id\Resources\Addresses::hasDefaultBillingAddress()
|
||||
* @throws RequestRequiresClientIdException
|
||||
* @throws GuzzleException
|
||||
* @throws Throwable
|
||||
*/
|
||||
public function hasDefaultBillingAddress(): bool
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user