I have implemented In-App purchase in my app. I am able to create different In-App products along with test accounts. But the problem occurs when I purchase In-App product, it shows a message "The item you were trying to purchase could not be found". But the item is existing with exact product id. Can anyone help me?
Is the purchase item marked as published? If it isn't you may get that exception.
Take a look at Google's documentation. Step 2 talks about marking items as published. You also have to ensure the application is signed with your release certificate.
try doing it without test account, it will work best luck :)
Related
Good day.I have implemented the in-app purchase flow in my application,added everything necessary to the console but i am failing to test it.Issue is that the android i dont know why uses the non-testing account (developer account) as on the purchase dialog it says 'The publisher can not purcahse this item' but although i have added test account to the device,switched account in the google play but i keep getting this error.Can anyone please tell me what is wrong with it?
If you want to test in-app purchase, you need to account on https://play.google.com, publish your app in alpha version. In IN-APP PRODUCTS, you add products you want, add emails you want to test (only emails in the list can test). You follow this link:
https://developer.android.com/google/play/billing/billing_testing.html
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 followed all of the steps for running the Android billing sample app in http://developer.android.com/google/play/billing/billing_integrate.html#billing-download
I succeeded to buy an item, but there are several issues:
when I select an item to buy, I first get an "Item not found" error, and when I click "ok" I see the product in google play. does this happen to anyone else?
I purchased several new items, I see on my google checkout account that the order is "shipped" BUT in the billing test app, under "Items you own" I don't see anything...
in http://developer.android.com/google/play/billing/billing_integrate.html#billing-download they suggest to
refund purchases that are made with test accounts, otherwise the
purchases will show up as actual payouts to your merchant account
where can I perform the refund? in my google checkout account the "Refund some money" item is greyed out...
Does anyone know how to handle these issues?
They are several reasons
check your products are published or not.
your APK in draf mode or not.
Products must be Activate.
First create TestMails in developer console under Licence key.and your device must have using this mail id as primary mail id of device.
I am trying to test subscriptions in android app. I use dungeons example. I uploaded apk which is not published, but subscription items are published. I added new test account(gmail) in dev console which is not developer account. I reseted phone to factory and added test account. I installed signed apk(same version as uploaded).
When I try purchase I get "The item you have requested is not available for purchase" but I see in background item which I requested.
Some thoughts what can be problem here? Thanks
Same thing happened to me when I tested in-app billing, and there was no other way to overcome it but to actually publish the application. Once the application had "replicated" to Google servers (which took several hours, during which I got yet another obscure error message when trying to purchase anything), buying subscriptions worked fine.
use this link and refer table 1. I also faced this problem.http://developer.android.com/guide/google/play/billing/billing_testing.html#billing-testing-static
Have a look at that table than u will get that whats going wrong in your table.
I had the same problem. After changing the APK state from unpublished to Activate (in APK files tab) and waiting for 1 hour or so, the product ID could be purchased.
Make sure to upload the signed APK to developer console.
Make sure to install the signed APK on your device not launch the app in the debugger.
Make sure to create a test account in your developer console.
Make sure to sign in your device with your test account.
Make sure to create in app billing in your developer console and finally activate the item from the console!!! (this is the one that got me after fully following google's tutorial)
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