[Documentation] If popup closes immediately

See original GitHub issue

πŸ“™ Describe the Issue

I have the problem that when I try to press the paypal button a second time after closing the popup window from the first time, the paypal popup window closes immediately.

πŸ˜• Actual Behavior

After logging into the popup window with a sandbox account and closing it, I get the error:

Create Subscription Api response error:

{
    "name": "NOT_AUTHORIZED",
    "message": "Authorization failed due to insufficient permissions.",
    "debug_id": "...",
    "details": [
        {
            "issue": "PERMISSION_DENIED",
            "description": "You do not have permission to access or perform operations on this resource."
        }
    ],
    "links": [
        {
            "href": "https://developer.paypal.com/docs/api/v1/billing/subscriptions#NOT_AUTHORIZED",
            "rel": "information_link",
            "method": "GET"
        }
    ]
}

The error appears only if the endpoint https://www.sandbox.paypal.com/graphql?UpgradeFacilitatorAccessToken was called. Which happens on the login in the window.

πŸ€” Expected Behavior

The window should stay in front of the application.

My Solution

The endpoint UpgradeFacilitatorAccessToken seems to be updating a token, so maybe the props are outdated of the button. So I added the method refreshProps to the onCancel Event:

onCancel: function (data, actions) {
  button.updateProps();
},

Now the popup window stays in front of my application no matter how many times I close it. Maybe you could extend a troubleshooting section in the documentation?

With best regards Niclas

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:8

github_iconTop GitHub Comments

1reaction
mnicptcommented, Jun 10, 2021

A fix is going for this hopefully today. The issue is that when the token is upgraded, it is missing the subscriptions scope. We will be preventing this upgrade for subscriptions.

0reactions
github-actions[bot]commented, Jun 16, 2022

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

jquery- popup closes immediately - javascript - Stack Overflow
On an html page, I'm having a hyperlink(id='WhatsNew'), which on clicking displays an html page as a poup, using the following jquery code:...
Read more >
UI Page popup closes automatically - ServiceNow Community
The popup appears onSubmit as expected, however, it closes automatically and almost immediately.
Read more >
Popup Window closes immediately when a top form is ...
Popup Window closes immediately when a top form is maximized and the Windows taskbar is auto-hidden. as you can see in the video...
Read more >
Automatically Close Popup does not work - WordPress.org
Hello! I'm trying to make a popup window (created with the popup-maker plugin) close automatically after a few seconds. Using the my-custom-functions pluginΒ ......
Read more >
Window.closed - Web APIs - MDN Web Docs - Mozilla
In this example the function refreshPopupWindow() calls the reload() method of the popup's location object to refresh its data. If the popup ......
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