Skip to content

Commit fd5d317

Browse files
committed
Update README.md
1 parent 143cbb5 commit fd5d317

File tree

1 file changed

+21
-26
lines changed

1 file changed

+21
-26
lines changed

README.md

+21-26
Original file line numberDiff line numberDiff line change
@@ -28,30 +28,25 @@ The published config file `config/purchase.php` looks like:
2828

2929
```php
3030
return [
31-
'google_application_credentials' => env(
32-
'GOOGLE_APPLICATION_CREDENTIALS',
33-
storage_path('google-app-credentials.json')
34-
),
35-
36-
'routing' => [],
37-
38-
'google_play_package_name' => 'com.example.name',
39-
40-
'eventListeners' => [
41-
SubscriptionPurchased::class => [],
42-
SubscriptionRenewed::class => [],
43-
SubscriptionInGracePeriod::class => [],
44-
SubscriptionExpired::class => [],
45-
SubscriptionCanceled::class => [],
46-
SubscriptionPaused::class => [],
47-
SubscriptionRestarted::class => [],
48-
SubscriptionDeferred::class => [],
49-
SubscriptionRevoked::class => [],
50-
SubscriptionOnHold::class => [],
51-
SubscriptionRecovered::class => [],
52-
SubscriptionPauseScheduleChanged::class => [],
53-
SubscriptionPriceChangeConfirmed::class => [],
54-
],
31+
'routing' => [],
32+
33+
'google_play_package_name' => env('GOOGLE_PLAY_PACKAGE_NAME', 'com.example.name'),
34+
35+
'eventListeners' => [
36+
SubscriptionPurchased::class => [],
37+
SubscriptionRenewed::class => [],
38+
SubscriptionInGracePeriod::class => [],
39+
SubscriptionExpired::class => [],
40+
SubscriptionCanceled::class => [],
41+
SubscriptionPaused::class => [],
42+
SubscriptionRestarted::class => [],
43+
SubscriptionDeferred::class => [],
44+
SubscriptionRevoked::class => [],
45+
SubscriptionOnHold::class => [],
46+
SubscriptionRecovered::class => [],
47+
SubscriptionPauseScheduleChanged::class => [],
48+
SubscriptionPriceChangeConfirmed::class => [],
49+
],
5550
];
5651
```
5752

@@ -60,15 +55,15 @@ Each configuration option is illustrated in the [configuration section](#configu
6055
# Configuration
6156

6257
## Google Application Credentials
63-
Requests to the Google Play Developer API, requires authentication and scopes. To authenticate your machine create a service account, then upload the downloaded JSON file `google-app-credentials.json` to your server, and finally set the `google_application_credentials` to the path of that file.
58+
Requests to the Google Play Developer API, requires authentication and scopes. To authenticate your machine create a service account, then upload the downloaded JSON file `google-app-credentials.json` to your server, and finally add `GOOGLE_APPLICATION_CREDENTIALS` key to your `.env` file and set it to the path of JSON file.
6459

6560
1. In the Cloud Console, go to the [Create service account](https://console.cloud.google.com/apis/credentials/serviceaccountkey?_ga=2.92610013.131807880.1603050486-1132570079.1602633482) key page.
6661
2. From the **Service account** list, select **New service account**.
6762
3. In the **Service account name** field, enter a name.
6863
4. From the **Role** list, select **Project** > **Owner**.
6964
5. Click **Create**. A JSON file that contains your key downloads to your computer.
7065
6. Upload the JSON file to your storage directory, or any other protected directory.
71-
6. Set the config key `google_application_credentials` to the JSON file path.
66+
6. Set the `.env` key `GOOGLE_APPLICATION_CREDENTIALS` to the JSON file path.
7267

7368
## Routing
7469
This package adds a `POST` endpoint `/purchases/subscriptions/google` named `purchase.developerNotifications.google` to handle the **Real-Time Developer Notifications** pushed from Google which reflects any changes or updates of the subscription state.

0 commit comments

Comments
 (0)