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?
Asked
Active
Viewed 1,118 times
2

wingear
- 819
- 9
- 21
-
Is it suitable for credit cards? – Anton Shkurenko Dec 07 '18 at 09:50
-
1Yes, it's suitable. See answer below: https://stackoverflow.com/questions/43950443/how-to-open-save-to-android-pay-url-from-android-app/44391396#44391396 – wingear Dec 10 '18 at 07:57
2 Answers
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