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.
Related
I have just developed and deployed an app to the Google Play Store.
As you can see, it is an alpha release. I have read that alpha releases can have their in-app purchases tested, without the tester having to incur a charge.
I have set up closed testing and assigned myself as a tester. I then download the app through the Play Store on my devise. I then attempt to test the in-app purchases, but I get the following:
As you can see, I cannot make the purchase as I don't have sufficient funds.
Question
How do you test in-app purchases so you are not charged?
Thank you
Adding a user to the alpha does change his purchases to be a mock purchase.
In order to test purchases you need to add your email to the list of accounts with testing access:
Go to Google play console
Settings -> Account Details -> License Testing
Add the your email to the list. Make sure that the you login to the play store with the same email.
Make sure to pick RESONSE_NORMALLY in the 'License Test Response'. Later on you can test other types of responses from the store.
Once you have that setup, you can make purchases from that account. When you purchase you will get a message from the play store saying that this is a test purchase and that your account will not be charged.
This is how it looks like -
For more information see https://developer.android.com/google/play/billing/billing_testing.html
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
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.
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. "