我的服务器可以获得有关应用程序内购买的哪些信息?

What information can my server get about an app's in-app purchases?

我正在尝试使用 Google Play Billing Library 实现应用内购买(消耗品)。(事实证明它没有我想要的那么简单...)。

为了规划工作流程,我想知道后端服务器(或应用程序,然后可以由服务器验证)有哪些关于应用程序购买的信息可用。例如:我可以获取购买日期和时间吗?

是的,你肯定可以获得购买的日期和时间、订单id、状态、购买令牌等等。有关购买数据的所有信息都在此处描述:

(Table 7) https://developer.android.com/google/play/billing/billing_reference

关于服务器验证,官方文档说

Successful purchases also generate a purchase token, which is a unique identifier representing the user and the product ID for the in-app product they purchased. Your apps can store the purchase token locally or, ideally, pass it to your secure backend server where it can be used to verify the purchase and protect against fraud.

您需要实现的服务器验证流程步骤: https://developer.android.com/google/play/billing/billing_library_overview#Verify-purchase

Google 播放应用内结算示例更清晰: https://github.com/googlesamples/android-play-billing