How to detect plan change for android's in-app purchase using GoogglePlay developer API?
<p>thansk for reading</p>

<h2>Context</h2>

<p>We provide on-demand video streaming that user can purchase via monthly or yearly subscription on android, ios &amp; web</p>

<p>Thus whenever purchases was made on Android, the app send our server a (<strong>purchaseToken, subscriptionID) pair</strong>, and we use <a href="https://developers.google.com/android-publisher/api-ref/purchases/subscriptions/get#http-request" rel="nofollow">this google developer API</a> to persists the subscription info in our db</p>

<h2>Problem</h2>

<p>Recently, we added support for user to change their plan on Android. On Google side, the money is prorated and the new subscription is created. However, the old subscription's start and end time is still the same on the developer API.</p>

<p>We can't say for sure that the old subscription was cancelled and replaced with a new one because the payload (<a href="https://developers.google.com/android-publisher/api-ref/purchases/subscriptions#resource-representations" rel="nofollow">defined here</a>) only tell you above auto-renew status. Plus the cancel reason of 1 is a blanket for anything that's not user-initiated, not just plan change.</p>

<p>I am making a work around, but it requires knowing a few things, like:</p>

<ul>
<li>When you switch from a more expensive, longer plan (yearly) to a shorter one (monthly), will all the remaining money be prorated, effectively making your new subscription last longer than its normal duration?</li>
</ul>

<p>which seems likely, based on this:</p>

<blockquote>
  <p>Google Play cancels the old SKUs and credits the user with the unused value of their subscription time on a pro-rated basis. Google Play applies this credit to the new subscription, and does not begin billing the user for the new subscription until after the credit is used up.</p>
</blockquote>

<ul>
<li>When you cancel the newer subscription, will it happen the same way as cancelling a normal subscription? (i.e, the subscription is not auto renewed, but should stay in effect till the end of its duration), or some credit will be stored with Google to be used later?</li>
</ul>