Conversation
the-sohan
force-pushed
the
fix/remove-unregistered-checkout-gateways
branch
from
September 29, 2026 04:56
9aa8a7f to
f9ad6b9
Compare
the-sohan
marked this pull request as ready for review
September 29, 2026 04:57
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Type
What kind of change does this PR introduce?
Description
When a payment gateway extension is deactivated or deleted, its key can remain in the saved
active_gatewaysoption. Checkout previously rendered that stale key directly, so customers could still see a Stripe payment option even though Stripe was no longer registered and could not process the payment.ATBDP_Gateway::get_active_gateways()now intersects the saved gateway keys with the currently registered payment processors. This removes stale gateways while preserving the configured order and automatically restores an enabled gateway when its extension registers the processor again. A standalone regression test covers removed, registered, and invalid-option cases. The changed gateway file also includes one adjacent concat-spacing correction required by the changed-file PHPCS check.How to reproduce the issue or test the changes:
Local verification:
php tests/php/checkout-active-gateways.phpphp tests/php/listing-import-taxonomy-cache.phpphp tests/php/listing-taxonomy-subterms.phpphp -l includes/gateways/class-gateway.phpphp -l tests/php/checkout-active-gateways.phpphp -d 'error_reporting=E_ALL & ~E_DEPRECATED' vendor/bin/phpcs --standard=phpcs.xml --warning-severity=0 includes/gateways/class-gateway.php tests/php/checkout-active-gateways.phpgit diff --checkNotes:
PHPCSHelper.php; local PHPCS was run with deprecations suppressed. The relevant files pass the configured standard.Screenshots
Before
Checkout shows Stripe after the Stripe extension has been deactivated because the stale saved gateway key was rendered directly.
After
Checkout now shows only Bank Transfer while Stripe is deactivated; reactivating Stripe makes it available again.
Checklist