Search code examples
androidpaypal-android-sdk

Disable credit card payment option in paypal integration


I want to disable/hide a button with option for "credit card payment" in paypal integration to android application. Is there any way to do this?


Solution

  • In latest SDK below is the solution : (taken from another answer to keep this answer upto date)

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

    For older SDK :

    Set below extra to an Intent that starts PaymentActivity. This will hide "Pay with credit card" button.

    // Set extra to skip credit card payment.
    intent.putExtra(PaymentActivity.EXTRA_SKIP_CREDIT_CARD, true);