You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/html/guide/google/play/billing/billing_subscriptions.jd
+23-8Lines changed: 23 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -241,9 +241,10 @@ store the token locally or pass it to your backend servers, which can then use
241
241
it to validate or cancel the subscription remotely using the <a
242
242
href="#play-dev-api">Google Play Android Developer API</a>.</p>
243
243
244
-
<p>In the case of billing errors, such as could happen if the customer’s credit
245
-
card becomes invalid, Google Play notifies your app of the change in purchase
246
-
state.</p>
244
+
<p>If a recurring payment fails, such as could happen if the customer’s credit
245
+
card has become invalid, the subscription does not renew. Google Play notifies your
246
+
app at the end of the active cycle that the purchase state of the subscription is now "Expired".
247
+
Your app does not need to grant the user further access to the subscription content.</p>
247
248
248
249
<p>As a best practice, we recommend that your app includes business logic to
249
250
notify your backend servers of subscription purchases, tokens, and any billing
@@ -626,13 +627,13 @@ purchased subscriptions at launch or prior to granting access to subscriber
626
627
content.</p>
627
628
628
629
<p>With In-app Billing, you validate a subscription by keeping track of its
629
-
purchase state, such as purchased or cancelled, and then checking the state
630
-
whenever needed. Google Play provides two ways to let you know when the purchase
630
+
purchase stateand then checking the state whenever needed. Google Play
631
+
provides two ways to let you know when the purchase
631
632
state of a subscription changes:</p>
632
633
633
634
<ul>
634
635
<li><em>In-app Billing Notifications</em>. Google Play pushes a notification
635
-
to your app whenever the purchase state of a subscription changes. Your app can
636
+
to your app to indicate a change in the purchase state of a subscription. Your app can
636
637
store the most recent purchase state for a given purchase token and then check
637
638
that state at run time, as needed.</li>
638
639
<li><em>Google Play Android Developer API</em>. You can use this HTTP-based
@@ -689,7 +690,8 @@ values for subscription purchases, as received with a
689
690
<td>Purchased successfully</td><td><code>0</code></td><td>Sent at original purchase only (not at recurring billing cycles).</td></tr>
690
691
<td>Cancelled</td><td><code>1</code></td><td>Sent at original purchase only if the purchase has failed for some reason. </td></tr>
691
692
<td>Refunded</td><td><code>2</code></td><td>The purchase was refunded.</code></td></tr>
692
-
<td>Subscription expired</td><td><code>3</code></td><td>Sent if a subscription expires because of non-payment or user cancelation.</td></tr>
693
+
<td>Subscription expired</td><td><code>3</code></td><td>Sent at the end of a billing cycle to indicate that the subscription expired without renewal because of non-payment or user-cancellation. Your app does not need to grant continued access to the subscription content.
694
+
</td></tr>
693
695
</table>
694
696
695
697
@@ -718,7 +720,7 @@ startActivity(intent);</pre>
718
720
<p>For more information, see
719
721
<a href="{@docRoot}distribute/googleplay/promote/linking.html">Linking to Your Products</a>.</p>
720
722
721
-
<h3 id="purchase-state-changes">Recurring billing and changes in purchase state</h3>
723
+
<h3 id="purchase-state-changes">Recurring billing, cancellation, and changes in purchase state</h3>
722
724
723
725
<p>Google Play notifies your app when the user completes the purchase of a
724
726
subscription, but the purchase state does not change over time, provided that
@@ -730,6 +732,19 @@ non-payment or user cancellation</em>. </p>
730
732
recurring billing events — those are all handled by Google Play and they
731
733
are transparent to your application if billing is successful.</p>
732
734
735
+
<p>When the user cancels a subscription during an active billing cycle, Google
736
+
Play <em>does not</em> notify your app immediately of the change in purchase
737
+
state. Instead, it waits until the end of the active billing cycle and then
738
+
notifies your app that the purchase state has changed to "Expired". </p>
739
+
740
+
<p>Similarly, if payment for the next billing cycle fails, Google Play waits
741
+
until the end of the active billing cycle and then notifies your app at that time that the
742
+
purchase state has changed to "Expired".</p>
743
+
744
+
<p>Your app can handle user cancellation and non-payment in the same way, since both cause
745
+
a change to the same "Expired" purchase state. Once the purchase state has become "Expired",
746
+
your app does not need to grant further access to the subscription content.</p>
747
+
733
748
<h3 id="modifying">Modifying your app for subscriptions</h3>
734
749
735
750
<p>For subscriptions, you make the same types of modifications to your app as
0 commit comments