1

I'm using the in app purchases implementation of the Trivial Drive example. I can't figure out how to get the inventory with cancled and refunded items, so I can decide on my own how refunded items are handled.

Does getPurchases from the InAppBillingService class not return refunded items?

Edit: getPurchaseHistory says in the description: "The getPurchaseHistory() method This method returns the most recent purchase made by the user for each SKU, even if that purchase is expired, canceled, or consumed"

A bit below it says that it is available in version 6 of the billing API. That version is not yet released though: "This method is available in version 6 and later of the in-app billing API."

I tried to use the method and it seems to work partially. I replaced:

mService.getPurchass(3, mContext.getPackageName(),
                    itemType, continueToken);

with

mService.getPurchaseHistory(6, mContext.getPackageName(),
                    itemType, continueToken, new Bundle());

and it indeed shows the item I purchased and refunded. But when I call the purchase state it returns 0/purchased, altough it should return 2 for refunded.

Since I want people to be able to still use the premium features altough refunded it wouldn't matter for me.

Problem is though that now even canceled purchases would get the premium features of my app I assume, in case that it does not return the correct purchase state.

JayTee
  • 1,114
  • 2
  • 11
  • 18

0 Answers0