Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix window reload on javascript payment callbacks #255

Open
wants to merge 1 commit into
base: 1.4
Choose a base branch
from

Conversation

hdasdoria
Copy link

Q A
Branch? 1.4
Bug fix? yes
New feature? no
Related tickets /

Hi, there was an issue with the javascripts in the payWithPaypal template.

The window.location.reload() in error and cancel callbacks was executed instead of being passed as a callback in the fetch().then() function.

The page was reloading before the call was made and the payment was never cancelled, so the payment could not be processed again !

Had to override locally because half of our paypal orders fell in that and payment were never completed.

@@ -268,7 +268,7 @@
method: 'post',
headers: {},
body: error
}).then(window.location.reload());
}).then(() => window.location.reload());

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
}).then(() => window.location.reload());
}).then(window.location.reload);

window.location.reload is a function
window.location.reload() is the function call

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants