July 6, 2015

Step by Step: How to Delete Purchase History in Android

You tested your Android IAP (in-app-purchase) and found out something in your code is broken. After you fixed the code, trying to test IAP again, Android shows an alert telling you nothing but “Item Already Owned”.

Delete Purchase is Something You Must Face

item already owned

Look at this OK button!!! Damn, I am not OK with this at all!

This “Item already owned” alert is shown when try to re-purchasing a non-consumable item, or a consumable item that did not consume properly in last purchase.

Don’t panic! Let me show you how to delete purchase transaction! (Some may argue that one can switch to another test account to test the IAP, but you know, quite a number of accounts is needed if the code keep on having problems…)

Delete Purchase Transactions on both Server and Device

To delete a purchase transaction, you have to go though 2 processes on google server and your Android device:

1. Cancel purchase order in Google Merchants (Server side)

2. Clear transaction cache in your Android device (Client side)

Cancel The Purchase Order

Step 1.
Go to Google Wallet (use your developer account, NOT tester account).

delete purchase transaction in android, step by stepStep 2.
A list of purchase will appear, click on the transaction you would like to delete.

delete purchase transaction in android, step by stepStep 3.
A container will show up on the right. Click “Cancel Order” and submit whatever cancelling reason (since you cancel your purchase, only you will see this).

delete purchase transaction in android, step by stepStep 4.
As highlighted in above printscreen, now the status is “Delivered”, after 30 minutes (yeah, you have to wait for a while), it will change to “Will not Deliver”.

FURTHER READING :   iTunes Keeps Crashing or Freezing? Quick Fix in 6 Steps.

While waiting for the status turn to “Will not Deliver”, you can start the next important step: clearing the transaction cache on the Android device, which will make use of Android Debug Bridge.

Clear Transaction Cache

Step 1.
Connect your device to your computer with a USB cable.

delete purchase transaction in android, step by stepStep 2.
Find adb.exe* in your computer (if not have one, you have to install the Android SDK).

delete purchase transaction in android, step by stepStep 3.
Open the cmd.exe* in Windows, type in “cd <THE DIRECTORY PATH OF ADB.EXE HERE>”, and press Enter.

delete purchase transaction in android, step by stepStep 4.
Type in “adb shell pm clear com.android.vending”, and press Enter.

*Note: If you are using Mac OS, the steps should be similar, you have to look for adb in “Finder”, and use “Terminal” to call the commands.
Feel Free to Add Your Comment At the Bottom
Handle All the Hazards and Save the World!
Can you survive the 30 waves of shots? Download this latest goalkeeping Arcade and put on your goal keeper gloves
Read more.
Mr Quiz – Welcome to the World of Country Flags!
This is the ultimate test to your know on flags of all nations!
Read more.

Comments

Comments:

Show Buttons
Share On Facebook
Share On Twitter
Share On Google Plus
Share On Linkedin
Share On Pinterest
Share On Reddit
Share On Stumbleupon
Hide Buttons