简体   繁体   English

尝试在Google Play验证应用内购买时出错

[英]Error when trying to validate In-app purchase at Google Play

I try to make a validation of purchases on the server, but it can't to make a request to Google Play Android Developer API. 我尝试对服务器上的购买进行验证,但是无法向Google Play Android Developer API发出请求。 After a request it shows this one: 请求后显示以下内容:

Error calling GET https://www.googleapis.com/androidpublisher/v1.1/applications/my.app.id/inapp/my_in_app_purchase/purchases/purchase_token: (403) Forbidden

If I make a validation of this purchase by the test form in Developers Console, everything is OK and Google API would send a response. 如果我通过开发者控制台中的测试表单对此次购买进行了验证,则一切正常,Google API会发送响应。

Requests to other API (for example Books API) works fine. 对其他API(例如Books API)的请求可以正常工作。

To work with API I use Google APIs Client Library for PHP . 为了使用API​​,我使用了PHP的Google API客户端库 Authorization goes by Service Account. 授权按服务帐户进行。 In Developers Console access to Google Play Android Developer API is on. 在开发者控制台中,可以访问Google Play Android开发者API。

Ok I found the solution! 好的,我找到了解决方案!

You must to connect your API with your app. 您必须将API与应用程序连接。 You must go to your Google Play publish page ( https://play.google.com/apps/publish ) and invite a user with the service account email in Settings->User account & rights->Invite new user and give it the privileges of "View financial reports". 您必须转到Google Play的发布页面( https://play.google.com/apps/publish ),然后在设置->用户帐户和权利->邀请新用户中为其提供服务帐户电子邮件邀请用户,并为其提供“查看财务报告”的特权。

Thanks works for me, good luck! 感谢为我工作,祝你好运!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM