在哪里可以在Appengine或android上的App Billing v3 api中获得令牌?

问题描述:

Reading the documentation it is unclear to me how to get a token from either android or appengine endpoint server? I assume they mean by token a oauth2 access token?

https://developers.google.com/android-publisher/v1_1/ http://developer.android.com/google/play/billing/gp-purchase-status-api.html

I did setup a client id like this

console

In javascript I can get a access token gapi.auth.getToken().access_token. But is it the same token? What scope do I need? Is there a API I need to activate in the console?

On appengine I only know how to get a email from the user.

var clientids = []string{WEB_CLIENT_ID, ANDROID_CLIENT_ID_d, ANDROID_CLIENT_ID_r, endpoints.ApiExplorerClientId}
var audiences = []string{WEB_CLIENT_ID}
var google_scopes = []string{"https://www.googleapis.com/auth/userinfo.email"}

func (s *Service) Google(r *http.Request, req *NoRequest, resp *User) error {
        c := endpoints.NewContext(r)
        g, err := endpoints.CurrentUser(c, google_scopes, audiences, clientids);
        if err != nil {return err}
        resp.Email=g.String()
        return nil
}

Can you provide me more info about the token I must use to verify a purchase (in-app-billing v3)?

在阅读文档时,我不清楚如何从android或appengine端点服务器获取令牌? 我认为它们是通过令牌表示oauth2访问令牌? p>

https://developers.google.com/android-publisher/v1_1/ http://developer.android.com/google/play/billing/gp-purchase-status-api.html p> \ n blockquote>

我确实设置了这样的客户端ID p>

” p>

在javascript中,我可以获取访问令牌 gapi.auth.getToken()。access_token code>。 但这是相同的标记吗? 我需要什么范围? 我是否需要在控制台中激活API? p>

在appengine上,我只知道如何从用户那里收到电子邮件。 p>

  var clientids = [] string {WEB_CLIENT_ID,ANDROID_CLIENT_ID_d,ANDROID_CLIENT_ID_r,endpoints.ApiExplorerClientId} 
var受众群体= [] string {WEB_CLIENT_ID} 
var google_scopes = [] string {“ https://www.googleapis.com/  .email“} 
 
func(s * Service)Google(r * http.Request,req * NoRequest,resp * User)错误{
c:= endpoints.NewContext(r)
g,err:= endpoints.CurrentUser  (c,google_scopes,听众,客户ID); 
如果err!= nil {返回err} 
 resp.Email = g.String()
返回nil 
} 
  code>  pre> \  n 
 

能否向我提供有关我必须用来验证购买(应用内结算v3)的令牌的更多信息? p> div>

Never mind I found it, mist this reference :) https://developers.google.com/android-publisher/authorization