整个开发背景是前端在调用完google play支付流程后,需要后台验证支付结果以及在自己的服务生成订单相关信息。由此着手对google后台验证的调研,首先官方流程:
https://developers.google.com/android-publisher/authorization
下面我将已网上原有贴复制+自己手动截图的形式详细描述下整个操作流程:
实现步骤
1.管理者用项目最高权限的GP账号登录,访问https://accounts.google.com/o/oauth2/auth?scope=https://www.googleapis.com/auth/androidpublisher&response_type=code&access_type=offline&redirect_uri=https://www.example.com/oauth2callback&client_id=123456789 获得code,保存此code(4/SIIu58MuX3Ixuea-FJPo3rgg3x5LIDyadb8MzztPV7c#)
2.迅速访问,请注意是在步骤1后迅速访问。POST请求,https://accounts.google.com/o/oauth2/token?grant_type=authorization_code&code=4/SIIu58MuX3Ixuea-FJPo3rgg3x5LIDyadb8MzztPV7c#&client_id=123456789&client_secret=123456789&redirect_uri=https://www.example.com/oauth2callback。获得返回的refresh_token,妥善保存此token。以后的请求中都不会再出现,对于