question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

PayPal integration in Android WebView not working

See original GitHub issue

General information

  • SDK version: Javascript SDK, version 3.52.1
  • Environment: Production
  • Browser and OS: WebView (Chrome 77.0.3865.73), Android 9

Issue description

We use the Braintree JavaScript SDK for our PayPal checkout. The checkout is used on our site, as well as rendered from within our mobile apps. Everything works fine, except for the WebView in the Android app.

Here’s a step-by-step:

  1. Initiate the PayPal flow. This is done by calling tokenize on an PayPal instance that we created using braintree.paypal.create({...})
  2. A PayPal log in screen is rendered where only e-mail address can be entered. We enter a valid e-mail address.
  3. Next screen rendered is one where PayPal prompts for a password. We enter the correct password.
  4. We are redirected to another PayPal login screen, this time with both e-mail address and password. The same credentials are entered again.
  5. We are redirected to a PayPal page with a reCAPTCHA
  6. After completing the reCAPTCHA challenge, we arrive at a “pay with credit card” page with a button to “Agree & Continue”.
  7. When clicking the “Agree & Continue” button, a spinner with “Processing” appears, and when it disappears we are left with a blank white page.

When trying the same checkout on a browser on the same device, we are prompted with only one login flow (the one where email address and password in rendered together). This time, no reCAPTCHA challenge. After pressing “Agree & Continue”, we return to our checkout.

Any ideas why this is?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
scannillocommented, Sep 20, 2019

Hello. To help us get a better understanding of your integration, are you using the pop-up bridge? Since by default WebViews cannot open pop-ups, which is what the PayPal flow relies on, we offer this pop-up bridge as a solution for integrations embedded in a WebView. If you are not using the pop-up bridge, we can’t guarantee that your current setup will work, as a PayPal checkout does not officially support WebViews.

0reactions
crookedneighborcommented, Jan 6, 2021

@ZoltanSzokodi please reach out to our support team about this: https://help.braintreepayments.com/

Read more comments on GitHub >

github_iconTop Results From Across the Web

Paypal payment page layout broken in webview android
I am facing a strange issue on some android devices, I am opening the paypal payment page on webview and it's layout get...
Read more >
Paypal Payment Page Layout Broken In Webview ... - ADocLib
PayPal integration in Android WebView not working #459. Closed When clicking the "Agree & Continue" button, a spinner with that your current setup...
Read more >
Braintree.js Client Reference v3.1.0
Webviews on iOS and Android are supported for all integrations except PayPal. PayPal is not supported in any webview for security reasons.
Read more >
PayPal security guidelines and best practices
To help keep your integration safe from current and future security threats, we recommend that you follow the best practices outlined below.
Read more >
PayPal Native Checkout SDK for iOS and Android - Medium
However, for the checkout experience, PayPal best practices discourage the use of WebViews. This is to ensure the applications you develop ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found