From c860242cc12d386e7e98d67d88024a1620a6ce95 Mon Sep 17 00:00:00 2001 From: Andrew Solovay Date: Fri, 6 Feb 2015 17:29:24 -0800 Subject: [PATCH] docs: Noted that purchaseToken is long and cannot be truncated. Noted in reference and integration doc that the token for Google Play purchases may be up to 1,000 chars long, and the entire token must be returned (not abbreviated or truncated) to any method that needs it. See first comment for doc stage location. bug: 19099521 Change-Id: I0a0f187293ea522c218f6c3287b4c36ee6725a90 --- docs/html/google/play/billing/billing_integrate.jd | 12 ++++++++++-- docs/html/google/play/billing/billing_reference.jd | 7 ++++++- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/docs/html/google/play/billing/billing_integrate.jd b/docs/html/google/play/billing/billing_integrate.jd index 052cf7519bac..e3cacf9254c1 100644 --- a/docs/html/google/play/billing/billing_integrate.jd +++ b/docs/html/google/play/billing/billing_integrate.jd @@ -232,7 +232,7 @@ startIntentSenderForResult(pendingIntent.getIntentSender(), 1001, new Intent(), Integer.valueOf(0), Integer.valueOf(0), Integer.valueOf(0)); -

Google Plays sends a response to your {@link android.app.PendingIntent} to the {@link android.app.Activity#onActivityResult onActivityResult} method of your application. The {@link android.app.Activity#onActivityResult onActivityResult} method will have a result code of {@code Activity.RESULT_OK} (1) or {@code Activity.RESULT_CANCELED} (0). To see the types of order information that is returned in the response {@link android.content.Intent}, see In-app Billing Reference.

+

Google Play sends a response to your {@link android.app.PendingIntent} to the {@link android.app.Activity#onActivityResult onActivityResult} method of your application. The {@link android.app.Activity#onActivityResult onActivityResult} method will have a result code of {@code Activity.RESULT_OK} (1) or {@code Activity.RESULT_CANCELED} (0). To see the types of order information that is returned in the response {@link android.content.Intent}, see In-app Billing Reference.

The purchase data for the order is a String in JSON format that is mapped to the {@code INAPP_PURCHASE_DATA} key in the response {@link android.content.Intent}, for example:

@@ -243,11 +243,19 @@ startIntentSenderForResult(pendingIntent.getIntentSender(),
    "purchaseTime":1345678900000,
    "purchaseState":0,
    "developerPayload":"bGoa+V7g/yqDXvKRqq+JTFn4uQZbPiQJo4pf9RzJ",
-   "purchaseToken":"rojeslcdyyiapnqcynkjyyjh"
+   "purchaseToken":"opaque-token-up-to-1000-characters"
  }'
 

+

Note: Google Play generates a token for the +purchase. This token is an opaque character sequence that 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; you must save and +return the entire token.

+

Continuing from the previous example, you get the response code, purchase data, and signature from the response {@link android.content.Intent}.

 @Override
diff --git a/docs/html/google/play/billing/billing_reference.jd b/docs/html/google/play/billing/billing_reference.jd
index 902c2c6b34eb..da9178d27a00 100644
--- a/docs/html/google/play/billing/billing_reference.jd
+++ b/docs/html/google/play/billing/billing_reference.jd
@@ -202,7 +202,12 @@ RSASSA-PKCS1-v1_5 scheme.
   
   
     {@code purchaseToken}
-    A token that uniquely identifies a purchase for a given item and user pair. 
+    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.
   
 
 

-- 2.11.0