简体   繁体   中英

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...).

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. All information about purchase data is described here:

(Table 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. 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

Google Play In-app Billing samples for more clarity: https://github.com/googlesamples/android-play-billing

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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