谷歌支付验证2
来源:互联网 发布:word文档翻译软件 编辑:程序博客网 时间:2024/05/21 20:27
https://developers.google.com/android-publisher/authorization
Authorization
This section contains instructions specific to the Google Play Developer API. See thefull OAuth2 documentation for more details.
Initial configuration
Access to the Google Play Android Developer API is authenticated using the OAuth 2.0 Web Server flow. Before you can use the API, you will need to set up an APIs Console project, create a client ID and generate a refresh token.
Creating an APIs Console project
- Go to the APIs Console and log in with your Google Play Developer Console account.
- Select Create project.
- Go to Services in the left-hand navigation panel.
- Turn the Google Play Android Developer API on.
- Accept the Terms of Service.
- Go to API Access in the left-hand navigation panel.
- Select Create an OAuth 2.0 client ID.
- On the first page, you will need to fill in the product name, but a logo is not required. Note that your end users will not see the product name.
- On the second page, select web application and set the redirect URI and Javascript origins. Both of these settings can be changed later.
- Select Create client ID.
Generating a refresh token
- While logged in with your Google Play Developer Console account, go to the following URI:
https://accounts.google.com/o/oauth2/auth?scope=https://www.googleapis.com/auth/androidpublisher&response_type=code&access_type=offline&redirect_uri=...&client_id=...
Note: theredirect_uri
parameter must match the value registered with the client ID exactly, including the trailing backslash, if present. - Select Allow access when prompted.
- The browser will be redirected to your redirect URI with a
code
parameter, which will look similar to4/eWdxD7b-YSQ5CNNb-c2iI83KQx19.wp6198ti5Zc7dJ3UXOl0T3aRLxQmbwI
. - Exchange this code for an access and refresh token pair by sending a POST request to
https://accounts.google.com/o/oauth2/token
with the following fields set:grant_type=authorization_codecode=<the code from the previous step>client_id=<the client ID token created in the APIs Console>client_secret=<the client secret corresponding to the client ID>redirect_uri=<the URI registered with the client ID>
A successful response will contain your tokens in JSON format:{ "access_token" : "ya29.ZStBkRnGyZ2mUYOLgls7QVBxOg82XhBCFo8UIT5gM", "token_type" : "Bearer", "expires_in" : 3600, "refresh_token" : "1/zaaHNytlC3SEBX7F2cfrHcqJEa3KoAHYeXES6nmho"}
Accessing the API
Once you have generated the client credentials and refresh token, your servers can access the API without an active login or human intervention.
Using the access token
Servers can make calls to the API by appending the access token as a query parameter:
https://www.googleapis.com/androidpublisher/v1/...?access_token=...
Alternatively, the access token can be set in the Authorization
header of the request.
Using the refresh token
Each access token is only valid for a short time. Once the current access token expires, the server will need to use the refresh token to get a new one. To do this, send a POST request tohttps://accounts.google.com/o/oauth2/token
with the following fields set:
grant_type=refresh_tokenclient_id=<the client ID token created in the APIs Console>client_secret=<the client secret corresponding to the client ID>refresh_token=<the refresh token from the previous step>
A successful response will contain another access token:
{ "access_token" : "ya29.AHES3ZQ_MbZCwac9TBWIbjW5ilJkXvLTeSl530Na2", "token_type" : "Bearer", "expires_in" : 3600,}
The refresh token thus allows a web server continual access to the API without requiring an active login to a Google account.
- 谷歌支付验证2
- 谷歌支付验证1
- java服务端验证谷歌支付Google Pay
- IAP_支付本地验证
- Unity3d IOS支付验证
- 支付宝回调验证签名
- WAP支付 支付宝PHP验证
- 支付宝支付成功后验证失败
- Android仿支付宝支付验证按钮
- 微信支付 支付验证签名失败
- java验证iap支付收据
- PHP支付接口RSA验证
- 支付宝回调验证签名失败
- iOS支付(含服务器验证)
- 支付宝签名验证机制
- 验证支付宝来帐签名 MD5
- 请支付谷歌支付服务器上检查
- 谷歌支付总结(上)
- 关于jsp引入js的一个问题
- 将实时取到的数据进行分页显示的插件
- 【2015.02.03】 注意事项
- 寻找自适应元素(17)-条件格式
- SecureCRT 解决 删除键 变^H^H^H^H
- 谷歌支付验证2
- c/c++中的位运算
- 优化数据页面(1)——突出标题行
- 关于邮件地址的测试
- C++ Primer Plus第六版课后编程练习答案 6-1
- NYOJ 520 最大素因子【快速线性筛法的变形】
- C语言 --- 结构体
- 滑轮控件研究六、GestureDetector的简单应用,利用手势进行图片的缩放
- IOS开发UI篇—推荐两个好用的Xcode插件(提供下载链接)