I have my in-app subscription working using a second test account. Now when I check inventory using queryInventoryAsync the subscription shows up as expected.
So now I want to do some more testing. I want to cancel the subscription and then when I know that works, I want to test again.
However, when I go to Google Play -> My Apps on the same phone as I used to buy the subscription, it shows no subscriptions! So I can't cancel it. What is wrong?
Also, how can I test expiration of subscription and make Google think time has passed.
Thanks,
Gary
Turns out that Google does not support testing of subscriptions. You have to use real charges.
To cancel the subscription have to go to the Google Wallet web. It's the only way, you can't do it in-app.
To testing process. You can use a subscription with trial time, in this way you haven't to pay until this trial time finish and you can test at least the purchase flow.
Also you "only" have to wait a week to see the subscription expired, and without make a refund if you had cancelled before.
Related
I'm testing in-app billing with my own cellphone
I've sucessfully added some acounts to alha track and they can now buy the goods in the test mode.
The thing is due a bug existent in the first alpha version the purchased good wasn't being consumed and now everytime i try to purchage i get
ITEM_ALREADY_OWNED
int ITEM_ALREADY_OWNED
Failure to purchase since item is already owned
reading googles guide about testing in-app billing it says:
Cancel completed test purchases Google Play accumulates completed test
purchases for each user, but does not pass them to financial
processing.
In some cases, you may want to manually cancel a trial purchase to
continue testing. To do so, open the app page in the Play Store. If
the test purchase you want to cancel is a subscription, you can also
use the cancel () method of the Purchases.subscriptions API.
I do not find an option to cancel the test purchases at googles play page of my app, nor in the console neither in the tester account...
how can i cancel it to keep testing?
The problem here is that you need to consume the item, instead of cancelling. The item was purchased, and while not consumed you won't be able to buy it again. Please check this answer on how to consume the item. Hope it helps.
So.. we have a client who is going out of business. Their app has a yearly recurring in-app purchase and we have around 50 people who still have it active.
On iOS I was able to just cancel the in app purchase and that immediately cancelled all of the subscriptions.
Google isn't playing nice. Once an IAP is approved it appears you can't delete it? So... how do I cancel those 50 people so they don't get renewed a year from now?
Is there a non-coding solution to this? If not... what is the coding solution?
In the Google Play Console, you can see and cancel all subscriptions. Just open "Order Management", find the subscription and click cancel.
I am implementing a subscribing service with the google play service "In App Billing v3" in an android app. I was able to implement the subscribing service in the app and I tested it in alpha channel. Now I want to test the whole lifecycle of the subscription.
This is the idea. An user subscribe to the service with "In App Billing v3". Then the app request an api that I own, and that server request Google Api.
This is working when the user susbcribe. The problem is when the user cancel the subscription, I am not able to test this case.
Any idea how I would be able to test this?
Thank you
I'm not sure I completely understand you question, but if you want to know how to test when a subscription's active period ends and the user opts to not renew it, then you could either create mock purchases (make your app think that a subscription is active and then cancelled) or you could use Google's test subscriptions (http://developer.android.com/google/play/billing/billing_testing.html#test-purchases). They last for 24 hours, so you could "buy" a test subscription, cancel it and wait 24 hours for the end of its active. It's not very productive, but if you're not willing to create a mock of google's api, then that's what you'd have to do.
Just remember that when a user cancels a subscription it will still be active until the end of its period (they did pay for the whole period after all). Only if a subscription is revoked does it end immediately.
Scenario:
I am on the verge of completing my google playstore in-app billing implementation. I am using a monthly or yearly subscription in order to charge my consumers.
Problem: I can't seem to find a way to remove a subscription from active state, since cancellation simply stops the billing from occurring. This doesn't allow QA to thoroughly test the purchase procedure without creating an account for each test, or waiting until the subscription period ends.
Question: Have I missed or am wrong about something? If so, what is it? If not, what should be done to allow QA to do proper testing?
According to what I have understood from your question,
you can not test subscription from the test account. Google play doesn't provide subscription testing using dummy product. you have to test on the real product.
Now question arises how can I test subscription
you can check subscription by purchasing real product and check product status or purchase cancellation using the purchase status api from your server.
you can also get more information from the given link below for the step by step cancellation purchase status:
1) link1
2) link2
you can simply query every day and check your subscription is valid or not and also get it's expiration date.
I also have one other option with out pay for any charges on your real product, you can set trial period in the Google console and before trial period ends up cancel subscription from the Google play store Menu -> MyApp -> Subsciption and cancel product and check above procedure given in the links.
EDIT:
Important: In all cases, you must continue to offer the content that
your subscribers have purchased through their subscriptions, for as
long any users are able to access it. That is, you must not remove any
subscriber’s content while any user still has an active subscription
to it, even if that subscription will terminate at the end of the
current billing cycle. Removing content that a subscriber is entitled
to access will result in penalties. Please see the policies document
for more information.
more information check below links:
1)
http://developer.android.com/google/play/billing/billing_subscriptions.html#cancellation
2) https://support.google.com/googleplay/answer/2476088?hl=en
3)
https://support.google.com/googleplay/android-developer/answer/140504?hl=en
You can not done this with out waiting until the subscription process cycle completes after cancellation of subs product, the only way remaining which is Free trial version it's only the way to provide us to test for the product cancellation in which product cancel immediately after you cancel subscription trial period, it will not continue until even trial periods ends.
more information check below link:
http://developer.android.com/google/play/billing/billing_subscriptions.html#administering
And I think it is better way because in the trial period you should go
with the actual credit card payment process but you doesn't need to
pay anything for it. Google play record the transaction as $0.00 for
the subscription process. And if you cancel the subscription the you
should not pay anything for testing, but yes I am not sure free trial version
is worked before you publish the app but it is only get by efforts only.
Conclusion:
In the current api it is not possible to test subcription product like
normal products and if user has been cancel the subscription product
then you have to wait to purchase the same product until the
subscription cycle has been expired, there is no another way if the
subscription cycle is going on and you can test for the same product
again before subscription cycle ends. And if you still want to test
for the same product then you have to choose another account for
testing it or another way is Free trials, you will not be any charged
until your Free trials period expired or cancel subscription in that
period and for the testing account before publish the app you will be refunded
automatically after 14 days of purchased product according to my
knowledge.
Hope it will solve your problem.
I have a horribly clunky workaround for this problem. Here is what I do every time I want to do a test of in-app subscriptions:
Create a new in-app subscription product in the google play developer console.
Point the android app at the new subscription product you just created.
In your code to check for active subscriptions, add a line to specifically ignore the order number of the previous subscription that you tested.
Export a release build of the app and transfer it directly to your testing device.
After testing, return to step #1 to test the next time.
Don't forget to fix your change from step #2 before deploying the app!
You might want to create many subscriptions in step #1 so you don't have to continually wait hours for them to propagate. Please comment if you know of a better way!
UPDATE: Google now has test subscriptions and is making it easier to use them! https://android-developers.googleblog.com/2018/01/faster-renewals-for-test-subscriptions.html
It seems that nowadays there is better solution:
Open your app page in Google Play Store application
Click "Manage subscriptions"
Click "Cancel subscription"
Go to "Settings", "Apps" in your phone.
Find Google Play Store and clear application data.
You should now be able to re-buy subscription.
Create a mock class that mocks out the Google Play methods that you are using.
I created product id list for my application in android developer account. Also i created test account to test my in-app purchase implementation. My concern is do i get charged on entering card details from test account for buying the product, to test in-app billing implementation. What is the best way to test in-app billing?
The best way to test an in- App is to
mBillingService.requestPurchase("android.test.purchased", "");
This way you neither have to upload your app nor you have to create in app products on marketplace.
Agree with the one mentioned by ingsaurabh, however in case you want to do a real testing of in-app billing I would recommend going through the entire grind.
Things to test:
a. Purchase
b. Cancel
c. Refund
d. Restore transactions
For all these you would need a real purchase, which would get charged to your account. However later on you can go ahead and cancel it from your developer console and it would get refunded.
The only way to do end to end testing is to do a real purchase. You have to set up a test account on the developer site first. You don;t have to worry about the charges. You can always refund it.