PENDING purchases are refunded once transitioning to PURCHASED

The only code path that acknowledges a purchase is in JuceBillingClient.onPurchasesUpdated(), which requires the purchase state to be PURCHASED. For asynchronous payment processors (UPI Autopay, PIX, etc.), the purchase state may be PENDING.

According to the docs, if purchases complete (go from PENDING to PURCHASED) while your app is closed (or not connected), PurchasesUpdatedListener.onPurchasesUpdated() will not be called. In this scenario, the acknowledgement must be made in the response to callingBillingClient.queryPurchasesAsync(), “which is recommended when your app is launched or comes to the foreground.”

I have evidence of purchases that were refunded at an identical-to-the-second 72h 10m 01s after the charge across different months, countries, and SKUs. The window for Google Play’s automatic revocation of unacknowledged purchases is 72 hours. Has anyone else seen this?

The simple solution is to acknowledge purchases in PurchasesResponseListener.onQueryPurchasesResponse()(the response to callingBillingClient.queryPurchasesAsync()) where PURCHASED == Purchase.getPurchaseState() andPurchase.isAcknowledged() returns false.

The code at fault is in modules/juce_product_unlocking/native/java/app/com/rmsl/juce/JuceBillingClient.java

Thank you for reporting. We are investigating this issue.