In-app billing - item unavailable for purchase - android

There are other queries on this, but none seem to provide the answer.
I am trying to implement in-app billing. Code in the real app is based on the dungeons code. I have to managed to get it all working fine on the test ids, but cannot get it to work with a real purchase id. I have:
Signed the app by exporting from eclipse.
Installed this version to the phone.
Uploaded same version to google play, saved it, activated it, but left it unpublished.
Created a managed in-app billing item.
Published that, although I notice that it does say 'item will only take on published state when app is published', no way round that as far as I can see.
Checked carefully that product ids match.
Added a gmail test account, made sure this is the primary account on the phone.
Waited several hours to make sure it gets propagated across all servers.
And all I get is 'item is unavailable for purchase'. It finds the item OK because in the background on the screen under the dialog is all the right info about it.
What is especially annoying is that the exact same billing code when built into a pure test app, does work, and I can purchase a real managed item. So I am sure the logic in the code is working. It just does not work in the real app with the real managed item.
I feel therefore that this must be some sort of fault with what I/Google have done at the developer console end, not in the app code.
Any ideas? I'm at my wits end with the whole in app billing system.

It was just time in the end.Took over two days to sort itself out.

Related

Disable one in-app purchase as of a certain date

I have an Android app that has several features available as in-app purchases. We have published the app on both Google Play and the Amazon App Store. We need to stop offering one of the features as of a certain date. However, customers who have already purchased the feature should be able to use it past that date, even if they install the app on a new device. They should also still be able to purchase other features.
I was thinking that we could simply update our app so that the UI offered no option for purchasing the feature in question. However, that would not prevent a user with an older version of the app from purchasing the feature. So it seems like in addition to removing the feature purchase logic from the app (but not the feature itself), we need to do something to turn off the purchase at the store end. But whatever that something is, it must still allow the app to check whether the user had previously purchased the feature.
I've been unable to figure out from the Google Play or Amazon App Store documentation how to set this up. My understanding, from what I've read, is that removing the item (from either store) will cause checks for previous purchases to fail. Is it possible to do what I've described? We need solutions for both stores.
P.S. I did find one related question on SO: Are Google Play in-app purchases still valid if the app or the product is removed? However, it has no answer and also is a little too narrowly framed. (I'm not assuming that the product has to be removed and I also need to know about the Amazon store.)
I was thinking that we could simply update our app so that the UI
offered no option for purchasing the feature in question. However,
that would not prevent a user with an older version of the app from
purchasing the feature. So it seems like in addition to removing the
feature purchase logic from the app (but not the feature itself), we
need to do something to turn off the purchase at the store end.
For Amazon Appstore, you would need to contact their support team to get the in-app item in question suppressed (it's not a self-service as of today). Once suppressed, that in-app item would no longer be purchasable. It would not affect existing users who purchased that item in the past.
When it comes to in-app purchase I always opt for implementing everything in my own server. when a user buys something, I instantly consume it and notify my server. Then instead of querying Google or Amazon, I query my own server which gives me a lot of flexibility. If I face something like your problem I just add few lines of code!
Since you already published your app this may not work for you unless you willing to force users to update the app to the newer version. (Hoping you can do that!)
You mentioned that you don't know what happens if you deactivate the product and there is no documentation, well you can try it on a test project and see what happens! It shouldn't be that hard. If that doesn't work as you expect there is nothing you can do, your logic is in your app and it's already published so...

in app billing, real transaction not working

I have an alpha working version of my app.
I have set the alpha open.
I successfully tested the in app billing with the test account (meaning the money is not charged to the test user).
I successfully tested the purchase with static response.
When i try to test the real payment it always say "the item is not available for purchase"
The version and the signature are ok.
Can you suggest what am i missing?
BILLING_RESPONSE_RESULT_ITEM_UNAVAILABLE 4 Requested product is not available for purchase
this is the returned code but i think has nothing to do with the real problem.
where can i find more information about the error?
I don't have the reputation to comment yet, but have you tried making a purchase from a version of the app that was downloaded off of the play store instead of a version that was run from adb or android studio?
Here's someone who had a similar problem
GooglePlay: The item you requested is not available for purchase
I encountered a problem like this as well once - i.e. downloaded the app from the Play Store, with a test-account (aka no money purchase) it worked, but a real purchase with a non-test account failed.
For me the reason was that the merchant account linked to the Play Store was not set-up correctly. You might want to check that if your situation is similar.

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..

Android IAP v3 - Can buy managed item several times

I am implementing an IAP scheme for android, and I have come acrossed something really strange. I have started from the TriviaDrive sample that Google offers, I have changed the key to mine, I have signed it with the developer key, uploaded it to Developer Console, created the IAP items (managed) and activated them. The app is in draft mode.
The situation is that I can buy one item with a test account, it looks to be consumed and I received an email from Google saying that I have made a purchase. So far so good. But unfortunately, if I try again to buy the item, the same process happens again, email from Google included.
Does anybody have a clue of why this could be happening? I've check dozens of time that the products are managed, that my key is correct and they are right...I'm quite lost now.
Thank you very much in advance!
I finally found the problem. I had a line in the code in which I was consuming the item, thus making it elegible to be purchased again. It turns out that a managed product can be consumable after all.

In - app billing issue

I have downloaded sample project of v3 In-app billing from developer and followed all the procedures like they have said. But its giving a message saying "The item you requested is not available for purchase."
As per advice given in other links I also published my sample app to play store, I downloaded the app from playstore, but still getting same error.
As said, you can't buy your own items, but you can use a test email address. One of the Play Store menu setting is to pick the email address to use.
Despite Google saying it takes 2-3 hours to propagate changes, it can take several days in the worst circumstances.

Categories

Resources