From a90ed4c2ca7313c8475cfba65ddf23b9f11bb591 Mon Sep 17 00:00:00 2001 From: imdhemy Date: Sun, 12 May 2024 20:54:12 +0200 Subject: [PATCH] wip --- config/liap.php | 2 +- src/ServiceProviders/LiapServiceProvider.php | 15 --------------- 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/config/liap.php b/config/liap.php index 266fcf3..9f17655 100644 --- a/config/liap.php +++ b/config/liap.php @@ -41,7 +41,7 @@ | @see https://imdhemy.com/laravel-iap-docs/docs/credentials/google-play | */ - 'google_application_credentials' => base_path(env('GOOGLE_APPLICATION_CREDENTIALS')), + 'google_application_credentials' => base_path((string)env('GOOGLE_APPLICATION_CREDENTIALS')), /* |-------------------------------------------------------------------------- diff --git a/src/ServiceProviders/LiapServiceProvider.php b/src/ServiceProviders/LiapServiceProvider.php index d2c9d02..dfc026b 100644 --- a/src/ServiceProviders/LiapServiceProvider.php +++ b/src/ServiceProviders/LiapServiceProvider.php @@ -25,7 +25,6 @@ use Imdhemy\Purchases\Subscription; use Lcobucci\JWT\Decoder; use Lcobucci\JWT\Encoding\JoseEncoder; -use RuntimeException; /** * Laravel Iap service provider. @@ -113,20 +112,6 @@ public function register(): void private function registerConfig(): void { $this->mergeConfigFrom(self::CONFIG_PATH, self::CONFIG_KEY); - - // Check if it should set GOOGLE_APPLICATION_CREDENTIALS to the configured path - $currentGoogleCredPath = getenv('GOOGLE_APPLICATION_CREDENTIALS'); - if (is_string($currentGoogleCredPath) && file_exists($currentGoogleCredPath)) { - return; - } - - $googleCredentials = (string)config(self::CONFIG_KEY.'.google_application_credentials'); - if (! empty($googleCredentials) && ! is_dir($googleCredentials)) { - if (! file_exists($googleCredentials)) { - throw new RuntimeException("Google Application Credentials file not found at $googleCredentials"); - } - putenv('GOOGLE_APPLICATION_CREDENTIALS='.$googleCredentials); - } } /**