I'm working on an Azure Function that will call Google Play API to verify a purchase after a user makes an in-app purchase in my mobile app.
I created a service account on Google Cloud Platform and set it as "Owner" but so far my Azure Functions is failing with the following error when I try to verify a purchase:
Google.GoogleApiException: 'The service androidpublisher has thrown an exception. HttpStatusCode is Unauthorized. The current user has insufficient permissions to perform the requested operation.'
So, I go to IAM and edit the service account to add additional roles but I'm TOTALLY confused about which roles to add.
I also tried it from Google Play Console > API Access > Service Accounts -- see below:
Under permissions, I selected:
- View financial data, orders, and cancellation survey responses
- Manage orders and subscriptions
I did this under both "App Permissions" and "Account Permissions" tabs -- see below:
Any idea what I'm doing wrong or not doing? As I mentioned, all I need is to use this service account in my Azure Functions app to make API calls to Google Play to verify purchases.