PayPal payment option within Braintree is failing to connect to PayPal

cckassis
Contributor
Contributor
Hi there,
I have connected PayPal to my merchant account/payment gateway Braintree in Magento 2. When proceeding with PayPal payment option, it is failing to connect to PayPal giving me this message:
"Sorry we cannot connect to PayPal. Please try again in a few minutes"

When i reached out to Braintree, i was given the below explanation:

Magento is using a custom integration of PayPal - the following code is lifted directly from your checkout page:
config.paypal = {
container: 'paypal-container',
singleUse: !isActiveVaultEnabler,
headless: true,
amount: this.grandTotalAmount,
currency: totals['base_currency_code'],
locale: this.getLocale(),
enableShippingAddress: true

This is designed to be combined with paypal.initAuthFlow() method, via an on-click action/event listener, to prevent pop-up blockers from interfering with the launch of the window.

However, Magento is attempting to launch the paypal.initAuthFlow() method from within an independent function, additionalValidators.validate(), which appears to check that all obligatory fields within the page are filled:
payWithPayPal: function () {
if (additionalValidators.validate()) {
Braintree.checkout.paypal.initAuthFlow();
}
}

In less code-based terms, a custom PayPal integration should be launched by the user taking some sort of action, so pop-up blockers recognize the PayPal window is legitimate. Because your integration is being launched by an independent action - the validation of the fields on the page - pop-up blockers may consider it problematic, and interfere with the checkout.

 

Your help solving this urgent issue is highly appreciated.

 

Thanks,
Chad

Login to Me Too
3 REPLIES 3

MTS_Ciaran
Moderator
Moderator

Hi,

 

So based on the message you received from Braintree it looks like you need to speak with the team/person that created the Magento integration that you are using as it doesnt looks to be integrated to the specification that's needed. 

 

What Magento plugin are you using?

Login to Me Too

cckassis
Contributor
Contributor

Hi, 

I am not using any plugin, Braintree is directly integrated onto Magento (v. 2.1.5.). I spoke to Magento but the issue wasn't resolved, no one seems to know what exactly the problem is. 

Thanks,

Chad 

Login to Me Too

alanablett
New Community Member

Hey @cckassis

 

Did you ever get to the bottom of this? Got exactly the same issue with Magento 2.2.3

 

Cheers

Login to Me Too

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.