In-App Billing: Getting User is not eligible to purchase - android

I know about all the user account specification and where to register for the test account in developer console.
Question: To which user this message is referring?
The user that is currently logged in google play on device?
if yes. Why it is giving the same message even if there aren't any users logged in google play?
There is many google accounts on this device. maybe this message is referring to the default one. how to change it. (the default one: is when u clear google play data, then open google play it will force you to log in with).
When you are not logged in google play. why when you test in-app billing it does not ask for log in??
Thanks.

Your default Google Account will be used for purchasing... If you are unauthorized to buy items just make sure you add your device to the list of the test devices.
You default Google Account is the one you have registered at the first time on your device, I guess. Then you have to put that e-mail address on the list of "test devices" of your Google Play Developer Account and you will be able to purchase after some minutes.
If you want to use your own products you will need a real VISA to purchase. Alternatively, you can use static product IDs to purchase with a fake credit card.
Take a look at the Testing with static responses Google's official documentation to know when and what IDs you can use for testing purposes.

Related

Android "The publisher cannot purchase the item"

I'm not testing my in app purchase !
I have download my app from google play store and I still can't buy any of my In App purchase within the application.
I have the following error : "The publisher cannot purchase the item".
All my In App purchase are also valid and active.
I'm using the same google account than in my google play developer console.
I have read on google that it's normal that developer can't buy it's own items in testing mode (alpha or beta) but here i'm using the official version and I still can't do it !! (It's my first android application)
What did I do wrong ?
Thanks,
if you have the same account configured on the device (the one which you are using for developer console) make sure it is removed. Google Play will allow switching between all google accounts added on device. Also, before removing try switching directly in google play first to an account that is not your developer account and then do the purchase. If that doesn't work you'll probably need to remove the developer account for the device if you want to make a purchase fro your own app.

Android In-App billing subscriptions test not working

I'm trying to test In-App billing subscriptions. My personal account and my developer account are the same. I can't buy my own products with this account, so, I need to test with another account. Here are the steps I followed:
created a new account (lets call it account B)
added account B on Google Play on my phone
uploaded a signed apk for beta test
created a beta testers list and added account B
connected to account B on my phone in Firefox, went to the test link, opted-in, and installed the app (from Firefox, not from Play Store)
bought an item
been charged (and auto-refunded myself -_- ...)
So, seems like its not exactly working. After reading again the developer guide, I saw that when an account is set as a tester account, it is clearly stated in the in-app billing popup that you will not been charged:
However, Google Play marks test purchases with a notice across the center of the purchase dialog, for easy identification
There is nothing like this in my popups. Does anyone know where can be the mistake?
I saw on some questions on stackoverflow that it might not be possible to have a phone set up for testing if the testing account is not the primary account on Google Play app, is that true?
EDIT: I added a friend's account to the list and asked him to test. He has only one account on his phone. Like me, nothing indicates that he would not be charged (and so, I guess that, like me, he would).
EDIT: I see this in the guide:
Note: For test subscription purchases, leave the orderId field blank. You can use the purchaseToken field to identify test purchases.
What does they mean by "For test subscription purchases, leave the orderId field blank"? Do I need to do something here, or does they mean that in the response, the field is left blank?
However, Google Play marks test purchases with a notice across the
center of the purchase dialog, for easy identification
The purchase dialog should display a message as shown in the image below:
Note: For test subscription purchases, leave the orderId field blank.
You can use the purchaseToken field to identify test purchases.
It means orderId field for test purchases is blank in the response. This is because a real order wasn't placed and so no order id is created for the test purchase.
Update
For test purchase, create license test accounts for authorized users. In the Developer Console, go to Settings > Account details, then in the License Testing section, add the addresses to Gmail accounts with testing access field.

Which Google Play account does IabHelper use?

I'm implementing a shop of magazines. I need my magazines once be bought to be available at all user's devices. So, I need to synchronize information somehow. I think, it's logical to synchronize by user play market account.
I looked through google's example implementation of in-app billing Preparing Your In-app Billing Application, and I found this implementation easy enough to do my first app with in-app billing.
The quiestion is: which Google Play account does IabHelper use? For example, there're several Google accounts on device. How to specify which account should be chosen by IabHelper?
How to point to IabHelper which account to take if there're many of them at device?
Answer1:
you can use any of account you have. but remember one thing that use one account which is in your registered device (set google account when first time device started) because to test application, only test account user can buy the product until it will not published(in Google play market).
Answer2:
other users can see your product while your application will be published. You are uploading signed apk file with product id and base 64 key to verify that it is your application and your particular product id by the play store. so while any of other user will purchase that product , his Google account will be registered as the purchased product.
EDIT:
One more thing you should remember that test account and developer console account should not be equal.
Let me know you required more information.
Hope it will help you.

Can I turn my own Google Play account into a test account without any problems?

I'm developing our first app that uses in app purchases, and need to test that it's working correctly.
Currently if I try to make a purchase on the "android.test.purchased" item, I get an error message back saying "invalidClient". I'm led to believe that this is because my account is not a test user.
I found this page:
http://developer.android.com/google/play/billing/billing_admin.html#billing-testing-setup
which tells me how to set up a test user. I could set up a new user account, but I only have the one Android device to hand, which means doing a factory reset to make this the primary account, and I'd rather avoid that if possible.
Alternatively, can I make my own personal account double up as a test user?
The link above says that test users have limitations, one of which is:
Test accounts can only be used to purchase items that are listed (and
published) in an application's product list.
That seems to imply that I could only use my account to buy things in my in-development apps, and not from other apps as normal.
So can I turn my own personal account into a test user, without any problems when using the account to purchase other apps as normal?
It won't affect your abilities to use the test account as a normal account for other apps on Google Play.
So simply you can use your own account as a test account. (Actually if your account is the publisher account, you don't need to add it as a test account.)
The limitations mentioned in the documentation is a comparison to the publisher account.
Unfortunately there's no way around it. If you just have one device you have to wipe the device and then first sign in with the email address that you want to use as a test account. Only then will you be able to test in-app billing. You can also download other items from the Google Play store. I've done this without any problems.

Testing Android In-App purchase with real products

im trying to test In App purchases for my android app:
I already read the android developer sites about testing and I already have worked successfully with the play stores build in test/fake product-items like android.test.purchased, android.test.canceled ...
Now I would like to test In App purchases with my own real products. Therefore I have specified my own products in the Google Play Store Developer Console.
My question:
According to the android developers guide, it should be possible to buy this real item without transferring real money, by simply adding a gmail Account into the App settings (under the section LICENSE TESTING) in the Play Store Developer Console.
LICENSE TESTING
In addition to the owner of this console the following
users will get the License test response from the application. They
can also make in-app purchases from APKs that have been uploaded but
not been published yet.
So if login to google play store on my test device with a gmail account, that I have added to this LICENSE TESTING section, I should be able to buy items, without transferring real money? Did I get it right? Has anyone experience with testing in app purchases and can give me some useful advises?
From my recent experience.
With a different gmail account from the developer it is possible to buy in app purchases which are published for an app that has been uploaded but not published. You have to exchange real money but it is possible to refund the money. I think you would lose the 30% transaction fee to Google.
Don't know if this is relevant, but here's a good guide for testing purchases, including test purchase accounts in google:
http://developer.android.com/google/play/billing/billing_testing.html
With a test account the IAP will not be charged.
http://developer.android.com/google/play/billing/billing_testing.html
"Test purchases and developer account
Authorized license test accounts are associated with your developer account in Google Play, rather than with a specific APK or package name. Identifying an account as a test account enables it to purchase any of your in-app products without being charged. "

Categories

Resources