user1007522
user1007522

Reputation: 8118

Paypal disable credit card button

I'm using the Paypal SDK in Android and I want to disable credit card payments. So the credit card button must be disabled.

I found solutions here on stackoverflow like:

intent.putExtra(PaymentActivity.EXTRA_SKIP_CREDIT_CARD, true);

the only problem is that PaymentActivity doesn't have that flag so it doesn't compile. I found this link: http://paypal.github.io/PayPal-Android-SDK/com/paypal/android/sdk/payments/PayPalConfiguration.html

and I thought I could solve it like this:

intent.putExtra(PayPalService.EXTRA_PAYPAL_CONFIGURATION,new PayPalConfiguration().acceptCreditCards(false));

this compiles but it doesn't disable that button.

Upvotes: 0

Views: 657

Answers (2)

Mukesh Kumar
Mukesh Kumar

Reputation: 133

**It's Work for me **

public static PayPalConfiguration config = new PayPalConfiguration()
            .environment(PayPalConfiguration.ENVIRONMENT_SANDBOX)
            .clientId(PAYPAL_CLIENT_ID).acceptCreditCards(false);

Upvotes: 0

user1007522
user1007522

Reputation: 8118

Found the problem you need to do this like:

PayPalConfiguration() object = new PayPalConfiguration();
object = object.acceptCreditCards(false);

Upvotes: 2

Related Questions