Merge pull request #2340 from woocommerce/PCP-3256-remove-fastlane-from-pay-for-order-endpoint

AXO: Disable Fastlane for Order Pay endpoint (3256)
This commit is contained in:
Emili Castells 2024-06-14 09:57:15 +02:00 committed by GitHub
commit d42dc94caa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -74,6 +74,10 @@ class AxoModule implements ModuleInterface {
return $methods;
}
if ( $this->is_excluded_endpoint() ) {
return $methods;
}
$methods[] = $gateway;
return $methods;
},
@ -328,7 +332,8 @@ class AxoModule implements ModuleInterface {
return ! is_user_logged_in()
&& CartCheckoutDetector::has_classic_checkout()
&& $is_axo_enabled;
&& $is_axo_enabled
&& ! $this->is_excluded_endpoint();
}
/**
@ -373,4 +378,14 @@ class AxoModule implements ModuleInterface {
);
}
}
/**
* Condition to evaluate if the current endpoint is excluded.
*
* @return bool
*/
private function is_excluded_endpoint(): bool {
// Exclude the Order Pay endpoint.
return is_wc_endpoint_url( 'order-pay' );
}
}