PRE-3682: scope API client creation to the payment method - #325
Merged
adumont-payplug merged 1 commit intoSep 15, 2026
Conversation
adumont-payplug
added this pull request to stack #326
September 14, 2026 15:20
adumont-payplug
force-pushed
the
fix/PRE-3682_scope_client_to_payment_method
branch
from
September 14, 2026 15:23
a28640f to
35ba028
Compare
adumont-payplug
removed this pull request from stack #326
September 15, 2026 08:15
adumont-payplug
added this pull request to stack #328
September 15, 2026 08:17
Base automatically changed from
fix/PRE-3683_per_config_account_memo
to
feature/PRE-3440_multi_shop_configuration
September 15, 2026 08:17
adumont-payplug
force-pushed
the
fix/PRE-3682_scope_client_to_payment_method
branch
from
September 15, 2026 08:17
35ba028 to
104e6b6
Compare
There was a problem hiding this comment.
Claude Code Review
Claude Code Review is paused for this repository. To reconnect it, an admin of this repository's GitHub organization (or the account owner, for personal repositories) who can also manage your Claude organization's Code Review settings needs to re-link GitHub in Code Review settings. This is a one-time step.
Tip: disable this comment in your organization's Code Review settings.
adumont-payplug
merged commit Sep 15, 2026
f7fe9a3
into
feature/PRE-3440_multi_shop_configuration
5 of 6 checks passed
adumont-payplug
deleted the
fix/PRE-3682_scope_client_to_payment_method
branch
September 15, 2026 08:19
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.
Description
PayPlugApiClientFactory::create(string $factoryName)resolves its gateway config withfindOneBy(['factoryName' => $factoryName]). Since PRE-3628 several enabledGatewayConfigrows may share a
factoryName— one per channel — so Doctrine returns an arbitrary one and theplugin can sign a request for channel A with channel B's account credentials.
This PR routes the remaining direct callers through the correctly-scoped
createForPaymentMethod(PaymentMethodInterface)and removescreate()fromPayPlugApiClientFactoryInterface, so the compiler — not review — is the guard against theambiguous path being reintroduced.
IpnActionandIntegratedPaymentControllernow usecreateForPaymentMethod(). The latteralso moved off the concrete
final PayPlugApiClientFactorytype-hint, which made it untestable.new guard (
OneClickAction,PaymentStateResolver,CaptureAuthorizedPaymentProcessor,IsOneyEnabledValidator,PayplugPermissionValidator). All already calledcreateForPaymentMethod(), so they now depend on the interface.lint:containerpasses.SupportedMethodsProvider's two resolvers take theGatewayConfigInterfaceinstead of theambient
$factoryName; shared suffix logic extracted intopaymentMethodKey().Not included —
create()stays on the concrete class, marked@internal. The ticket assumed4 call sites; there are 7 more, reaching it through the
payplug_sylius_payplug_plugin.api_client.*singletons in
client.xml(<factory … method="create"/>),#[Autowire]d intoOneyChecker,CardController,OneyRulesExtension,ShowMeaExtension,OneySimulationDataProvider,ApplePayPaymentProviderandRefundUnitsCommandCreatorDecorator. Three of them have no paymentmethod in scope at all and need a design decision, so that half stays open on PRE-3682.
CLAUDE.mddescribed these singletons as dead wiring; corrected here, and PRE-3684 corrected too.Motivation: a cross-channel credential leak — a multi-boutique merchant's payment can be
created, captured or refunded against another channel's PayPlug account.
Related issue(s): PRE-3682 — do not auto-close, one criterion stays open (see above).
Type of Change
Checklist
Code Quality
Testing
sonarcloudCI jobSecurity & Ops