diff --git a/src/Utils/HttpClient.php b/src/Utils/HttpClient.php index a284d220..490e1795 100644 --- a/src/Utils/HttpClient.php +++ b/src/Utils/HttpClient.php @@ -30,11 +30,8 @@ public function request( ): ResponseInterface { $installedVersion = 'unknown'; - if (class_exists('\Composer\InstalledVersions')) { - try { - $installedVersion = InstalledVersions::getVersion('transbank/transbank-sdk'); - } catch (\Exception $e) { - } + if (class_exists('\Composer\InstalledVersions') && InstalledVersions::isInstalled('transbank/transbank-sdk')) { + $installedVersion = InstalledVersions::getVersion('transbank/transbank-sdk') ?? 'unknown'; } $baseHeaders = [