Google Play Developer API配置

一、前言

集成google支付,需要后臺確認訂單等操作,會用到Google Play Developer API中的接口。這些接口不能直接調用,需要做配置

二、具體配置

1.開發(fā)者帳號與 Google Cloud 項目相關聯(lián)


  1. 關聯(lián)的 Google Cloud 項目啟用 Google Play Developer API。

3.在 Google Cloud開啟OAuth同意屏幕,創(chuàng)建一個web憑據(jù),創(chuàng)建完成后獲得client_id,client_secrert,redirect_uri

image.png

image.png

4.獲取調用Developer API接口的token (官方文檔)

參數(shù)
grant_type=authorization_code
code=上一步獲取的code,記得進行urldecode
client_id=Google Cloud 創(chuàng)建的憑據(jù)Id Client ID
client_secret=Google Cloud 創(chuàng)建的憑據(jù)密鑰Client secret
redirect_uri=創(chuàng)建web憑據(jù)中的重定向地址
access_type=offline

執(zhí)行完成,會返回一下數(shù)據(jù)


  • 刷新token,上面返回的access_token,會過期,expires_in字段就是過期時間,后臺需要自己處理刷新token邏輯,刷新token如下
  1. 到這里獲得access_token就可以請求Google Play Developer API中的接口了
    如確認訂閱商品


最后編輯于
?著作權歸作者所有,轉載或內容合作請聯(lián)系作者
【社區(qū)內容提示】社區(qū)部分內容疑似由AI輔助生成,瀏覽時請結合常識與多方信息審慎甄別。
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發(fā)布,文章內容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務。

相關閱讀更多精彩內容

友情鏈接更多精彩內容