Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Google pay isReadyToPay method return false #12

Open
Nasimxon opened this issue Nov 8, 2018 · 3 comments
Open

Google pay isReadyToPay method return false #12

Nasimxon opened this issue Nov 8, 2018 · 3 comments

Comments

@Nasimxon
Copy link

Nasimxon commented Nov 8, 2018

I am using Google Pay isReadyToPay method always returns false. When does method returns false or true? Is Google Pay connected to the Locale?

mPaymentsClient = Wallet.getPaymentsClient(activity,
                new Wallet.WalletOptions
                        .Builder()
                        .setEnvironment(WalletConstants.ENVIRONMENT_TEST)
                        .build());

IsReadyToPayRequest request = IsReadyToPayRequest.newBuilder()
                .addAllowedPaymentMethod(WalletConstants.PAYMENT_METHOD_CARD)
                .addAllowedPaymentMethod(WalletConstants.PAYMENT_METHOD_TOKENIZED_CARD)
                .build();
Task<Boolean> task = mPaymentsClient.isReadyToPay(request);
task.addOnCompleteListener(
                new OnCompleteListener<Boolean>() {
                    public void onComplete(Task<Boolean> task) {
                        try {
                            boolean result =
                                    task.getResult(ApiException.class);
                            if (result == true) {
                                 //show Google as payment option
                            } else {
                                 //hide  Google as payment option
                            }
                        } catch (ApiException exception) {
                        }
                    }
 });
@lb0820ynn
Copy link

me too

@subhash4android
Copy link


Check whether the above code is added in manifest file or not.
Add in manifest file, hope it will work.

@wanderwuuu
Copy link

how to fix it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants