简体   繁体   中英

How to cancel in-app test purchase with billing:2.0.3 library

I use kotlin example from google in my app (com.android.billingclient:billing:2.0.3).

Since I call playStoreBillingClient.acknowledgePurchase(params) and try to cancel purchase with cosumeAsync(token) (which ok with 1.2 version) I get next error:

/** Failure to consume since item is not owned */ int ITEM_NOT_OWNED = 8;

From google docs https://developer.android.com/google/play/billing/billing_testing

"Cancel a completed test purchase Google Play accumulates completed test purchases for each user but does not pass them on to financial processing. Test purchases are not automatically canceled, so you might want to manually cancel a test purchase to continue testing. To do so, open the app page in the Play Store."

But what I should do on app page?

Also I tried to refund from google play console

This worked for me, refund the purchase in the play console, then clear Google play store cache and data.[This is if you have acknowledge the purchase].

To save stress, you can do it this way, when the purchase is made, do not acknowledge the purchase, the purchase will be refunded automatically after 5 minutes, then you will be able to test the purchase again. If you are done testing, you can now acknowledge the purchase.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM