I am making an In-app purchase test with test account but the response from google is same as the purchase made from real account. How to check if the purchase is test based on the response from google?
Asked
Active
Viewed 446 times
0
-
Have you check the Google Help about? – Apr 03 '19 at 09:42
-
Yes, I checked it. But there's no examples stating the response or differentiating test with real purchase. Do you know this? Am I missing something? @Nikos – The Keeper Apr 03 '19 at 09:47
-
You need to provide some code in order someone here can help you check some internet tutorials about https://github.com/googlesamples/android-play-billing and https://github.com/anjlab/android-inapp-billing-v3 – Apr 03 '19 at 09:51
-
Every document explains how to integrate it. But I wish to know the response that we will get after making a purchase. Im able to do integrate and working fine, the only thing I stuck is differentiating test transactions and marking it as test transactions, so that I could query the valid transaction only to see my revenue. Even test purchases returns same like response like in real account purchase. That's the solution I couldn't find. Hope this explains @Nikos – The Keeper Apr 03 '19 at 10:08
1 Answers
0
Yes, you can check that from the purchaseType field of the Google's Purchases.subscriptions API response refer.
Field: purchaseType
Type: integer
Description: The type of purchase of the subscription. This field is only set if this purchase was not made using the standard in-app billing flow. Possible values are: 0 = Test (i.e. purchased from a license testing account)
As Google suggests, You have to develop a web server from where you can get a comprehensive list of fields. If you want to know more about the web server follow then refer to my this answer.

Community
- 1
- 1

Kishan Vaishnav
- 2,273
- 1
- 17
- 45