How to detect refund with google billingclient library

戏子无情 提交于 2019-12-21 04:12:14

问题


I was wondering how to detect a refund, or any type of cancelation of an in-app purchase(not a subscription and not a consumable).

I'm currently making my test and when I refund a test in google like that :

The purchase is still present in billingClient.queryPurchaseHistoryAsync() (even in queryPurchase()).

How can I detect such changes and how can I disable my app for refunded users?

Thanks in advance.


回答1:


Have to tried this function

PurchasesUpdatedListener

Listener interface for purchase updates which happen when, for example, the user buys something within the app or by initiating a purchase from Google Play Store.

void onPurchasesUpdated (int responseCode, 
                List<Purchase> purchases)

Implement this method to get notifications for purchases updates. Both purchases initiated by your app and the ones initiated by Play Store will be reported here.

OnPurchasesUpdated on developer.android



来源:https://stackoverflow.com/questions/52484588/how-to-detect-refund-with-google-billingclient-library

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!