I'm trying to add in-app billing in my app; everything works ok except for refunds. Since I have been struggling with this for the past few days, it still amazes me that there is no way to determine from the app's perspective whether a user has requested a refund. After the user has received a refund, I want to have the option to terminate access to a one-time managed product (remove advertisements). I am utilizing Google Play APIs because I do not use a backend.
I tried using queryPurchaseHistoryAsync, which returns a list of the user's most recent purchases, to query the Google Play APIs. Given that the purchases are still present even after requesting a refund, this does not appear to operate (been waiting for one day before writing this).
Here's what I did:
- Install the app on a real device
- Buy the in-app content
- Verify that app unlocks the content
- Go to my Google Play order history and ask for refund for the in-app product
- 10 minutes later the transaction got refunded (without me as a developer being involved at all)
- App still provides the paid content
- Cleaning Play Store App data & cache
- App still provides the paid content
So after purchasing my in-app product, any customer can request a refund on his Google Play page right away? Is it just me, or is this API a nightmare? Am I missing something simple?
The PurchaseState enum is
public @interface PurchaseState {
// Purchase with unknown state.
int UNSPECIFIED_STATE = 0;
// Purchase is completed.
int PURCHASED = 1;
// Purchase is waiting for payment completion.
int PENDING = 2;
}
I do not see anything related to refunded here, This seems to me a pretty normal use case, so I'm still thinking that I am missing some key piece of information, how do I do this?
Thanks for any help