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

Address invalid nonce due to no customer session in a more robust way #455

Merged

Conversation

dechov
Copy link
Contributor

@dechov dechov commented Jul 12, 2018

Ensures a customer session has been created early enough (for a consistent AJAX nonce) – before scripts are enqueued, at which point headers may have already been sent.

Partially reverts e5c5c47, which fixed the bug on some sites by initializing the session, but on other sites, the header template was being printed before the session could be saved, which was too late for saving the cookie, and so there was a new session (and therefore new nonce) when the AJAX request was processed.

(copied from #445:)

Testing the failure case on sites that still have this issue, such as https://jurassic.ninja/ sites:

To reproduce broken payments with Smart Payment Buttons enabled, open single product page in a new session (e.g. Firefox Private Browsing), click the PayPal Checkout button, and see the PayPal window open and immediately close.

Again...

Should address reports of PayPal window closing immediately (#438, forum thread).

Ensures a customer session has been created (for a consistent nonce) before scripts are enqueued, at which point headers may have already been sent. Partially reverts e5c5c47, which fixed the bug on some sites but not others.
@dechov
Copy link
Contributor Author

dechov commented Jul 19, 2018

Copy link
Member

@bor0 bor0 left a comment

Choose a reason for hiding this comment

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

Looks good!

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.

2 participants