How to test autorenewal subscriptions on Android - android

I would like to add a autorenewal subscriptions to my Android app. All code is implemented and passed basic tests, but there is one important use case - I need to ensure, that renewal process (monthly payment) works fine. My server side is responsible for checking of purchase status using Google APIs and I don`t want to wait 1 months in order to check how it works in different cases.
Apple provides a sandbox, where I can configure subscription (its possible to have subscription for 1 minutes and so on).
Does Google provides something similar (sandbox, test API, etc.) that might help to verify described case?
Thanks,
Alex

Current answer - there is no way to do it. Sad, but truth.

Google Play has already implemented a sandbox to test subscriptions and issue purchases. You need to publish your app in beta and after a few hours of doing that the test users(added in Google Play dev console) can make test purchases(these are not charged) in your app. They can even make subscription test purchases. A test subscription automatically renews every day(until canceled from Google Play) irrespective of the subscription duration.
http://developer.android.com/google/play/billing/billing_testing.html
Also see this: Testing Android IAP/In-App Purchase Subscriptions

Related

How to test in-app-purchases easily, without publishing or signing it first?

Background
My app has some in-app billing (like this one), and I wish to test it out before publishing it.
I've watched some google IO lectures and read some articles, and prepared everything.
According to what i've learnt (talked about here), all I need to do is just add my email to the test accounts, and it won't be charged.
The problem
It seems that in the developer console, the in app items cannot be activated.
I think it's because the app isn't published yet, but that's the whole point of testing - I want to test the app before publishing it...
As I've also found out, in order to test in-app billing, I have to do a lot of things to take care of for making it work, also having many restrictions and annoyances:
sign the app and upload it to the play store . if you don't use a signed app, you get this message ("This version of the application is not configured for Market Billing...") .
make credit cards be used to the devices, even if they won't cost anything.
let others do the testing instead of myself, as my account cannot be used for that. not only that, but instead of adding exactly which you wish to add, you have to create a google group and there put the people who will be able to use the app, and all will have to have a google+ account... You will also need to wait some time till the testers will be able to use in-app-billing of your app and till then they will get an error "User is not eligible for this purchase" .
because of #1, I need to have some kind of mechanism to reset the purchases, within the app itself, but i also shouldn't forget to remove/hide this features for the end users, so that they won't reset it by mistake
because of #1, if I wish to be able to debug the app, I need to change it on the manifest, and choose to debug the app within Eclipse, and also remember to uncheck this flag before actually releasing the app.
since the app is on the play store, you cannot modify in-app purchases items (their Id for example), as opposed to many thing you can modify before publishing the app. It's no longer a development as flexible as it can be using simple development. It's like your app should be sealed with what you choose even though you haven't published it yet.
The question
Why is it this way?
How come there isn't a simple way to allow to test the in-app-billing ?
How would you deal with the problems I've written about?
Is it possible to test the in-app purchases before the app is published?
How come I can't use my own google account ?
Also, suppose I do make a (fake) purchase, how do I reset it (all/specific purchases) in order to check it out again? Is it true I can't do it anywhere besides the app itself?
Am I missing anything?
you dont have to publish the app inorder to test it all you have to do is upload the apk to your developer console, just dont publish it. If your account is linked to your developer console you cannot use that account and have to create a test account to test the IAP's
You will have to public the app but publish in beta mode so that you can test the in app purchases. Beta mode will enable to test the functionality with limited user set.
Yes, you can test your app without publish (and without publish in beta mode too). There are instruction http://developer.android.com/google/play/billing/billing_testing.html#billing-testing-test. Please remember that after 1 point it's maybe need to wait about hour or two.
It seems that in the developer console, the in app items cannot be activated.
it's ok, just check that you mark it as active. It look like not active before you publish the app, but you can test it.
I can use my own google account, right?
I strongly recommended have additional account only for test purchases.
Also, suppose I do make a (fake) purchase, how do I reset it (all/specific purchases) in order to check it out again?
You'll must to fill billing information for your test account. But when you make test purchase, there are no any real money transaction. Every in-app can be tested once again after the app consume it.
I'm also working on how to test In-App-Billing for Android in best way since days.
With real transactions to me it seems to be really too complicated and a lot too much effort. So i'm currently thinking of 'only' testing this stuff with static responses (http://developer.android.com/google/play/billing/billing_testing.html#billing-testing-static).
In theory i guess once this works, it should also be fine in production as in the source code only the SKU id gets changed for live release..

Test Subscription Feature of In-app Billing

Is it possible to test subscription feature of In-app Billing? I tried using reserved product IDs for testing(android.test.purchased), But it gave error like 'item not found'.I am using In-app Billing Version 3.I could not find a conclusive answer from the web. Any help is appreciated.
As of February/March 2015, in-app subscriptions can also be tested on Android. Now, Google accounts with testing access (configured in the Settings Menu of the Developer Console) will receive the message
This is a test subscription. It will recur daily. You will not be charged when trying to buy in-app subscriptions.
This also means that all subscriptions seem to be "billed" daily. You will still receive a normal Google Play Order Receipt Email but it will be prefixed by the word Test:
Test: Your Google Play Order Receipt from Mar 12, 2015
Also, if you look inside this email, you will notice that the order number is a random string of letters, instead of a regular order number as described at http://developer.android.com/google/play/billing/billing_subscriptions.html#payment.
Order number: lhjelkffelbnmmcmklbkhkbd
Some points that may help.
If your published application does not have in-app, you dont need to publish your next inapp version to test it.
You need to upload the apk with in app feature to your developer console (dont hit publish), install the same app on your phone
Create in app products (unmanaged) and ensure that the code refers to these unmanaged product id's
Make the product cheap for testing purpose
Purchase your product from your application
From your merchant account refund yourself (you wont be charged if you refund before 24 hours, and you get a full refund. (i think, just confirm this, it keeps changing).
After you are happy, hit publish.
You can add email id's of friends as test accounts, to help them purchase the product and not get charged. Infact you can also mock them for "failure" :)
I hope this helps.
This is the answer from my personal experience.
There's not a proper way to test inapp with a dev sandbox.
This is how I really test inapp.
Create a test application to test inapp and configure it.
Remember to put your developer public key where needed and all manifest permission needed
Add some inapp purchase to test with
Make the app NOT debuggable
Upload it on android market as draft
Now you have to wait some hours because Android Market need to push all changes or you will get an error when you try to make purchases
Now launch the app locally on your device (you have to put debuggable false) and test your inapp purchase buying something.
After all tests I go into my google wallet merchant account and I also make all other purchase flow test for:
Refund
Cancel Inapp-Subscription
If you find a better way to test it with a real sandbox please tell me :)
Use android.test.purchased as a product ID.
Create a class to mock out the apis you are using from Google Play services.

Testing subscription in Android: item not found

I am trying to test the new subscriptions in Google Play but the service returns "Item not found".
I've used the identifier "android.test.purchased" to test.
With this identifier I can test perfectly the normal in-app product, but whith subscription it doesn't work.
In the Google Play Console I added a subscription, and it is published.
Do I have to use the real subscription identifier and pay for testing?
Thank you
Even I have been looking for this , and am guessing that you may have already solved your problem.But this might help others
Even I have been unable to find any documentation about test product-ids for subscription however Testing In-App billing suggests only use of 4 reserved static product ids. This makes me infer that there is no test-id for subscription.
Hope this helps
yes,you will have to use real subscription and pay (you can cancel later).
there's no test for subscription.
notice that you will have to send in your request
api version=2 and product type should be "subs".
Google Play has already implemented a sandbox to test subscriptions and issue purchases. You need to publish your app in beta and after a few hours of doing that the test users(added in Google Play dev console) can make test purchases(these are not charged) in your app. They can even make subscription test purchases. A test subscription automatically renews every day(until canceled from Google Play) irrespective of the subscription duration.
Although, please note that the test user(Google account) must have a valid credit card added to the Google Wallet account in order to make test purchases(which are not charged). While making the purchase, the purchase confirmation dialog clearly mentions that this is a test purchase and you will not be charged.

Android: How to test in-app billing

I have an app in the market without in-app billing. Now the new version should have in-app billing. Of course I am not ready yet and cannot upload the new version to the market, but how can I test and debug my unfinished code?
as a first step you need to test it using test requests. This testing is limited but will give you idea if the flow works correct or not.
Second step - real testing. You have to upload your app to Play (NOT publish, just upload), create another account (you can't buy things from yourself) and enable this account in your dev. console. Then you can purchase (for real money) the app and test how well it goes. Of course you can cancel/refund this anytime using your main account.
As a person implementing this in a couple of my apps I can tell you it's a pain.
Refer here for more info:
In-App Billing reference
You can use the test product id's set up by Google to test your app. Check out this link
Firstly,You can use four reserved product IDs to test static in-app billing responses
Secondly,Using a test account and upload you app as a draft,then you can test it using your own product IDs

Android: Strategy to test In-App-Billing?

Can anyone tell me some best practices to test in app billing with real product using test account?
I have created a test gmail account and add it into my Developer Console. I actually can finish the in-app purchase. But i cancel the transactions in Google Checkout so that my credit card will not be charged. Now i want to test the purchase wit the same product again, than it doesn't work anymore because of the error "you already cancel order in app billing android". I search in Google and found out that i (the developer) can't change the pending status. So if i want to test the in-app-billing function again, i assume that i have to create a new productId.
Does anyone have better strategy to test the in-app-billing functionality?
You can use a "fake" account to test the purchasing in the real product. Please see this link for everything you should need: http://developer.android.com/guide/market/billing/billing_testing.html

Categories

Resources