Skip to content
This repository has been archived by the owner on Apr 28, 2022. It is now read-only.

Fix JSONException with test orders #32

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
Expand Down