From b5e00e5c3db7fc7121aeff6dc7d20b21740d47e5 Mon Sep 17 00:00:00 2001
From: Andrew Solovay This method returns a response code integer mapped to the {@code RESPONSE_CODE} key, and a {@code PendingIntent} to launch the puchase flow for the in-app item mapped to the {@code BUY_INTENT} key. When it receives the {@code PendingIntent}, Google Play sends a response {@code Intent} with the data for that purchase order. The data that is returned in the response {@code Intent} is summarized in table 3.
+ This method returns a response code integer mapped to the {@code
+ RESPONSE_CODE} key, and a {@link android.app.PendingIntent} to launch the
+ purchase flow for the in-app item mapped to the {@code BUY_INTENT} key, as
+ described in Purchasing an
+ Item. When it receives the {@link android.app.PendingIntent}, Google Play
+ sends a response {@code Intent} with the data for that purchase order. The
+ data that is returned in the response {@code Intent} is summarized in table
+ 3.
+
Table 3. Response data from an In-app Billing Version 3 purchase request.
{@code type}
- Value must be “inapp” for an in-app product or "subs" for
-subscriptions.
+ Value must be
“inapp” for an in-app product or
+ "subs" for subscriptions.
{@code price}
@@ -140,7 +141,17 @@ does not include tax.
The getBuyIntent() method
-
{@code RESPONSE_CODE}
- 0 if the purchase was success, error otherwise.
+ Value is
0 if the purchase was success, error otherwise.
{@code INAPP_PURCHASE_DATA}
@@ -175,10 +186,23 @@ RSASSA-PKCS1-v1_5 scheme.
+ Field
Description
+
+
{@code autoRenewing}
+ Indicates whether the subscription renews automatically. If
+
true, the subscription is active, and will
+ automatically renew on the next billing date. If false,
+ indicates that the user has canceled the subscription. The user has
+ access to subscription content until the next billing date and will
+ lose access at that time unless they re-enable automatic renewal
+ (or manually renew, as described in
+ Manual
+ Renewal).
{@code orderId}
- A unique order identifier for the transaction. This corresponds to the Google Wallet Order ID.
+ A unique order identifier for the transaction. This identifier
+ corresponds to the Google Wallet Order ID.
{@code packageName}
@@ -194,7 +218,8 @@ RSASSA-PKCS1-v1_5 scheme.
{@code purchaseState}
- The purchase state of the order. Possible values are 0 (purchased), 1 (canceled), or 2 (refunded).
+ The purchase state of the order. Possible values are
0
+ (purchased), 1 (canceled), or 2 (refunded).
{@code developerPayload}
@@ -202,20 +227,80 @@ RSASSA-PKCS1-v1_5 scheme.
{@code purchaseToken}
- A token that uniquely identifies a purchase for a given item and user
- pair. This token may be up to 1,000 characters long.
- Pass this entire token to other methods, such as when you consume the
- purchase (as described in
-Consume
- a Purchase). Do not abbreviate or truncate this token.
+ A token that uniquely identifies a purchase for a given item and user pair.
This method is used to upgrade or downgrade a subscription purchase. The method
+is similar to getBuyIntent(), except
+that it takes a list of already-purchased SKUs that are to be
+replaced with the SKU being purchased. When the user completes the purchase,
+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.
This method was added with version 5 of the in-app billing API. To verify
+that the method is reported, send an isBillingSupported AIDL
+request.
Note: You can only use this method for
+subscription purchases. If the passed type parameter is anything
+other than "subs", the method returns
+BILLING_RESPONSE_RESULT_DEVELOPER_ERROR.
+Furthermore, the passed SKUs may not include SKUs for seasonal
+subscriptions.
+ This method returns a response code integer mapped to the {@code + RESPONSE_CODE} key, and a {@link android.app.PendingIntent} to launch the + purchase flow for the in-app subscription mapped to the {@code BUY_INTENT} + key, as described in Purchasing an + Item. When it receives the {@link android.app.PendingIntent}, Google Play + sends a response {@code Intent} with the data for that purchase order. The + data that is returned in the response {@code Intent} is summarized in table + 5. +
+ ++Table 5. Response data from an In-app Billing Version 5 purchase request.
+| Key | +Description | +
|---|---|
| {@code RESPONSE_CODE} | +Value is 0 if the purchase succeeds. If the purchase fails, contains an error
+ code. |
+
| {@code INAPP_PURCHASE_DATA} | ++ A String in JSON format that contains details about the purchase order. + See table 4 for a description of the JSON fields. + | +
| {@code INAPP_DATA_SIGNATURE} | +String containing the signature of the purchase data that the developer + signed with their private key. The data signature uses the + RSASSA-PKCS1-v1_5 scheme. | +
This method returns the current un-consumed products owned by the user. Table 5 lists the response data that is returned in the {@code Bundle}.
-Table 5. Response data from a {@code getPurchases} request.
+Table 6. Response data from a {@code getPurchases} request.| Key | @@ -223,7 +308,7 @@ RSASSA-PKCS1-v1_5 scheme.||
|---|---|---|
| {@code RESPONSE_CODE} | -0 if the request was successful, error otherwise. | +Value is 0 if the request was successful, error otherwise. |
| {@code INAPP_PURCHASE_ITEM_LIST} | diff --git a/docs/html/google/play/billing/billing_subscriptions.jd b/docs/html/google/play/billing/billing_subscriptions.jd index b9b77df493dd..8f55354e5b6d 100644 --- a/docs/html/google/play/billing/billing_subscriptions.jd +++ b/docs/html/google/play/billing/billing_subscriptions.jd @@ -1,4 +1,4 @@ -page.title=In-App Subscriptions +page.title=In-app Subscriptions parent.title=In-app Billing parent.link=index.html page.metaDescription=Subscriptions let you sell content or features in your app with automated, recurring billing. @@ -21,6 +21,11 @@ meta.tags="monetization, inappbilling, subscriptions" Developer API.