简体   繁体   English

Paypal 禁用信用卡按钮

[英]Paypal disable credit card button

I'm using the Paypal SDK in Android and I want to disable credit card payments.我在 Android 中使用 Paypal SDK,我想禁用信用卡付款。 So the credit card button must be disabled.所以必须禁用信用卡按钮。

I found solutions here on stackoverflow like:我在 stackoverflow 上找到了解决方案,例如:

intent.putExtra(PaymentActivity.EXTRA_SKIP_CREDIT_CARD, true);

the only problem is that PaymentActivity doesn't have that flag so it doesn't compile.唯一的问题是 PaymentActivity 没有那个标志,所以它不能编译。 I found this link: http://paypal.github.io/PayPal-Android-SDK/com/paypal/android/sdk/payments/PayPalConfiguration.html我找到了这个链接: 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)); intent.putExtra(PayPalService.EXTRA_PAYPAL_CONFIGURATION,new PayPalConfiguration().acceptCreditCards(false));

this compiles but it doesn't disable that button.这会编译,但不会禁用该按钮。

Found the problem you need to do this like:发现你需要这样做的问题:

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

**It's Work for me ** **这对我有用**

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM