Merge pull request #3293 from woocommerce/PCP-4428-fastlane-gateway-visible-on-pay-for-order-page

Fastlane gateway visible on Pay for Order page (4428)
This commit is contained in:
Emili Castells 2025-04-14 13:23:37 +03:00 committed by GitHub
commit f5461a1eb2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 21 additions and 1 deletions

View file

@ -347,6 +347,26 @@ class AxoModule implements ServiceModule, ExtendingModule, ExecutableModule {
}
);
// Remove Fastlane on the Pay for Order page.
add_filter(
'woocommerce_available_payment_gateways',
/**
* Param types removed to avoid third-party issues.
*
* @psalm-suppress MissingClosureParamType
*/
static function ( $methods ) {
if ( ! is_array( $methods ) || ! is_wc_endpoint_url( 'order-pay' ) ) {
return $methods;
}
// Remove Fastlane if present.
unset( $methods[ AxoGateway::ID ] );
return $methods;
}
);
return true;
}