6
votes

It appears when I get the Purchases.subscriptions resource for a purchaseToken using the Google Play Developer API that test purchases do not include the paymentState property. However, real purchases seem to always include it. So is it safe to assume that when a Purchases.subscriptions resource does not include the paymentState property that that purchaseToken was from a test purchase?

We are validating purchaseTokens and renewals server-side and are looking for a better solution for determining if a purchase was a test purchase or not without having to depend on the presence or absence of an orderId which is only available to the app.

2
I'm wondering the same thing. Did you figure out if paymentState is only available on real purchases?Brien Crean
Same here, seeing similar behavior and I'd like to know the answer to this question, toocrockpotveggies
In case anyone else is wondering, after hundreds of requests to the Google Play API endpoint Purchases.subscriptions: get. The paymentState property was missing from every Purchases.subscriptions resource responseBrien Crean

2 Answers

1
votes

since July 10th 2017, Google Play now provides an orderID from test purchases.

0
votes

So I realized that using paymentState was not the correct way to detect a test purchase. I noticed that if a purchaseToken had a failed payment, the paymentState property was not returned either. So we finally just settled on using the absence or presence of the orderId passed to us from the app.