您可以在App Engine或Android上获取用于应用内计费v3 API的令牌。

huangapple go评论90阅读模式
英文:

Where can I get a token for in app billing v3 api on appengine or android?

问题

阅读文档后,我对如何从Android或App Engine端点服务器获取令牌感到不清楚。我猜他们所说的令牌是指OAuth2访问令牌?

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

我已经设置了一个客户端ID,如下所示:

您可以在App Engine或Android上获取用于应用内计费v3 API的令牌。

在JavaScript中,我可以获取访问令牌gapi.auth.getToken().access_token。但是这是同一个令牌吗?我需要什么范围?在控制台中是否需要激活某个API?

在App Engine中,我只知道如何从用户那里获取电子邮件。

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
}

你能提供关于我必须使用的令牌来验证购买(in-app-billing v3)的更多信息吗?

英文:

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

您可以在App Engine或Android上获取用于应用内计费v3 API的令牌。

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)?

答案1

得分: 1

没问题,我会帮你翻译这段内容。这是你要翻译的内容:

不用担心,我找到了,是这个参考文档:https://developers.google.com/android-publisher/authorization

英文:

Never mind I found it, mist this reference 您可以在App Engine或Android上获取用于应用内计费v3 API的令牌。 https://developers.google.com/android-publisher/authorization

huangapple
  • 本文由 发表于 2014年1月16日 03:54:04
  • 转载请务必保留本文链接:https://go.coder-hub.com/21146931.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定