0

I can't test this myself, because there is no way to completely terminate subscription, apparently.

So, I want to test the following use case: user buys subscription, cancel's it (or it expires), than user buys same subscription.

What will I get with RESTORE_TRANSACTIONS response? Will I get two items with same item id, different purchase tokens and different state? Or purchaseToken will remain the same? I'm afraid that there will be only one subscription with different order ID and purchase token, and the information on previous subscriptions will be lost, but I can't confirm it right now. Also, will orderId be changed with every recurring purchase inside a subscription?

Why I need this - subscription will supply user with new content daily, so when user cancel subscription (subscription A) and later buys a new one (subscription B) I need to show to user content released during time-frame of subscription A,and content in a time-frame of subscription B, but not the content released in period used didn't had active subscription.

Sver
  • 3,349
  • 6
  • 32
  • 53

1 Answers1

1

Note: You should use the RESTORE_TRANSACTIONS request type only when your application is installed for the first time on a device or when your application has been removed from a device and reinstalled.

Using RESTORE_TRANSACTIONS on a regular basis is not recommended because of performance impacts.

Taken right from Android Developers http://developer.android.com/guide/google/play/billing/billing_overview.html

Although I do understand your concern for the Subscription Billing. Google is pretty good about their API and how you should interact with purchases.

When you send a RESTORE_TRANSACTIONS request you will get two broadcast back. A RESPONSE_CODE and a PURCHASE_STATE_CHANGED. Here's the table from Google stating the different values you could receive.

enter image description here

Coming back to your question about buying two subscriptions: you should check to see if the user has bought a subscription with the GET_PURCHASE_INFORMATION request, if the Subscription is in the list check the Purchase State of the Subscription to see if you should continue with the purchase.

As for what you would get if you "Could" buy two of the same subscriptions, its (I want to say impossible) unlikely... But you will get two order transactions.

As long as you're always aware of the user transactions on your part, Google's API will do the rest. Good luck!

Community
  • 1
  • 1
Nate-Wilkins
  • 5,364
  • 4
  • 46
  • 61
  • So, you mean I cant buy expired subscription again? Also, how do I check if he bough subscription with GET_PURCHASE_INFORMATION? I cant initiate this request myself, because i need notify ID. – Sver Oct 03 '12 at 03:10
  • Also, after RESTORE_TRANSACTIONS request I'm getting a json with all products I purchased. API docs states that I can "restore a record of subscription transactions". Does it means that there will be more than one record for each subscription? Will I get transaction info for every recurring payment billed to user? – Sver Oct 03 '12 at 03:16
  • No you can buy expired subscriptions again - they'll show up as another transaction for the same item, one as expired (or canceled) and one as active (purchased successfully) As for the json will give you all the subscription ever purchased (which is why you don't want to call this repeatedly) `Bundle request = makeRequestBundle("GET_PURCHASE_INFORMATION");` I'll leave another comment later, gotta get to school. – Nate-Wilkins Oct 03 '12 at 10:23
  • So yes you will get recurring transactions that have a `purchase state` whether it be active or not you will get all the transactions for that user. – Nate-Wilkins Oct 03 '12 at 17:17
  • Are you able to get cancelled or expired subscription response? In my case when i restore transaction i get only in-app products,not subscription.Any idea why? – Ads Jan 16 '13 at 11:11