From 4246e238f9f4d586694ef243553697c476c0194a Mon Sep 17 00:00:00 2001 From: mullpav Date: Thu, 8 Oct 2015 16:35:25 +0200 Subject: [PATCH] Fix JSONException with test orders Same fix as here: https://github.com/anjlab/android-inapp-billing-v3/pull/99/files --- .../java/org/onepf/opfiab/google/model/GooglePurchase.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/opfiab-providers/google/src/main/java/org/onepf/opfiab/google/model/GooglePurchase.java b/opfiab-providers/google/src/main/java/org/onepf/opfiab/google/model/GooglePurchase.java index 37e0959..024069c 100644 --- a/opfiab-providers/google/src/main/java/org/onepf/opfiab/google/model/GooglePurchase.java +++ b/opfiab-providers/google/src/main/java/org/onepf/opfiab/google/model/GooglePurchase.java @@ -35,7 +35,7 @@ public class GooglePurchase extends GoogleModel { private static final String NAME_AUTO_RENEWING = "autoRenewing"; - @NonNull + @Nullable private final String orderId; @NonNull private final String packageName; @@ -51,7 +51,7 @@ public class GooglePurchase extends GoogleModel { public GooglePurchase(@NonNull final String originalJson) throws JSONException { super(originalJson); - this.orderId = jsonObject.getString(NAME_ORDER_ID); + this.orderId = jsonObject.optString(NAME_ORDER_ID, null); this.packageName = jsonObject.getString(NAME_PACKAGE_NAME); this.purchaseToken = jsonObject.getString(NAME_PURCHASE_TOKEN); this.developerPayload = jsonObject.optString(NAME_DEVELOPER_PAYLOAD, null);