Sdkbox IAP : detecting refunded item

I am using sdkbox IAP 2.4.3.3 with an android app. I can successfully purchase items through the play store, etc. My problem comes in when I purchase a non-consumable item (remove Ads), and then the user requests a refund from the play store. Is there any way to detect this state with sdkbox::IAP? Restore still shows it as owned. I can see very clearly on the google developer console purchase history that it was refunded. Any attempts are rebuying with IAP gets error code 7 as well (already owned)…

I considered directly using the google billing library in the AppActiviy.java to query the purchase State, but the billing library in the apk is from IAP and is old (1.0). I haven’t found the right set of code to get it working alongside IAP…

Any help is appreciated. Thanks!

@htlxyz can help with this topic.

Google’s IAB library billingclient seems to have a problem. The GP will not update the purchase status. Maybe you should wait a few hours and try again.

Thanks for the response. This isn’t a one-time problem, but my question in general is how to detect a refund with sdkbox IAP at all? Not being able to re-buy is just a side effect of IAP being out of the loop with knowing about a refund…

can’t detect a refund with billingclient.

maybe you should use google IAB server api to check purchase status.

So if I’m not mistaken, what you posted is a listener which has to be running at the time the refund occurs in order to be able to catch it. Refunds are usually initiated outside of the app (on google play interface for instance), so it probably would never be received.

It also is referring to a Google IAB library 3.0 function. The one we are forced to link with for SDKBOX IAP is version 1.0, and I would hesitate to attempt to link with 2 versions of the same library.

I know a lot of people use SDKBox IAP and sell non-consumable items in their apps, how do they know if the user has refunded these items, so they can disable them in their apps? I’m baffled that this seems to be such an out-of-the-box question…

Thanks.

  1. The latest SDKBox IAP uses Google billingclient 2.0.1 (billingclient 2.0.3 is the latest version, in fact you can change the billingclient 2.0.1 in build.gradle to 2.0.3, it is compatible)

  2. If you want to get a refund status, the best way is to use the Google API Client.

Ref URL:

billingclient versions:
https://developer.android.com/google/play/billing/billing_library_releases_notes

enable Google API Client steps:

get refund product list by Google API Client steps:
https://developers.google.com/android-publisher/api-ref/purchases/voidedpurchases/list