billable->request('POST', 'v1/addresses', $attributes))) ->setBillable($this->billable); } /** * {@inheritDoc} */ public function find(string $id): ?Address { $result = $this->billable->request('GET', sprintf('v1/addresses/%s', $id)); return $result->success() ? (new Address($result)) ->setBillable($this->billable) : null; } /** * Get default address from the current user. * * @throws RequestRequiresClientIdException * @throws GuzzleException */ public function defaultBillingAddress(): Address { return (new Address($this->billable->request('GET', sprintf('v1/addresses/%s', $this->billable->getUserData()->billing_address_id)))) ->setBillable($this->billable); } /** * Check if the current user has a default billing address. * * @throws RequestRequiresClientIdException * @throws GuzzleException */ public function hasDefaultBillingAddress(): bool { return $this->billable->getUserData()->billing_address_id !== null; } }