ip2k / google-api-ruby-client

Automatically exported from code.google.com/p/google-api-ruby-client
Apache License 2.0
0 stars 0 forks source link

Couldn't execute request to android-publisher 'This developer account does not own the application' #72

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I'm following steps from this page to authorise on api client 
http://code.google.com/p/google-api-ruby-client/wiki/ServiceAccounts

1. I created new project on google console as the same user who uploaded APK 
files to Google Play
2. I went to API Access tab and created Create an OAuth 2.0 client ID. 
3. On Client ID setting page I selected 'service account' option
4. Downloaded key I use to authorise on api client
5. I'm trying to retrieve information about test purchase. My request looks 
this way:

publisher = client.discovered_api('androidpublisher')
client.execute(
          api_method: publisher.purchases.get,
          parameters: {
              'packageName' =>  'com.real.package.name.from.google.play',
              'subscriptionId' => 'android.test.purchased',
              'token' =>  rand.to_s
          }
)

I'm getting the error with message 'This developer account does not own the 
application'

Original issue reported on code.google.com by TweeK...@gmail.com on 15 Jan 2013 at 12:15

GoogleCodeExporter commented 9 years ago
That is correct behavior. Service accounts are meant for when you want to run 
requests using the app's identity. That identity is separate than the owner of 
the application.

Not sure if the play developer console will allow it, but you can try inviting 
the service account to be a developer on the project so it has the correct 
permissions.

Original comment by sba...@google.com on 15 Feb 2013 at 9:27

GoogleCodeExporter commented 9 years ago
I am having the same issue.  I tried making the service account an owner and it 
still fails with the message "This developer account does not own the 
application."  Is there any way around this?

Original comment by ccummis...@gmail.com on 1 Mar 2013 at 9:04

GoogleCodeExporter commented 9 years ago
It's impossible to invite the service account to be a developer because you 
can't check this service email and confirm app ownership. 

Original comment by TweeK...@gmail.com on 4 Mar 2013 at 8:00

GoogleCodeExporter commented 9 years ago
As per: 
http://milancermak.wordpress.com/2012/08/24/server-side-verification-of-google-p
lay-subsc/

you will need to use a web application token. Refer:
http://jonathanotto.com/blog/google_oauth2_api_quick_tutorial.html

here is some Ruby code that uses a token as per Jonathans code:
https://gist.github.com/cornflakesuperstar/5632813

Original comment by operati...@stocklight.com on 23 May 2013 at 4:53