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 find purchase state in new version, since Purchase.getPurchaseState() is no longer available? #113

Closed
OneLiteCore opened this issue Jan 1, 2018 · 3 comments
Labels
play billing library issues filed against the Google Play Billing Library or services

Comments

@OneLiteCore
Copy link

In old version com.android.billingclient:billing:dp-1 we could use Purchase.getPurchaseState() method to get the state of it. But this is no longer available in the new version com.android.billingclient:billing:1.0.

In docs Play Billing Library: Querying for purchased items it says that:

You can then call a variety of methods on the Purchase object to view relevant information about the item, such as its 【【【purchase state】】】 or time. To view the types of product detail information that are available, see the list of methods in the Purchase class.

But, as you can see, there is NO such a thing.

Another question is, how could we get those CANCELED and REFUND ones?

According to the docs, we could use BillingCliend.queryPurchases() to get PURCHASED items, and use BillingCliend.queryPurchaseHistoryAsync() to get all items. With this two methods we could know which item is NOT PURCHASED, but never will we know what is it in the end.

@TobiasReich
Copy link

Good question. I was looking for the same info. Any idea yet?

@MrBIMC
Copy link

MrBIMC commented Jul 12, 2018

From what I understood by reading different stuff in google, google really doesn't want in-apps to be refundable and you should not handle refunds with few rare exceptions.

From inside of the app perspective, you should respect the purchase no matter was it refunded or not and just let it be.

Technically, yes, there will be few situations where it will lead to users getting in-app for free, but these would be rare and you can't do anything about it.

So the only adaptation I did is added clause regarding refunds policy to app's license agreement and I stated that refunds won't be issued unless they've been granted by google. And google's refund policy regarding in-apps is kinda similar and reads as "we don't issue refunds with few rare exceptions".

@isaidamier isaidamier added the play billing library issues filed against the Google Play Billing Library or services label Aug 20, 2019
@isaidamier
Copy link
Contributor

Apologies for the issues you are experiencing. Please upgrade to the latest version of the library to find Purchase.getPurchaseState(). If the issue is still not resolved, please post this question on StackOverflow. Presently we are reserving Github for questions specifically about the samples so we can better serve you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
play billing library issues filed against the Google Play Billing Library or services
Projects
None yet
Development

No branches or pull requests

4 participants