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. "
Related
I am trying to testIn App Purshase without being charged on Unity by reading this https://developer.android.com/google/play/billing/billing_testing.html
My application is published as an Alpha version, signed with a real key. I downloaded it with an other Google account that the one I used to publish the app. This account is both added in the testers list of Google Play Service and my app Alpha testers list.
The problem is, when I want to buy an item, I never see the word "test" as the documentation says.
Can someone explain to me which extra steps shall I do in order to be sure to test my In App Billing without being charged?
Thanks a lot.
A new version of Google Play Console was released the 17th April, and I think that the french version of the Google Play Console was not completely implemented.
Right now the section "Test de licence" is available.
Follow the Testing In-app Purchases:
Setting up test purchases
It’s easy to set up test purchases—any user account can be chosen to
be a test account, and any user of a test account can make test
purchases with any available payment method (even though there’s no
charge to the payment method).
First, upload and publish in-app products that you want testers to be
able to purchase. You can upload and publish in-app products in the
Developer Console. Note that you can upload and publish your in-app
items before you publish the APK itself.
Next, 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. For more information, see Setting Up for Test
Purchases.
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.
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
In my game I have InApp Purchases. I want to test my game before publishing, so I uploaded it to alpha. I would love to test it on my phone, but google refuse, saying a developer can't buy his own products. Google also refuse to allow emulators to purshase items.
Yesterday I added a google account to my phone, and added it to the list of people allowed to download my app (Gmail accounts with testing access).
My problem is that I can't access my game (We're sorry, the requested URL was not found on this server). My game is available (I checked it from another phone and its good). I simply can't access it from my test account.
What can I do? Should I do something, or I will not be able to test my game on my phone no matter what?
Here is the android developer help for testing in-app purchases. The second account you added should be able to access the game shortly. In my experience, it usually takes up to about 24 hours to access alpha/beta testing once a user has been added.
Here's some specific stuff from that post:
Test Purchases (In-app Billing Sandbox)
Test purchases offer a secure, convenient way to enable larger-scale testing of your In-app Billing implementation during development or in preparation for launch. They let authorized user accounts make purchases of your in-app products through Google Play without incurring any actual charges to the user accounts.
Once authorized for testing access, those users can make purchases without being charged. Test purchases are real orders and Google Play processes them in the same way as other orders. When purchases are complete, Google Play prevents the orders from going to financial processing, ensuring that there are no actual charges to user accounts, and automatically canceling the completed orders after 14 days.
We recommend that you first test your In-app Billing implementation using static responses from Google Play. This enables you to verify that your application is handling the primary Google Play responses correctly and that your application is able to verify signatures correctly. You can do this even if the app hasn't been published yet.
To test your implementation with static responses, you make an In-app Billing request using a special item that has a reserved product ID. Each reserved product ID returns a specific static response from Google Play. No money is transferred when you make In-app Billing requests with the reserved product IDs. Also, you cannot specify the form of payment when you make a billing request with a reserved product ID.
What are the conditions to properly test real purchases, when i already have tested my app using test product like android.test.purchased?
There are few steps that you need to pass, remembering, that some of them need some time to update on Google Play servers.
For this example, let's use com.example.product as our real product Id. Any time it shows up in this example change it to your own.
UPLOAD APK FILE
You CAN'T test REAL PURCHASES in DEBUG mode. You need to download an app from Beta, so Google know it's ok to make purchases in the app.
Check if you have BILLING permission in AndroidManifest.xml:
<uses-permission android:name="com.android.vending.BILLING" />
Change android.test.purchased to com.example.product,
Export *.apk file. It MUST BE SIGNED!
Publish APK in Beta,
You can now go to the next steps, but you'd need some time for your Beta to be ready for download.
ADD NEW PRODUCT
You CAN'T add new product until you have published a beta.
You CAN'T test subscriptions, only products. Now you CAN also test subscriptions (they are renewed every 24h)
Go to products section in Google Play Developer Console,
Click Add new product button and define new product with com.example.product Id,
Wait FEW HOURS until it's published.
TESTERS
You CAN'T test purchases being signed-in on your device with a developer account. You CAN'T make purchases from yourself.
Create testing group on Google Groups, or Google Plus,
Add gmail accounts of your testers to that group,
Set your group as testers in Google Play Developer Console > APP > BETA
Copy testers emails in Google Play Developer Console > SETTINGS > LICENSE TESTING - this will make testing purchases enabled for their accounts.
TESTING
As a tester, you WON'T be charged
When testing from downloaded app Beta, you'll see a testing information on first IAP dialog.
You'll see both your product's name and price set in dev console.
You'll be testing with your real payment options. Don't be scared of seeing your credit card. As i mentioned before - you won't be charged.
When you successfully make a test purchase, you'll get a confirmation e-mail, which looks like a real purchase confirmation.
CLEANING TEST PURCHASES
To repeat the same purchases, you'll need to consume products, cancel purchases, or simply wait 2 weeks until testing purchases will expire.
To cancel purchases:
As a Developer, go to Google Wallet, choose purchases, and cancel them (remember to manage calceled purchases in your app),
As a Tester, go to app manager on your device, and clear Google Play cache. Despite of canceling on developer side, your device stores the purchase information locally.
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.