diff --git a/src/Config/PackageConfig.php b/src/Config/PackageConfig.php index a1b0efd..32456bc 100644 --- a/src/Config/PackageConfig.php +++ b/src/Config/PackageConfig.php @@ -22,7 +22,6 @@ final class PackageConfig extends AbstractConfig implements ConfigInterface private function __construct(string $secretKey, string $publicKey, string $encryptKey, string $env) { parent::__construct($secretKey, $publicKey, $encryptKey, $env); - $this->logger->pushHandler(new RotatingFileHandler(__DIR__ . "../../../../../../" . self::LOG_FILE_NAME, 90)); } public static function setUp(string $secretKey, string $publicKey, string $enc, string $env, ?LoggerInterface $customLogger = null): ConfigInterface @@ -32,9 +31,12 @@ public static function setUp(string $secretKey, string $publicKey, string $enc, if ($customLogger) { $instance->logger = $customLogger; } else { - $rootPath = __DIR__ . '/../../../../../../'; - $logDir = $rootPath . $_ENV['FLW_LOG_DIR'] ?? 'logs'; - + $vendorPath = dirname(__DIR__, 4); + $rootPath = dirname($vendorPath); + + $logSubDir = $_ENV['FLW_LOG_DIR'] ?? 'logs'; + $logDir = $rootPath . DIRECTORY_SEPARATOR . $logSubDir; + if (!is_dir($logDir)) { if (!mkdir($logDir, 0775, true) && !is_dir($logDir)) { throw new \RuntimeException("Flutterwave: Failed to create log directory at $logDir"); diff --git a/src/Enum/Currency.php b/src/Enum/Currency.php deleted file mode 100644 index 12b32a0..0000000 --- a/src/Enum/Currency.php +++ /dev/null @@ -1,23 +0,0 @@ -