In-App Billing v3 - Don't detect refund
Asked Answered
G

4

37

I've followed the training about "In-App Billing v3" of Google. I get to do a buy of a item but I've a problem.

https://developer.android.com/training/in-app-billing/index.html

I've canceled and refunded the buy but the app detect the buy as true. I can't continue testing my app because always I detect as purchased the item.

The only error that I've found in logCat is the next:

[3687] InAppBillingService.logResponseBundle: Bundle does not contain a response code

Appears after launching mHelper.queryInventoryAsync(mGotInventoryListener).

Any idea?

Garald answered 13/12, 2012 at 14:10 Comment(4)
Good question. Have you found out answer so far?Aeschines
Nothing found and I don't know where to look more.Garald
I'm in the same boat with this - refunded (a test user) purchase and the system continues to believe the user is licensed. v3 API has almost nothing on refunds at all - the sample app doesn't address them - another Google API released half-baked for us to guinea pig test - we should start billing them for this...Flyover
I have the same problem even after 15 hours, after clearing the cache of the Google Play app on Nexus7, and even after installing TrivialDrive fresh on my Nexus One more than 15 hours after processing the order cancellation and receiving the confirmation email from Checkout. Google does NOT seem to be communicating this changed status from its servers to the Google Play app; it apparently has nothing to do with Google Play caching the value. See also #14304350Platitude
F
23

p.s. - this suggests it just takes time for the refund to be updated

http://code.google.com/p/marketbilling/issues/detail?id=88#makechanges

But I'm not convinced - I realise they're caching purchase data on the device but 24h is a long time...

Updated to add that more than 24 hours after I cancelled 'test' transactions, those accounts are still licensed!!

Updated again - after 36 hours the app was STILL licensed. I uninstalled and reinstalled and it was STILL licensed!!

Updated AGAIN! - I factory-reset the device, logged-in, installed the app and it was unlicensed...

AND another update - a reply from Google suggests that refunds are processed 'automatically' but can take 'upto 72 hours' to be refreshed on the device - there is no other route to detect a refund, so players get upto 3 days of stuff 'for free' if they refund - erm, OK this is In-App and not App purchase but still, that seems a BIT excessive?

Flyover answered 16/12, 2012 at 20:32 Comment(5)
I had this happen to me too, but I didn't rush to do a factory reset. After a few days, it got unlicensed. Not sure if it was 3 days or more though...Balakirev
I reckon it does unlicense stuff 'eventually' - but you're certainly looking at days. I'm not sure what Google's refund policy on in-apps is - if they're going to hand-out easy refunds and customers get wise to this (a 1-3 day free run) then I think we have an issue here...Flyover
This is good to know! I don't care very much about the three days as long as it does eventually happen. As for Google's refund policy, John, my understanding is that for in-app purchases there is no refund possible through Google - the customer's only recourse is to send email to the developer asking for a refund, which the dev grants at her or his own discretion.Platitude
@shrewdlogarithm Is refunding and cancelling the order via Google's Merchant Center the same thing? Because it has been a week since I refunded the order to my test account, and yet the purchasing state (Premium car) is still owned. However, I am presented with the option to cancel my order now... Could not cancelling the order (but refunded) be the reason why?Glyconeogenesis
Just to add to this.. I refunded a product on (5/12/18, 8:27 AM) it is now (5/15/18, 17:56 PM) and the product is still licensed.. I know it will happen eventually, but still....Harber
T
5

After having waited for about 12 hours and having tried everything suggested here and on similar threads, I was still facing the same issue. What did the trick for me was the following adb command:

adb shell pm clear com.android.vending

Tarter answered 27/10, 2015 at 2:40 Comment(2)
The command did not work for me. The item is still seen as purchased.Examine
Doesn't work for me. Even after clearing app cache.Resonant
S
2

You can easily negate the purchase for test purposes by consuming the item.

Using Trivial Drive sample I added the following code in MainActivity.java which will "consume" the premium upgrade when the app starts:

        // Do we have the premium upgrade?
        Purchase premiumPurchase = inventory.getPurchase(SKU_PREMIUM);
        mIsPremium = (premiumPurchase != null && verifyDeveloperPayload(premiumPurchase));
        Log.d(TAG, "User is " + (mIsPremium ? "PREMIUM" : "NOT PREMIUM"));

        // dss added for test: Consume the premium upgrade for test purposes.
        boolean testConsume = true;
        if (mIsPremium && testConsume) {
            Log.d(TAG, "NOT FOR PRODUCTION: We have a premium upgrade. Consuming it.");
            mHelper.consumeAsync(inventory.getPurchase(SKU_PREMIUM), mConsumeFinishedListener);
            mIsPremium = false;
        } //dss end add

As a bonus you get a free quarter tank of gas when you consume the upgrade just because the sample treats all consumption as gasoline elsewhere. Search MainActivity for "Provisioning" to find where.

Selfdeceit answered 12/4, 2016 at 20:51 Comment(0)
P
0

The way I am working around it is with a block of code that ignores the specific purchases I have made. I have a log statement in the code that prints out the purchase info, then I hardcode a list in my app of purchaseTimes to ignore. It is a mess and I have to re-compile every time I want to test, but I haven't found a better way yet.

Pamphlet answered 6/4, 2013 at 19:22 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.