Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
361 views
in Technique[技术] by (71.8m points)

payment - Android Pay - Testing from outside US

So I need to integrate Android Pay into an application I'm working on. This option within the app will be for US users only however I am in the UK and am having great difficulty trying to test my implementation. I'm using a sandbox Stripe account atm as the payment processor.

Once I press the "Pay with Android Pay" button I get a popup "To make purchases using Android Pay, please set up your cards in the Android Pay app". Now the Android Pay app isn't available outside the US so I've sideloaded it, however once I try to add a card it crashes. After a quick Google it seems like this crash is the apps way of saying it's not supported outside the US.. (Great UX btw)

I've also tried adding one of the cards found here, https://developers.google.com/android-pay/test-flows, to my Google Account however they don't show up in the Android Pay app.

I'm at a bit of loss trying to test this, it seems very much like Google has overlooked the fact developers outside the US would like to implement this in their apps for their US customers.

Does anyone have any ideas about how I can test this?

(Btw I'm testing on a stock, unrooted Nexus 5 running Marshmallow. I've also tried to spoof my location to no avail.)

EDIT: Spoke to Android Pay support who informed me there is no mechanism to test outside of the US. They said it checks your IP address to determine location which is why GPS spoofing doesn't work but it also seems proxies don't work either so unless anyone has hacked a way around this it looks like when they say US only they mean US only - Including development :|

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Follow these steps to convert Android pay into testable environment

  1. Install Android Pay apk from apkmirror website. Make sure you use correct apk variant. http://www.apkmirror.com/apk/google-inc/android-pay/

or

  1. You can use TunnelBear(Change VPN) App to download Android Pay App in India https://play.google.com/store/apps/details?id=com.tunnelbear.android

  2. Turn on Sandbox Mode by executing following commands from command prompt:

    adb shell
    cd /sdcard/Download;
    rm --f android_pay_env_override_*;
    touch android_pay_env_override_sandbox;
    
  3. Restart the phone

    • Launch the Android Pay app and add following test credit card details:

    • Card Number: 4622 9431 2999 9943 Expiry: 12/17 CVV: 125

    • Enter other details like address and proceed.

    • Card is added successfully.

enter image description here

  1. Use ENVIRONMENT_SANDBOX to integrate and test Android Pay in your app.

  2. Revert from Sandbox to Production by executing following commands from command prompt:

    adb shell
    cd /sdcard/Download;
    rm --f android_pay_env_override_*;
    
  3. Restart phone

  4. Use ENVIRONMENT_PRODUCTION or ENVIRONMENT_TEST to integrate and test Android Pay in your app

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...