Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cancelling orders on Google Play IAB test purchases after June 20, 2016

I have been using Google Play in-app purchases (IAPs) for a long time, but recently (June 20, 2016). They updated the Payments Merchant Center so that test purchases are not shown anymore. I quote a recent email to developers:

"Previously, test purchases for one-time IAPs generated order IDs. Starting June 20, 2016, one-time IAPs will not generate order IDs and will not appear in the Merchant Center."

I have found no information regarding purchases (not subscriptions) in the link: https://developer.android.com/google/play/billing/billing_testing.html The page has a "Canceling completed test purchases" that only comments on subscriptions.

My question is, where do I cancel a test purchase if they do not appear in the Payments Merchant Center?

UPDATE- Official answer from Google Support:

Thanks for contacting Google Play Developer Support. I checked into it, and the Play Developer Console doesn’t currently support the cancelation of test IAP. The only ways are to either consume the IAP or wait the 14 days consumption time.

UPDATE 2- Thanks to the answer below from Mike, I inserted the code below:

Purchase premiumPurchase = inventory.getPurchase(Constants.SKU_PRO);
if (premiumPurchase != null) {
    App.mHelper.consumeAsync(premiumPurchase, new IabHelper.OnConsumeFinishedListener() {
        @Override
        public void onConsumeFinished(Purchase purchase, IabResult result) {
            Log.d(TAG, "Test purchase is consumed.");
        }
    });
}

I only run this code to cancel the test purchase and debug the complete purchase flow again.

like image 716
Antonio Avatar asked Jun 30 '16 17:06

Antonio


3 Answers

What I get from the Android developer site is that they prevent the purchase flow from at all getting to the point where you have to pay for it if it is a test purchase. It makes it easier because Google makes sure you do not pay for test purchases. It stops them within 14 days. The accounts that are to do that needs testing licences that you can activate from the Developer console.

So you do not have to cancel them because technically you never purchased anything while at the same time you get to test what happens when something is bought. But the merchant center never recieves the request.

EDIT:

If you are to try to directly cancel and see what happens, do a real purchase and cancel it.

like image 42
Zoe stands with Ukraine Avatar answered Nov 15 '22 22:11

Zoe stands with Ukraine


The easiest way to cancel an in-app purchase is to consume it. If you use the Google provided IabHelper you can just call consumeAsync and pass in the Purchase. I maintain a function to consume all the app's in-app products; this is essentially a billing reset function for testing.

like image 139
Mike Avatar answered Nov 15 '22 22:11

Mike


I am late to the question, but this is the most recent way to refund/cancel in-app purchases from Google. On you Google Play Console in the left hand menu there is a menu item called Order management. This brings up an order summary with a blue REFUND button at the bottom. Click this, select a reason for the refund and submit.

Explanation on official docs

like image 1
Lew Perren Avatar answered Nov 15 '22 22:11

Lew Perren