11

Am testing in-app purchase in my app, i made a test order then while refund it I forgot to check on remove Entitlement box, now am stuck with this in-app purchase

I contact play console support in 11 Aug and they always reply ("we are investigating the issue")

How to remove the Entitlement ?

Hussien Fahmy
  • 1,119
  • 6
  • 24

5 Answers5

15

There is a solution, from your app: consume the product.

Add this temporary code and run it for your purchase.

private fun testConsumePurchase(purchase: Purchase) {
    val params = ConsumeParams.newBuilder()
        .setPurchaseToken(purchase.purchaseToken)
        .build()
    billingClient.consumeAsync(params) { _, _ ->
        Timber.w("Consumed!")
    }
}

After this, remove the code and continue testing as usual. You will not own the SKU anymore and you will be unblocked, you can buy it again on your main test account. Remember next time to check the "Remove Entitlement" box with your refund :-)

RumburaK
  • 1,985
  • 1
  • 21
  • 30
  • but this purchase in non-consumable (one-time purchase) – Hussien Fahmy Oct 16 '21 at 19:22
  • Actually, the in-app purchase does not have a consumable attribute defined. It's up to you how you use it. For example my in-app purchase was also non-consumable. However I decided to consume it once to unblock myself. Then I never used that code again. – RumburaK Oct 16 '21 at 23:38
  • 1
    yes it works, thanks – Hussien Fahmy Oct 17 '21 at 17:06
  • Yeah, consuming for debug purposes is fine and allows you to unlock the item for buying it again. But is it me being non-native or is this toggle is super misleading? If actually understood the contrary and let the checkbox unchecked assuming I couldn't buy again... Really confusing IMO. Thanks anyway for the heads-up @RumburaK :) – Stephen Vinouze Feb 18 '22 at 10:01
  • @Rumurak Thanks for this help. Copy, pasted, and worked like a charm – jax Jan 27 '23 at 05:43
4

I Contacted Play console support, the respond is it will be added in the future

So as a question answer is: NO you can't remove entitlement after refunding

The Play Console doesn’t currently support removing entitlement when a refund has already been issued. Luckily, we place a high value on developer feedback, and I’ll be sure to pass along your specific feedback to our product team. We’re continually adding new features and functionality, so please stay tuned.

Hussien Fahmy
  • 1,119
  • 6
  • 24
  • I can confirm that consumeAsync remove entitlement after refund. So Google (and yours?) statement is not correct. – Large Oct 23 '22 at 18:40
  • correct or not, it's their statement sent by mail to me and I don't know why I should provide this info to you, in the context of the answer it's not a handy way with the test purchase. Moreover, I don't see the purpose of your comment. – Hussien Fahmy Oct 26 '22 at 09:42
  • My comment was to make it clear that you *can* clear a non-consumable where you have messed up and forgot to trigger "Remove entitlement" before you refund. This saves you time and continue testing will work. It also ensure that users who got refunds w/o this ticketed don't keep a function they no longer payed for. – Large Oct 26 '22 at 21:50
3

In Flutter you can use

import 'package:in_app_purchase_android/billing_client_wrappers.dart';

BillingClient billingClient = BillingClient((wr){});
billingClient.consumeAsync('the_long_purchase_token');

Purchase token you can get in billingClient.queryPurchaseHistory or in your Google Play dev console - Order Management - Order Details - Copy Purchase Token.

Ilya K
  • 176
  • 5
  • Thank you very much Ilya K ! That was a nice trick to make a non-consumable that was refunded (without entitlement) be removed from playstore. – Large Oct 23 '22 at 18:39
  • You are an absolute star @Ilya K , this helped me a lot – GraSim Feb 04 '23 at 21:08
0

After a refund, you should be able to make another purchase. Just clear your app data, and purchase again.

yuwono95
  • 237
  • 3
  • 11
0

I experienced this same problem, when I went to refund a test product but forgot to check 'Remove Entitlement.'

What I did as a workaround was simply made a new product / product ID within Google Play, and then disabled the old one. This allowed me to make the test purchase again, but this time I made sure to check 'Remove Entitlement' before pressing the Refund button.

It's silly Google Play doesn't allow us to remove entitlement after issuing a refund. Especially since entitlement removal it's opt-in. Hopefully in the future...

Joe
  • 3,772
  • 3
  • 33
  • 64