我可以从应用程序本身获取已购买的 Android 应用程序的 Google Checkout 订单 ID 吗?
我们希望允许用户通过从 Android Market 购买的每个应用程序在我们的服务器之一上激活一项服务,以验证用户是否确实购买了该应用程序。
为此,我们正在评估使用 Google Checkout 的通知历史记录 API,该 API 允许我们从服务器查询 Checkout 订单 ID 的状态。
现在的问题是我们不知道如何从应用程序本身获取 Checkout Order Id。
通过新的应用内购买 API,我们可以获取每一项应用内购买的结账订单 ID,但不能获取应用内购买的结账订单 ID。
We would like to allow our users to activate a service on one of our servers with each app purchased from the Android Market, verifying that the user has really purchased the app.
For this purpose we are evaluating to use Google Checkout's Notification History API, which allows us to query from our server the status of a Checkout Order ID.
Now the problem is that we don't know how to obtain the Checkout Order Id from the app itself.
With the new in-app purchases API we can get Checkout Order Id for each one of the in-app purchases, but not for the app purchase.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
获取应用购买确认的更好解决方案是使用市场许可验证服务。
该库的目的是让您的应用程序确认用户确实购买了相关应用程序。
为了检查来自外部服务器的事务,您可以使用 这篇博文。
本质上,它建议您将 ResponseData 类中包含的许可证服务器响应的副本及其签名发送到您的在线服务器。然后,您的服务器可以验证用户是否已获得许可。
由于许可证响应是经过加密签名的,因此您的服务器可以使用存储在 Android Market 发布者控制台中的 RSA 公钥进行检查,以确保许可证响应未被篡改。
A better solution for getting confirmation of an app purchase is by using the Market Licensing Verification Service.
The purpose of this library is to let your app confirm that the user has actually purchased the app in question.
In order to check the transaction from your external server, you can use the techniques described under the heading "Offload license validation to a trusted server" on this blog post.
In essence, it suggests that you send a copy of the license server response, contained inside the ResponseData class, along with its signature, to your online server. Your server can then verify that the user is licensed.
Since the license response is cryptographically signed, your server can check to make sure that the license response hasn’t been tampered with by using the public RSA key stored in the Android Market publisher console.