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 SDK Buttons: unhandled_error [Error: Window closed]

See original GitHub issue

PayPal Smart Button: unhandled error when popup closed before it loads

Screen Shot 2020-04-02 at 17 20 46

Code snippet:

paypal.Buttons({
        style: {
            layout: 'vertical',
            color: 'gold',
            shape: 'pill',
            label: 'paypal'
        },
        env: 'sandbox',
        client: {
            sandbox,
            production
        },
        locale: 'en_GB',
        createBillingAgreement: onPaypalCreateBillingAgreement,
        onApprove: onPaypalApprovedPayment,
        onCancel: onPaymentCancelled,
        onError: onPaymentError
    }).render('#braintree-paypal-cta');

Where onPaypalCreateBillingAgreement simply does paypalCheckoutInstance.createPayment({ flow: 'vault', enableShippingAddress: false })

Steps to reproduce

  1. Click on PayPal Smart Button
  2. Close the popup before loader stops

Affected browsers

  • Chrome
  • Safari
  • Firefox
  • Edge
  • IE
  • Chrome Mobile/Tablet
  • Safari Mobile/Tablet
  • Web View / Safari ViewController
  • Other

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:11
  • Comments:28 (11 by maintainers)

github_iconTop GitHub Comments

6reactions
komakinocommented, May 22, 2020

Any news on this? We’re experiencing the same issue.

6reactions
bluepnumecommented, Apr 22, 2020

Hi @cusero – sorry, the discussion got a little sidetracked on an unrelated issue. I’ll take a look at the problem you initially reported. Thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Handle Errors - PayPal Developer
Buyer checkout error. If an error prevents buyer checkout, alert the user that an error has occurred with the buttons using the onError...
Read more >
In My Paypal Server Side Integration, The Payment Popup ...
The button calls PayPal Orders API to set up a transaction. ... unhandled error[Bug] New window closes We have been getting mixed results ......
Read more >
Paypal Checkout window closes immediately in WKWebView ...
It was wroking fine but suddenly the Paypal buttons starts working strangely as I click paypal button it opens checkout page and suddenly...
Read more >
Clicking on Paypal button quickly opens/closes external ...
Problem When you enable Paypal within the Commerce Braintree module and then ... Then an external Paypal window quickly opens and closes ......
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