android – 如何检测Google Play购买是通过测试帐户还是常规帐户进行的

我正在构建一个应用程序,我必须检测购买是测试购买(从测试帐户制作)还是真实用户的真实购买.请注意,该应用程序已经存在,我正在使用的SKU与生产中的相同.

Google可以检测购买是否是测试,因为它显示了一条消息(“这是一个测试订单,哟不会收费”),但我正在寻找一种以编程方式检测的方法.

最佳答案 如果它不需要实时,您应该能够通过以编程方式使用gsutil下拉销售报告来解决日期,然后解析CSV以获取标题带有前缀的任何订单“测试:“.

https://support.google.com/googleplay/android-developer/answer/6135870?p=financial_export&rd=1#export

Download reports from Google Cloud Storage

Monthly reports are available from Google Cloud Storage. Reports
are generated daily and accumulated in monthly CSV files. They are
stored in a private Google Cloud Storage bucket for your Google Play
Developer account.

You can access reports using Google Cloud Storage on your browser or
programmatically using gsutil. You can also use other tools to
programmatically access your Cloud Storage bucket.

Tip: If you want to import your reports from
Google Cloud Storage into BigQuery, you need to convert the CSV files from
UTF-16 to UTF-8.

Your Google Cloud Storage bucket ID is listed near the bottom of
your Reports pages.

Your bucket ID begins with pubsite_prod_rev (example:
pubsite_prod_rev_01234567890987654321).

点赞