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
Related
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.
I have an Android app that uses In-App-Billing to sell Account Managed Items.
I tested the app with the static response IDs and everything seems to work. I now want to test the app with real product Ids.
I created the app in the Google Play Store and uploaded a draft version of the app with the correct permissions. I now created an In-App-Billing item and published the item.
At the moment the app is unpublished. The item is created and published and I have a test account that is registered in the profile of the developer account and is the only account on the device that I use for testing. The app is signed with the same key as the uploaded draft. Edit:I'm testing with Android 4.1 && 4.03 at the moment
If I try to buy the item the Google Play Store pops up but shows a dialog with the following method: The item you requested is not available for purchase.
How can I test buying the item without publishing the app?
When you test the app, make sure you have exported and correctly signed it (not using debug key). Also make sure that you are using the correct Google account (registered test account) on the device.
Additionally, the registered test account cannot be the developer account.
Apart from this, it should work fine.
Note: Testing your own in-app purchases does require a valid credit card and actual payment.
And finally, it currently takes a few hours for market edits to propagate through the servers and show up.
It may take some time to reflect the changes on google play if you just uploaded the app and added the item there wait for some time near about 2 hr. it will be shown the item you want to purchase.
For others who reach this thread, Now it's not possible to test In-app billing with just a draft version of the app.
Draft Apps are No Longer Supported
Previously, you could publish a "draft" version of your app for testing. This functionality is no longer supported. Instead, there are two ways you can test how a pre-release app functions on the Google Play store:
You can publish an app to the alpha or beta distribution channels. This makes the app available on the Google Play store, but only to the testers you put on a "whitelist".
In a few cases, you can test Google Play functionality with an unpublished app. For example, you can test an unpublished app's in-app billing support by using static responses, special reserved product IDs that always return a specific result (like "purchased" or "refunded").
for details read https://developer.android.com/google/play/billing/billing_testing.html#billing-testing-test
You can test in-app billing by using options, look at this
Edit :
On the link I mentionned, you can see this :
Note: You do not need to publish your application to do end-to-end
testing. You only need to upload your application as a draft
application to perform end-to-end testing.
If you still can not test it, what you can do is to publish it and test it. If you think there might be bugs in your app's in-app billing, refunds are still a solution.
I'm thinking about something, on the dev site, you can see this :
Verify that your device is running a supported version of the Google
Play application or the MyApps application.
On what Android version are you testing on ?
You've to add the products(item sku) in you app product in your play store app account. The SKU you set In-App billine is not available. For testing, set the SKU androidtestpayment. Now you'll now get that error The item you requested is not available for purchase.
Im new to this situation. Ive coded for Android In App purchase, and uploaded it as a draft in google play(Not published) for testing purpose. Now Ive to create some In App products there in developer console, that can be bought through my app.
My doubt is about the pricing when the app is put for testing. The price cant be set to zero. It shows a minimum of $0.99 should be there.
To test my app, how can I configure it such a way that i can purchase it freely.
Helps would be appreciated, :)
This should help you get started Testing In-app Billing.
However there is a warning:
Note: Making in-app billing requests with the reserved product IDs
overrides the usual Google Play production system. When you send an
in-app billing request for a reserved product ID, the quality of
service will not be comparable to the production environment.
And one more thing i could find out on the above topic is, its possible to add testing email accounts in the Google Play. Developer can add any number of gmail ids as testing accounts there.
I am reading this tutorial http://developer.android.com/guide/google/play/billing/billing_testing.html and it is really confusing me :)
In one part of the tutorial, it discusses that I should make a test app and release it into google play. And in another part of the tutorial, it discusses setting up static return values so I can mimic what google play returns to my app.
What is the right approach here if I want to test out the flow of someone buying access to a certain page?
I already have the code to buy the stuff. I just need to test that the transactions would work and the return value would be ok.
Thanks!
If you want to test with real server you need to upload your apk file as draft version no need to publish it.
as they says
Note: Making in-app billing requests with the reserved product IDs overrides the usual
Google Play production system. When you send an in-app billing request for a reserved product
ID, the quality of service will not be comparable to the production environment.
so...If you want to test with your product ID you need to upload the signed version of your app on market (offcourse as draft) and also you need to pay! :)
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