By default, Android Pay refuses to work in debug builds, which makes testing tricky. What we've done so far is to actually merge new code into a develop or hotfix branch so our build environment will make a signed APK which can be tested. This is not ideal.
https://developers.google.com/android-pay/get-started states "Note: Our test environment will not return live, chargeable tokens in the FullWallet response, but will allow us to test your pre-purchase flow. You will see an Unrecognized App error on the Android Pay chooser until your app has production access." which isn't too promising.
https://developer.android.com/google/play/billing/billing_testing.html suggests testing with specially configured static responses for "reserved product IDs", which would be a nuisance to set up and not a true test. The other option they offer is to publish the app to an alpha or beta channel, which would, of course, be a signed APK. https://stripe.com/docs/mobile/android has a suggestion about "TEST_GATEWAY_TOKEN" but isn't really helpful in learning how to use Android Pay in test.
We even talked to a Google Developer Advocate, who did nothing but cut and paste some of the same documentation.
Is there any way to do a good test using an unsigned build? It would be wonderful to test Android Pay functionality successfully on a local developer machine.
No, there is not a debug mode option to that per docs:
https://developer.android.com/google/play/billing/billing_testing.html
set a separate machine with a CI server and have it do the alpha and beta builds for testing Google Play.
It is a pity but you have only one way to test IAP:
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