2

Now I'm in the following situation: our server sends ready-for-use JWT hash for current user card, but there are seems to no way to open "save to android pay" url from android app button: there are only web applications integration tutorial: https://developers.google.com/save-to-android-pay/reference/s2w-reference So, I have to some way render this html: <g:savetoandroidpay jwt="JWT" onsuccess="successHandler" onfailure="failureHandler" /> into button and handle javascript callbacks from Java. Or, maybe, there are some another way?

wingear
  • 819
  • 9
  • 21

2 Answers2

0

I found the "email link" way to do this, it can be used for Android app too:

addToAndroidPay.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://www.android.com/payapp/savetoandroidpay/" + token));
                    startActivity(intent);
                }
            });
wingear
  • 819
  • 9
  • 21
0
Uri androidPayUri = Uri.parse("https://www.android.com/payapp/savetoandroidpay/" + jwt);
Intent intent = new Intent(Intent.ACTION_VIEW, androidPayUri);

...

Here you can find an example JWT to test:

https://developers.google.com/save-to-android-pay/reference/s2w-reference

sergiosua
  • 364
  • 2
  • 4