Skip to content

Commit

Permalink
Explain in the comments why the token is added to the product page
Browse files Browse the repository at this point in the history
  • Loading branch information
asumaran committed Jul 5, 2024
1 parent 7f08e53 commit bcf8bfa
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions includes/fraud-prevention/class-fraud-prevention-service.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ public static function get_instance( $session = null, $gateway = null ): self {

/**
* Appends the fraud prevention token to the JS context if the protection is enabled, and a session exists.
* This token will also be used by express checkouts.
*
* @return void
*/
Expand All @@ -86,8 +87,8 @@ public static function maybe_append_fraud_prevention_token() {
return;
}

// Don't add the token if the user isn't on the cart or checkout page.
// Checking the cart page too because the user can pay quickly via the payment buttons on that page.
// Don't add the token if the user isn't on the cart, checkout or product page.
// Checking the product and cart page too because the user can pay quickly via the payment buttons on that page.
if ( ! is_checkout() && ! is_cart() && ! is_product() ) {
return;
}
Expand Down

0 comments on commit bcf8bfa

Please sign in to comment.