PayPal payment option within Braintree is failing to connect to PayPal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hey @cckassis
Did you ever get to the bottom of this? Got exactly the same issue with Magento 2.2.3
Cheers

Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.
- Issue with Payflow Pro: "Failed to connect to host" Error on Server Deployment in Payflow
- Braintree PayPal Docusign No Work Help No Work Need Other Option in Braintree Client-side Integration (JS, iOS, Android SDKs)
- Express Checkout via Braintree SDK - Sandbox Account - INVALID_RESOURCE_ID in Sandbox Environment
- Connect To PayPal script failed to show the button on recent websites built. in PayPal Payments Standard
- Payouts auto-reload balance in NVP/SOAP APIs