美文网首页
Google Play Developer API配置

Google Play Developer API配置

作者: 人世看客 | 来源:发表于2023-10-06 09:23 被阅读0次

    一、前言

    集成google支付,需要后台确认订单等操作,会用到Google Play Developer API中的接口。这些接口不能直接调用,需要做配置

    二、具体配置

    1.开发者帐号与 Google Cloud 项目相关联


    1. 关联的 Google Cloud 项目启用 Google Play Developer API。

    3.在 Google Cloud开启OAuth同意屏幕,创建一个web凭据,创建完成后获得client_id,client_secrert,redirect_uri

    image.png

    4.获取调用Developer API接口的token (官方文档)

    参数
    grant_type=authorization_code
    code=上一步获取的code,记得进行urldecode
    client_id=Google Cloud 创建的凭据Id Client ID
    client_secret=Google Cloud 创建的凭据密钥Client secret
    redirect_uri=创建web凭据中的重定向地址
    access_type=offline

    执行完成,会返回一下数据


    • 刷新token,上面返回的access_token,会过期,expires_in字段就是过期时间,后台需要自己处理刷新token逻辑,刷新token如下
    1. 到这里获得access_token就可以请求Google Play Developer API中的接口了
      如确认订阅商品


    相关文章

      网友评论

          本文标题:Google Play Developer API配置

          本文链接:https://www.haomeiwen.com/subject/gwanvdtx.html