Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to detect canceled or refunded order for Google in-app billing?

I have red a lot of posts and Google documents, but am still not clear how to tell an in-app purchase has been refunded. I have red carefully In-App Billing v3 - Don't detect refund and Does Google Play In-App Billing Version 3 support refunds?.

I believe that I took the following notes from an official Google document a while ago by copy & paste:

purchaseState: The purchase state of the order. Possible values are 0 (purchased), 1 (canceled), or 2 (refunded).

Now, the official document has the following:

-> purchaseState: The purchase state of the order. It always returns 0-

(purchased).

More specifically, if an IAB purchase is refunded or canceled, is that still in the user's inventory obtained by mHelper.queryInventoryAsync(mGotInventoryListener)? If so, how can one tell the purchase has been canceled or refunded?

Update [2019-12-12]:

I have tested many times and confirmed the following:

If an order is canceled after refunding, it will disappear from the results returned by getPurchasesList. The time it takes for this to happen varies. It could be minutes to over 10 hours. I think this depends on when Google Play refreshes its cache. It seems that one can open Google Play to refresh its cache. In one case, getPurchasesList still returned a refunded purchase more than 10 hours after refunding, but it stopped returning it as soon as Google Play is opened.

like image 837
Hong Avatar asked Oct 03 '17 10:10

Hong


People also ask

Will Google refund in app purchases?

Request a refund for recent purchases If it's been less than 48 hours since you bought an app or made an in-app purchase: You can request a refund through Google Play. If you bought music, movies, books, or other content: You may be able to request a refund more than 48 hours after your purchase (check policy below).

How do I check my refund on Google Play?

On any Android device linked to the account you made the purchase from, go to the Play Store page of the item you purchased and hit the Refund button. In the pop-up that appears, click Request refund to confirm.

What happens if I request a refund from Google cloud billing?

Note: If your refund request is processed, your refund will be credited back to the credit card or bank account associated with the Cloud Billing account. When Google needs to modify your account balance, you receive adjustments .

What happens if I cancel my Google Play purchase?

After an order is canceled, it can’t be reinstated. User returns a paid app: After purchasing a paid app, a user has up to 2 hours to return it for a full refund. They can only return an app once. If they purchase the same app again, they won’t be able to return it a second time. User requests a refund: Users can request a refund on Google Play.

How do I get a refund for Google Play purchases?

If a purchase was accidentally made by a friend or family member using your account, request a refund on the Google Play website. If you find a Google Play purchase on your card or other payment method that you didn't make and that wasn't made by anyone you know, report unauthorized charges within 120 days of the transaction.

What happens if I cancel an app order?

After an order is canceled, it can’t be reinstated. User returns a paid app: After purchasing a paid app, a user has up to 2 hours to return it for a full refund. They can only return an app once. If they purchase the same app again, they won’t be able to return it a second time.


Video Answer


1 Answers

Have you checked out the voided purchase list API? It returns a list of cancelled, refunded or charged-back purchases.

https://developers.google.com/android-publisher/api-ref/purchases/voidedpurchases/list

like image 63
Ryhan Avatar answered Oct 01 '22 17:10

Ryhan