I'm building an app where I have to detect if a purchase is a test purchase (made from a test account) or a real purchase from a real user. Note that the app is already live, and the SKU's I'm using are the same as the ones in production.
Google can detect if a purchase is a test, because it shows a message ("This is a test order, yo will not be charged"), but I'm looking for a way to detect that programmatically.
If it doesn't need to be in real-time, you should be able to rectify it day(s) later by programmatically pulling down the sales reports with gsutil
, and then parsing the CSVs for any orders where the title is prefixed with "Test: ".
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
toUTF-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
).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With