Test Google In App Purchase paying real money - android

So, I have implemented IAP(in app purchase) in my application and successfully tested it with real product ids. My app is published to Alpha and everything worked fine (payments were not real of course).
I have then closed my Alpha testing. Now, instead of making either real or testing methods, I only see an error message: The item you requested is not available for purchase..
When the app will start to make real payments instead of testing? What do I need to do for that? Do I need to publish it to the production for that to happen?

You can do real purchase even if your app is in Alpha testing.
The real purchases will be reflected in Google merchant page with an Order Id.
App does not have any knowledge of purchase type, if it a real or test. Play Store is the master which knows all the deatils of a purchase.
For a test purchase you will be adding you test mail with test access in LICENSE TESTING.
To make a real purchase with the account, remove that account from the list showing Gmail accounts with testing access in developer console. Thus you can make real purchases.
Over All,
If your account is in Settings->Account Details->LICENSE TESTING group, the purchases will be test purchases else it is a Real Purchase.

Related

Testing Android In App Billing, app do not work in Test mode

I have published my app in Alpha and try to test In-app purchases.
But I don's see a testing information on the first IAP dialog. It work as a real published apps!
What is wrong? What could be the problem?
You should install the app as a test license account. If your email address is not added in license test accounts list, your purchase will be a real purchase that result in actual charges.
Testing with real transactions
With alpha/beta test groups, real users (chosen by you) can install
your app from Google Play and test your in-app products. They can make
real purchases that result in actual charges to their accounts, using
any of their normal payment methods in Google Play to make purchases.
Note that if you include test license accounts in your alpha and beta
distribution groups, those users will only be able to make test
purchases.
Check out Setting Up Test Accounts

Android in app subscription testing

I want to test the in app subscription mechanism on android devices(In app billing V3. api).
How can I do this? I saw that testing with static responses is works only with the in app products. The beta/alpha testing supports the in app subscriptions?
Thank you.
You can test your app with in app purchase feature. you have to follow below steps for testing
Upload you final signed apk file to Google play.
Dont publish it
Add in app products
get in app products id and add to code
get base 64 key and add to product
sign apk and upload again
your app should be in draft mode
in you Google play account setting add your test account id
use the device which should have the primary account id similar to the one you have added on Google play test account.
Install signed apk you have uploaded to Google play to your device.
run application and test your features
Since there's no effective way to test subscription cancellation/renewal, I'm trusting Google's documentation that an expired subscription won't appear in purchased items (otherwise, whether cancelled but still valid, original or renewed, I don't care in my case).
To test the rest of my work flow I created a test consumable object so that I can re-buy/cancel it at will in the sandbox. This consumable simulates an active subscription. It's not full end-to-end testing, but given that Google's given us no better way to test subscriptions, it will at least give me a fair amount of confidence that my app behaves as expected, otherwise.
A few notes:
1) You can only test with a signed build. I added android:debuggable="true" to my AndroidManifest.xml (under
<application android:debuggable="true"...)
2) This way I can still connect and debug with breakpoints after installing via adb (you can attach to the process under the Devices view, normally visible in the DDMS perspective, look for the little green bug icon.)
So far, it's behaving as expected. I'm still in the process of testing but if I hit any snags I'll update.
In adittion to #Vaibhav-Agarwal if you only want test your app, you could have problems with the IDs (I have experienced with an app for a client).
In my case, to avoid this situation, I had to add a testing project with another special package (test.xxxx.xxxx.xxxx) and here add some in-app product with a trial of 7 days, then when I canceled a purchase I "only" had to wait 7 days to purchase again this subscription.
In this way also,you never had to make a refund, because the subscription with trial time, you haven't to pay until this trial time finish.
NOTE:
Draft Apps are No Longer Supported, you must use Alpha/Beta tester option
In spanish, you will read: "no se ha podido encontrar el elemento que intentabas comprar"
Google has been enhanced theirs In-app Billing testing options. I write this answer for those who coming through . Now, you can test In-app Billing in Sandbox as other platforms do. In order to do that you have to 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.
Notes :
Test subscription purchases recur daily, regardless of the product's subscription period.
Once you’ve added the users as license tester accounts and saved the change, within 15 minutes those users can begin making test purchases of your in-app products.
After you publish your app to an alpha or beta channel, your testers need to opt-in to your app’s alpha or beta test using the provided opt-in URL before they can make test purchases.
License test accounts must be on the user’s Android device. If the device has more than one account, the purchase will be made with the account that downloaded the app. If none of the accounts has downloaded the app, the purchase is made with the first account. Users can confirm the account that is making a purchase by expanding the purchase dialog.
For more visit the official documentation.
But you can test Google Play functionality with an unpublished app using static responses.

How to separate test account purchase from real purchase in android in app billing?

I have implemented In App Purchase in my android app for purchasing items using the help and sample app provided on Google developer site.
I have set the test account to check the transactions on goggle wallet account.
Can any one tells me how to identify test account purchase vs real purchase, beacuse i want to show only real purchase request and data in our customized analytic.
There is a way to identify the sandbox purchase vs real purchase in IOS, so is there any way or receipt data change so that i can separate out the test purchase and real one.
Test purchases have "Test:" prefixed in their description within the developer console.
Use this to filter your data.

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.

Do test accounts require real credit card to purchase via In-app Billing?

Inching slowly (but methodically) towards my first implementation of In-app Billing, I reached the point in which I can actually run the market billing sample application: The app is signed and uploaded to the AM, the "product list" has been created per the instructions and a test account has been set in both Google and the phone.
But when I proceed (successfully) with a purchase, despite selecting the test account on the AM, I am prompted to confirm the purchase with my real gmail account, to which my real credit card is linked.
When testing PayPal, for example, one can create test accounts, too, with fake CC numbers, to test freely w/o burdening the real CC system.
Is this available (or possible) for In-app Billing development & testing, too?
Update: I tested this on a different device, having only the test account set, and sure enough the Android Market behaves erroneously, responding the following error message:
The item you were attempting to purchase could not be found.
I know that the item is there and that it is set up properly in the Android Market because this error is never issued on the device with the real account with the CC number (there I receive a perfect behavior with the masked CC number, the Total and an Accept & buy button). Why does Google write such misleading error messages?
Update: I found this incredible thread, which seems to partially answer my question. Unless something new has been introduced by Google since then.
You have to use a real credit card. However, you can always refund your test purchases!
Note that you'll have to make the purchases from a test account that's separate from your developer account, since Google Checkout doesn't allow an account to buy from itself.
Test accounts are useful when you upload your application as a draft application,not published.Then using test account you can do even purchase of unpublished application.Hope this helps.

Categories

Resources