Skip to content

Commit a90ed4c

Browse files
committed
wip
1 parent bd39929 commit a90ed4c

File tree

2 files changed

+1
-16
lines changed

2 files changed

+1
-16
lines changed

config/liap.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
| @see https://imdhemy.com/laravel-iap-docs/docs/credentials/google-play
4242
|
4343
*/
44-
'google_application_credentials' => base_path(env('GOOGLE_APPLICATION_CREDENTIALS')),
44+
'google_application_credentials' => base_path((string)env('GOOGLE_APPLICATION_CREDENTIALS')),
4545

4646
/*
4747
|--------------------------------------------------------------------------

src/ServiceProviders/LiapServiceProvider.php

-15
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
use Imdhemy\Purchases\Subscription;
2626
use Lcobucci\JWT\Decoder;
2727
use Lcobucci\JWT\Encoding\JoseEncoder;
28-
use RuntimeException;
2928

3029
/**
3130
* Laravel Iap service provider.
@@ -113,20 +112,6 @@ public function register(): void
113112
private function registerConfig(): void
114113
{
115114
$this->mergeConfigFrom(self::CONFIG_PATH, self::CONFIG_KEY);
116-
117-
// Check if it should set GOOGLE_APPLICATION_CREDENTIALS to the configured path
118-
$currentGoogleCredPath = getenv('GOOGLE_APPLICATION_CREDENTIALS');
119-
if (is_string($currentGoogleCredPath) && file_exists($currentGoogleCredPath)) {
120-
return;
121-
}
122-
123-
$googleCredentials = (string)config(self::CONFIG_KEY.'.google_application_credentials');
124-
if (! empty($googleCredentials) && ! is_dir($googleCredentials)) {
125-
if (! file_exists($googleCredentials)) {
126-
throw new RuntimeException("Google Application Credentials file not found at $googleCredentials");
127-
}
128-
putenv('GOOGLE_APPLICATION_CREDENTIALS='.$googleCredentials);
129-
}
130115
}
131116

132117
/**

0 commit comments

Comments
 (0)