Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"You already own this item" but getPurchases is empty [duplicate]

I purchased a subscription (not a Managed Product or Unmanaged Product) yesterday to test, I refunded myself and then cancelled the subscription. After the refunding and cancelling, when I call:

m_billingService.getPurchases(3, m_context.getPackageName(), ITEM_TYPE_SUBS, null)

It would return my purchase with a purchase state of 0 (valid/ok). Today when I call the same method, it returns nothing. Yet when I try to purchase the item, google play store responds that I already own the item.

I've already restarted the android device, cleared the google play services cache and ensured only the test account is activate on my phone (i.e., I removed my google developer account).

The question has been asked before but always under the context of products and not subscriptions. The answer for those posts seem to be to "consume" the product; subscriptions are not consumed.

like image 350
Paul Avatar asked Sep 05 '14 22:09

Paul


2 Answers

I am fairly certain that what you are trying to do is not possible the way you are trying to do it. As I am not sure the subscription length, it is possible that to Google you are indeed still an owner of the subscription, because it remains active for the remaining period even if you initiate a refund.

This allow users to get a refund from the purchase but also still receive the service. This would be at the app owners discretion. This can be a good strategy if you want to handle a user with a valid complaint but also allow them to maintain access until you can fix their issue or complaint. It could also help to minimize the effect of poor ratings.

In order to do what you are wanting you need to revoke the subscription, and that will immediately terminate it. After this calling m_billingService.getPurchases() should work correctly.

Documentation

like image 114
Jared Reeves Avatar answered Nov 09 '22 17:11

Jared Reeves


When you cancel and/or refund a subscription purchase, the subscription is not immediately terminated -- it remains valid until its expiration time.

Instead, you have to revoke a subscription purchase in order to provide a refund and immediately terminate the subscription.

See this section of the Google Play API Reference for more info on the cancel, refund, and revoke methods.

like image 38
cybersam Avatar answered Nov 09 '22 18:11

cybersam