diff --git a/modules/ppcp-axo/src/AxoModule.php b/modules/ppcp-axo/src/AxoModule.php index d1731b4fe..02234775e 100644 --- a/modules/ppcp-axo/src/AxoModule.php +++ b/modules/ppcp-axo/src/AxoModule.php @@ -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' ); + } }