Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to detect refund? #69

Open
kewitschka opened this issue Dec 30, 2023 · 3 comments
Open

How to detect refund? #69

kewitschka opened this issue Dec 30, 2023 · 3 comments

Comments

@kewitschka
Copy link

kewitschka commented Dec 30, 2023

How do I know if a purchase was refunded? Is it sufficient to use billingConnector.isPurchased() and in case of a refund it returns false?

@wicaodian
Copy link

using a test account I purchased the product and from the Play Store console I refunded with removed entitlement but somehow it's still showing onPurchasedProductsFetched

@kewitschka
Copy link
Author

The result of my research is that it is not possible with Google's IAP library. The only reliable way is to use the Voided Purchases API, which requires a server: https://developers.google.com/android-publisher/voided-purchases?hl=en

@wicaodian
Copy link

I have 5 Non-consumeable items
Before onPurchasedProductsFetched I call my function to reset purchases which is removing all shared prefs
and when onPurchasedProductsFetched I re-enable all the purchased products Obviously, I check for an internet connection to ensure that I don't reset purchases without being able to get the purchased products again.

This way If I refund the product from the console I was able to reset it because the product will not be fetched and No preference will be saved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants