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-bil
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.