简体   繁体   English

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

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

I'm trying to implement in-app purchases (consumable) using the Google Play Billing Library.(which is proving less straightforward that I would like...). 我正在尝试使用Google Play结算库来实现应用内购买(消耗品)(事实证明,这种方式不那么简单,我想...)。

In order to plan the workflow I'd like to know what information is available to a backend server (or to the app, and then can be verified by the server) about an app's purchases. 为了规划工作流程,我想知道后端服务器(或应用程序,然后可以由服务器验证)可以使用哪些有关应用程序购买的信息。 For example: can I get the date and time of purchase? 例如:我可以获取购买日期和时间吗?

Yes, you definitely can get the date and time of purchase, order id, state, purchase token and so on. 是的,您绝对可以获取购买的日期和时间,订单ID,状态,购买令牌等。 All information about purchase data is described here: 有关购买数据的所有信息在此处描述:

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

Concerning server verification, official doc says 关于服务器验证,官方文档说

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. 成功的购买还会生成购买令牌,该令牌是代表用户及其所购买的应用内商品的产品ID的唯一标识符。 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. 您的应用程序可以将购买令牌存储在本地,或者理想情况下,可以将其传递到安全的后端服务器,该服务器可以用来验证购买并防止欺诈。

The process steps of server verification you need to implement: https://developer.android.com/google/play/billing/billing_library_overview#Verify-purchase 您需要实施的服务器验证过程步骤: https : //developer.android.com/google/play/billing/billing_library_overview#Verify-purchase

Google Play In-app Billing samples for more clarity: https://github.com/googlesamples/android-play-billing Google Play应用内结算示例更加清晰: https//github.com/googlesamples/android-play-billing

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

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