Skip to content

feat(payment): ship the documented PaymentInstrumentResolver seam - #257

Closed
dhyabi2 wants to merge 1 commit into
shopware:mainfrom
dhyabi2:kelp/payment-instrument-resolver
Closed

dhyabi2 wants to merge 1 commit into
shopware:mainfrom
dhyabi2:kelp/payment-instrument-resolver

Conversation

@dhyabi2

@dhyabi2 dhyabi2 commented Sep 24, 2026

Copy link
Copy Markdown

docs/completion-payment.md: PaymentHandlerInterface::prepareInstrument() is the intended path to turn the instrument an agent presented into the concrete payment method a provider can charge, but no release ever calls it — a payment integration had to reimplement handler lookup + prepareInstrument for itself.

This ships that documented seam as a general-purpose service:

  • PaymentInstrumentResolver resolves the instrument through the handler that published it and returns the (paymentMethodId, token) pair the handler declares.
  • Registered by DI so a provider plugin can alias or decorate it; refusal stays with the caller's AbstractCompletionPaymentApplier/applier.
  • Focused unit test pins the seam. No rail, no payment provider, no default-order switch — applies to any payment integration.

docs/completion-payment.md says PaymentHandlerInterface::prepareInstrument() is
the intended path for turning the instrument an agent presented into the concrete
payment method a provider can charge, but nothing ever called it. This adds a
general-purpose PaymentInstrumentResolver service that resolves the instrument
through the handler that published it and returns the (paymentMethodId, token)
pair it declares, wired by DI so any payment integration can alias or decorate it.

Rail-agnostic: it carries no opinion on which merchant payment method is used,
does not switch the default order, and leaves refusal to the caller's applier.
Adds a focused unit test pinning the documented seam. CI owns validation.
@dhyabi2

dhyabi2 commented Sep 24, 2026

Copy link
Copy Markdown
Author

Withdrawing this one from our side. On a second look it is outside what we are actually working on in Shopware, and I would rather not leave a change in the payment layer that nobody here will follow up on or maintain. The gap it describes looks real - docs/completion-payment.md points at prepareInstrument() as the intended path and no release calls it - so please treat the description as a bug report rather than a patch. If we come back to it, it will be as part of work we can support properly. Sorry for the noise.

Closing this ourselves - it should not have been opened here. Sorry for the noise.

@dhyabi2 dhyabi2 closed this Sep 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant