Braintree Paypal – Please try a different payment method

If you got any of these errors
Oops, something went wrong. Please try a different payment method.
Error: This PayPal integration does not support this currency
Hups, něco se pokazilo. Zkuste prosím jiný způsob platby.

or any other localized version of this message, the issue is not with b>Merchand ID, as official documentation might hint.
It’s the issue with plugin itself.

Open this file wp-content/plugins/woocommerce-gateway-paypal-powered-by-braintree/includes/class-wc-gateway-braintree.php
On line 108, you need to comment out the wp_enqueue_script() and replace it with a different ( up-to-date url )

public function enqueue_gateway_assets() {

	if ( $this->is_available() ) {

		// braintree.js library
		wp_enqueue_script( 'braintree-js', 'https://js.braintreegateway.com/v2/braintree.js', array(), WC_Braintree::VERSION, true );

		parent::enqueue_gateway_assets();
	}
}

becomes

public function enqueue_gateway_assets() {

	if ( $this->is_available() ) {

		// braintree.js library
		// wp_enqueue_script( 'braintree-js', 'https://js.braintreegateway.com/v2/braintree.js', array(), WC_Braintree::VERSION, true );
		wp_enqueue_script( 'braintree-js', 'https://js.braintreegateway.com/js/braintree-2.32.1.min.js', array(), WC_Braintree::VERSION, true );
		parent::enqueue_gateway_assets();
	}
}

That’s it, works without adding additional Merchant ID. Simply but, the JS used in official plugin is outdated.

Write a Comment

Comment