billing - how to cancel an in-app test purchase on android? -


until june 20th 2016 able cancel test purchases done in app. doing multiple in-app purchases (not consumable) same test account made easy develop , test code without hazzle.

after 20th june 2016, purchases did not show in merchant account , unable more 1 purchase test account. got the: "you own item" message.

i logged request google developer support group , answer was:

beginning june 20, 2016, changed test purchases one-time in-app purchases (iaps). previously, test purchases one-time iaps generated order ids. starting june 20, 2016, one-time iaps not generate official order ids (if @ all) , not appear in merchant center. behavior applies subscription iaps. can learn more testing in-app billing in android developers center: https://developer.android.com/google/play/billing/billing_testing.html#testing-purchases

allright.. go mentioned link , theres section there: canceling completed test purchases states:

google play accumulates completed test purchases each user not pass them on financial processing. in cases, might want manually cancel test purchase continue testing. so, open app page in play store. if test purchase want cancel subscription, can use cancel() method of purchases.subscriptions api. important: refund() , revoke() methods of purchases.subscriptions api don't support test purchases.

so go app page in play store...and exactly? webpage not state supposed there. know?

it say: you can use cancel() method of purchases.subscriptions api.

which indicates using cancel() method not method.

how solve without adding additional code in app?

all managed in-app products consumable.

as stated in docs.

that means can consume owned item instead of cancelling purchase , buy on again. suggest querying inventory @ app launch time:

miabhelper.queryinventoryasync(this);

you can consume owned item in callback:

@override public void onqueryinventoryfinished(iabresult result, inventory inventory) {     purchase purchase = inventory.getpurchase(my_sku);     boolean isbought = (purchase != null && verifydeveloperpayload(purchase));     if (isbought) {         miabhelper.consumeasync(purchase, new onconsumefinishedlistener() {             @override             public void onconsumefinished(purchase purchase, iabresult result) {                 //clear purchase info persistent storage             }         });     } } 

this ok testing iab flow make sure remove code release version.


Comments