Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Handling In-App Billing Refunds in v3

I am trying to implement in-app billing into my application, I have the buying part working right but how do I take care of issuing a refund?

Under the Testing In-App Billing section it says that you have to watch for IN_APP_NOTIFY but when you click about that it takes you to v2 of the api where you have to register a broadcast receiver. In v3 however it gives no information on what to do or if even IN_APP_NOTIFY is still used the same or supported.

The sample app does not handle refunds either so how am I suppose to handle refunds in v3?

like image 467
tyczj Avatar asked Jan 27 '13 17:01

tyczj


People also ask

Will Apple refund an app purchase?

Sign in to reportaproblem.apple.com. Tap or click "I'd like to," then choose "Request a refund." Choose the reason why you want a refund, then choose Next. Choose the app, subscription, or other item, then choose Submit.


1 Answers

You are supposed to handle them the same way as in v2: when a user requests a refund, cancel or refund the order via the Checkout console. Then the app should check the status of the purchase when starting up, etc. and do the right thing (typically allow access for refunded purchases, and deny for cancelled ones). Unfortunately the provided sample doesn't bother doing this, so you will have to add it yourself. Even more unfortunate is the fact that due to local caching and/or bugs on the server side, purchases will stay in the purchased state long after you cancel or refund them. There is not much you can do about it though ATM.

Assuming you are using the Trivial Drive sample, you might want to add something like this to your app:

Purchase purchase = inventory.getPurchase(product);
Log.d(TAG, "Purchase state: " + purchase.getPurchaseState());
// 0 (purchased), 1 (canceled), or 2 (refunded).
if (purchase.getPurchaseState() == 0
     || purchase.getPurchaseState() == 2) {
   showPremiumVersion();
} else {
   showFreeVersion();
}
like image 190
Nikolay Elenkov Avatar answered Oct 20 '22 18:10

Nikolay Elenkov