From b3cfe0ccc8db33a1334f6588e8f67b6fd319e1d3 Mon Sep 17 00:00:00 2001 From: Anthony Chuinard Date: Tue, 9 Jun 2015 20:30:25 -0500 Subject: [PATCH] Fix JSONException with test orders Allow for null orderId as it is not present with test orders. --- library/src/com/anjlab/android/iab/v3/TransactionDetails.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/src/com/anjlab/android/iab/v3/TransactionDetails.java b/library/src/com/anjlab/android/iab/v3/TransactionDetails.java index 941ec8ae..6f63d6ba 100644 --- a/library/src/com/anjlab/android/iab/v3/TransactionDetails.java +++ b/library/src/com/anjlab/android/iab/v3/TransactionDetails.java @@ -36,7 +36,7 @@ public TransactionDetails(PurchaseInfo info) throws JSONException { JSONObject source = new JSONObject(info.responseData); purchaseInfo = info; productId = source.getString(Constants.RESPONSE_PRODUCT_ID); - orderId = source.getString(Constants.RESPONSE_ORDER_ID); + orderId = source.optString(Constants.RESPONSE_ORDER_ID); purchaseToken = source.getString(Constants.RESPONSE_PURCHASE_TOKEN); purchaseTime = new Date(source.getLong(Constants.RESPONSE_PURCHASE_TIME)); }