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: match thankyou template when using existing customer email #1550

Merged
merged 4 commits into from
Oct 10, 2023

Conversation

dkoo
Copy link
Contributor

@dkoo dkoo commented Oct 10, 2023

All Submissions:

Changes proposed in this Pull Request:

Adjusts some logic in the WooCommerce checkout flow when using the modal checkout. In the scenario where a donation is made while logged out but using an email address that's already associated with a custom account, we don't want to show the login prompt on the thank you step—instead, we want to show the order summary like we do for new email addresses or when already logged in.

How to test the changes in this Pull Request:

  1. On release, while not logged in, make a donation using an email address that's already associated with an existing reader account.
  2. On the thank you step after the successful transaction, observe that instead of an order summary, there's a message to "Please log in to your account to view this order" and a login form.
  3. Check out this branch, repeat with a new donation and the same email address. This time confirm that the thank you page shows an order summary and no message or login form, similarly to what's shown when donating using a new email address.

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes, as applicable?
  • Have you successfully ran tests with your changes locally?

@dkoo dkoo self-assigned this Oct 10, 2023
@dkoo dkoo requested a review from a team as a code owner October 10, 2023 05:22
Copy link
Member

@miguelpeixe miguelpeixe left a comment

Choose a reason for hiding this comment

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

Tests well!

@dkoo dkoo requested a review from miguelpeixe October 10, 2023 18:24
@dkoo
Copy link
Contributor Author

dkoo commented Oct 10, 2023

4d20fee adds an extra security layer using Woo's key hash which ties the order details summary to the specific transaction flow. This should prevent CSRF requests from being able to expose customer and order details using just an order ID. If the key hash isn't valid, you'll be prompted to log in, but via a link to My Account instead of an inline login form (testable by mocking the value of key on this line).

Screenshot 2023-10-10 at 12 23 24 PM

@dkoo dkoo merged commit 4b0dbf2 into release Oct 10, 2023
1 check passed
@dkoo dkoo deleted the hotfix/thankyou-template branch October 10, 2023 19:22
matticbot pushed a commit that referenced this pull request Oct 10, 2023
## [1.75.4](v1.75.3...v1.75.4) (2023-10-10)

### Bug Fixes

* match thankyou template when using existing customer email ([#1550](#1550)) ([4b0dbf2](4b0dbf2))
@matticbot
Copy link
Contributor

🎉 This PR is included in version 1.75.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

adekbadek added a commit that referenced this pull request Oct 19, 2023
Introduced here (#1550 (comment)),
but if the key and order are not valid, this template will not be rendered at all.
adekbadek added a commit that referenced this pull request Oct 19, 2023
Introduced here (#1550 (comment)),
but if the key and order are not valid, this template will not be rendered at all.
@adekbadek adekbadek mentioned this pull request Oct 19, 2023
6 tasks
matticbot pushed a commit that referenced this pull request Oct 19, 2023
## [1.75.6](v1.75.5...v1.75.6) (2023-10-19)

### Bug Fixes

* hide WC's login prompt ([124fee7](124fee7))
* **modal-checkout:** remove login prompt from initial flow ([4a8d48f](4a8d48f)), closes [/github.com//pull/1550#issuecomment-1755996086](https://github.com//github.com/Automattic/newspack-blocks/pull/1550/issues/issuecomment-1755996086)
matticbot pushed a commit that referenced this pull request Oct 19, 2023
# [2.0.0-alpha.2](v2.0.0-alpha.1...v2.0.0-alpha.2) (2023-10-19)

### Bug Fixes

* hide WC's login prompt ([124fee7](124fee7))
* **modal-checkout:** remove login prompt from initial flow ([4a8d48f](4a8d48f)), closes [/github.com//pull/1550#issuecomment-1755996086](https://github.com//github.com/Automattic/newspack-blocks/pull/1550/issues/issuecomment-1755996086)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants