Question

Is there any chances to get price of purchased item?

When I use Google trivialdrivesample sources I process Purchase entity in such way:

public class Purchase {
    long mPrice;

    public Purchase(String itemType, String jsonPurchaseInfo, String signature) throws JSONException {
        mItemType = itemType;
        mOriginalJson = jsonPurchaseInfo;
        JSONObject o = new JSONObject(mOriginalJson);
        mPrice = o.optLong("price");
        . . . . 
    } 
    . . . .
}
Was it helpful?

Solution

Here is a sample json:

{"orderId":"1234567890.098876565434321","packageName":"com.bla.bla","productId":"blabla","purchaseTime":1393827852653,"purchaseState":0,"purchaseToken":"alot of bla bla bla"}

Sorry but there is no price in the purchase object.

but you can start a getSkuDetails() request and you will get the price from that.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top