I want to test in-app payments and I have Google Play App Signing (GPAS) enabled.
To test payments, I need an apk signed with real key (signing key in terms of GPAS).
But I do not have private key for signing certificate. It was generated by Google and stored in Google Play.
How can I avoid necessity to upload apk to Google Play each time I want to test in-app payments?
How can I download signing private key somewhere?
Open the Google Play app. Choose Account -> Subscriptions & Payments -> Subscriptions. Click your test subscription and change the payment method to “Test card, always declines.” After five minutes, payment should be declined.
When you are testing in app purchases on Android, you must use a signed version of the app. Your Google Play email must be listed in the Google Play Console as a tester. The easiest way to do this is to publish your app to a Beta release with open testing.
In the new Play Developer Console you can accept the Terms of Service by selecting your app then scroll down to the bottom of the navigation options in the left panel. Select Internal App Sharing. If you haven't already accepted the terms then you will be shown a link where you can agree to the ToS!
I have an app in alpha channel and "Google Play App Signing" enabled and I have been able to test in-app billing without major problems using a few tester accounts.
In Google Dev Console >> Release Management >> App Release >> Manage Alpha >> Manage Testers you can create a list of tester accounts, after that passing to them a web link they can install and test the app.
The publisher (developer) account can't buy items but I created another account for tests that I use in emulators (Genymotion + Gapps) without problems.
The only mishap found is that some testers when they buy the product the system ask them for a real payment !, they should not be charged as Google documents say, I have solved it by creating in the console a few promotion codes for them.
Maybe your problem is that you already have the app in production and not in alpha or beta?
Hope it will help.
UPDATE:
You said in a commnent to another answer : "But I don't want to wait a few hours each time I make any change in my Application. That is the point."
You don't need to upload another release each time you make a change, you can continue debugging your app via USB or on an emulator with Play Store installed, as long as the debugging device uses a google tester account and she/he has accepted to be a tester on the received web link.
Of course this tester can be yourself using a google account other than the one of the app publisher
UPDATE 2
If the doubt is due to believe that in-app billing purchases are signed with the same key that the application then it is not true. Purchases are signed with a key different than the application, you can get the Base64-encoded RSA public key in the developer console in Development Tools >> Services & APIs
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With