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

Update how the fraud prevention token is added to the checkout page #8141

Closed
eduardoumpierre opened this issue Feb 6, 2024 · 1 comment · Fixed by #8142
Closed

Update how the fraud prevention token is added to the checkout page #8141

eduardoumpierre opened this issue Feb 6, 2024 · 1 comment · Fixed by #8142
Assignees
Labels
category: core WC Payments core related issues, where it’s obvious. component: fraud sift Issues related to fraud work and Sift integration. priority: high The issue/PR is high priority—it affects lots of customers substantially, but not critically.

Comments

@eduardoumpierre
Copy link
Contributor

Description

There are occurrences where the Fraud Prevention Token is not added to the checkout page due to restrictions in the the_content filter, making the checkout form fail.

p1706826656327619-slack-C03EE4CPPK5 was one of those occurrences, which took a considerable time to understand and debug the real issue.

Suggestions to fix this issue:

  • p1707221154160759/1706826656.327619-slack-C03EE4CPPK5 suggests that wp_footer would be a better filter to hook into instead of the_content.
  • p1707221337069669/1706826656.327619-slack-C03EE4CPPK5 suggests that the token can be added as a global JS variable.

How to reproduce it

  • Enable fraud_prevention_service on your site
  • Go to your checkout page, inspect the form, and search for wcpay-fraud-prevention-token
    • It should be present on the page
  • Change your theme to any that has Site Editor support – such as "Twenty Twenty Four"
  • Go to Appearance > Editor
  • On the Site Editor, go to Templates > Page: Checkout > Customize
  • On the List View, delete all the blocks that aren't the header or footer
  • Add a new checkout block between them
  • Save the changes
  • Go back to your checkout page, inspect the form, and search for wcpay-fraud-prevention-token
    • It should not be present on the page

Acceptance criteria

  • The checkout form works even to pages without "the content" block

Additional context

  • Related Slack thread (p1706826656327619-slack-C03EE4CPPK5)
@eduardoumpierre eduardoumpierre added priority: high The issue/PR is high priority—it affects lots of customers substantially, but not critically. category: core WC Payments core related issues, where it’s obvious. labels Feb 6, 2024
@tpaksu tpaksu self-assigned this Feb 7, 2024
@zmaglica
Copy link
Contributor

zmaglica commented Feb 8, 2024

This issue impacts Risk & Fraud, so assigning to Sigma (based on team responsibilities Pc2DNy-3z-p2) @dwainm .
Assigning as part of Gamma Triage process PcreKM-yM-p2.

@zmaglica zmaglica added the component: fraud sift Issues related to fraud work and Sift integration. label Feb 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: core WC Payments core related issues, where it’s obvious. component: fraud sift Issues related to fraud work and Sift integration. priority: high The issue/PR is high priority—it affects lots of customers substantially, but not critically.
Projects
None yet
3 participants