Paypal button not appearing with Braintree and WooCommerce

When trying to use Braintree with Paypal on my WooCommerce installation, I kept running into issues. Using Braintree by itself would work fine, but as soon as I enabled Paypal as well I received this following error on the checkout page.

Oops, something went wrong. Please try a different payment method.

The Paypal button would also not appear.

In some instances, in the Developer Console you might see this error:

The problem is that the JS library linked from the WooCommerce plugin is very old and doesn’t support many of the new Braintree features. (And this is the official plugin from WooCommerce…)

To fix the issue, you’ll need to make some changes to the plugin. Be aware: these will be overwritten on a plugin upgrade, and you may need to re-fix the issue.

Edit the file  wp-content/plugins/woocommerce-gateway-paypal-powered-by-braintree/includes/class-wc-gateway-braintree.php :

Comment out line 108, and add in line 109 as below. You might want to check for the latest Braintree library.

Test it, and everything should be working!

My Braintree plugin setup looks like this. I didn’t need to add a Merchant Account ID to get this to work:

4 thoughts on “Paypal button not appearing with Braintree and WooCommerce

  1. This solution doesn’t work on my website. Do I need to setup merchant account in Braintree dashboard or not?
    Thanks in advance.

    1. Under Account > Merchant Account Info, you need the Merchant ID, but you don’t need the Merchant Account ID.

      Yes it’s very confusing!

Leave a Reply

Your email address will not be published. Required fields are marked *