Skip to content

Instantly share code, notes, and snippets.

@hitherejoe
Created May 26, 2016 09:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hitherejoe/bfc728da963e3c59dda777f355861f8c to your computer and use it in GitHub Desktop.
Save hitherejoe/bfc728da963e3c59dda777f355861f8c to your computer and use it in GitHub Desktop.
Wallet.Payments.isReadyToPay(mGoogleApiClient).setResultCallback(
new ResultCallback<BooleanResult>() {
@Override
public void onResult(@NonNull BooleanResult payEnabled) {
if (payEnabled.getStatus().isSuccess()) {
if (payEnabled.getValue()) {
// Woo! Android pay is enabled, lets show that Android Pay
// button and hide the standard checkout button!
} else {
// Unfortunately the user doesn't have Android Pay enabled,
// so hide the button and display the standard checkout button
}
} else {
// Looks like there was an error making the isReadyPay method call...
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment