Content of this article
- Preliminary Remarks
- What is Google Pub/Sub?
- Configuration of Pub/Sub in the Google Cloud Console
- Activation of the Google Play API
1. Preliminary Remarks
For plenigo to be able to communicate with Google services, Google authentification information must be stored in the Merchant Backend.
Further articles that can be helpful:
- As an introduction, we explain the most important terms in the glossary article.
- For a better overview of the steps to be taken, the checklist for the Google setup can help.
Folgende Zugänge sind notwendig: / The following accesses are required:
- Google Cloud Platform (GCP) Account: A Google Cloud account is required to use Google Sub/Pub. If you don't have an account yet, sign up here.
- Google Play Console Account: There should be an app in which the In-App purchases are to be implemented. Google Play Console account might be required.
- plenigo Account: An active plenigo account is required to receive the data of the In-App purchases. The functions are available both on the plenigo stage system and the live system.
- Activated billing: For the Google Cloud project, the billing must be activated.
2. What is Google Pub/Sub?
Google Pub/Sub can be used to send information about in-app purchase events, among other things, to additional recipients outside the Google systems. For example, when a customer makes a purchase, the corresponding app publishes a message in a topic. plenigo or other subscribed services receive this message and can react to it, e.g. update the user account, link a subscription or assign access rights.
3. Configuration of Pub/Sub in the Google Cloud Console
In the following, the required steps for configuring the Pub/Sub functions in the Google Cloud Console are described.
The official Google documentation can be found here.
Create a Google Cloud project for the desired app(s)
Create a topic within the project
Create a subscription within a topic
Connect Google Service Account with the topic
To guarantee the information flow between Google Play and Google Pub/Sub, a Google Play service account must be assigned to the created topic.
- Log in to your Google Cloud Console account.
- On the Cloud home page, click on the project drop-down in the upper bar.
- Click on "New Project"
- Define a name and select the organization resource.
- Save the project by clicking "Create".
For more information, go to the Google documentation.
- In the Google Cloud Console, open the section "Pub/Sub"
- Open the "Topics" menu item.
- In the header bar, click on "Create topic".
- In the field "Topic ID" give your topic a name (e. g. In-App Purchases)
- Deactivate the checkbox "Add standard subscription"
- Encryption: Select "Encryption key managed by Google"
- Save the topic by clicking on "Create".
For more information, go to the Google documentation.
- In the section Pub/Sub, open the "Subscriptions" page.
- In the header bar, click on "Create subscription".
- Name the subscription and select the created topic as source.
- Select Delivery type as Push
- Enter endpoint URL:
https://callbacks.plenigo.com/callbacks/v1.0/appStore/{companyId}/googleplaystore
The plenigo companyID can be found in the Merchant Backend in the desired client under Settings > Development > JS-SDK. - Expiry date of the subscription: never
- Retain all other default values.
For more information, go to the Google documentation.
Connect Google Service Account with the topic
To guarantee the information flow between Google Play and Google Pub/Sub, a Google Play service account must be assigned to the created topic.
- Open the topic created in the last step.
- Click on the three dots and click on "Permissions".
The Google Play service account "google-play-developer-notifications@system.gserviceaccount.com" gets access to the selected topic. The service account gets the role "Pub/Sub Publisher".
- Click on "Save".
For more information, go to the Google documentation.
4. Activation of the Google Play API
Once the Google Cloud project has been successfully configured and has a topic and a subscription, the Google Play Developer API has to be activated for this project. The API is required to ensure communication between the Google Play and Google Cloud services.
Activate the Google Play Developer API:
- Open the Google Play Developer API site in the Google Cloud Console.
- Click on "Activate".