Skip to content

refactor(payment): centralize payment methods resolution#5191

Open
hackmanser wants to merge 3 commits intocoopcycle:masterfrom
hackmanser:refactor/4927-payment-methods-resolver
Open

refactor(payment): centralize payment methods resolution#5191
hackmanser wants to merge 3 commits intocoopcycle:masterfrom
hackmanser:refactor/4927-payment-methods-resolver

Conversation

@hackmanser
Copy link
Copy Markdown
Contributor

Closes #4927.

Summary

Centralize payment-method availability resolution into PaymentMethodsResolver and reuse it in API + checkout + selection endpoint.

Changes

  • Add AppBundle\Payment\PaymentMethodsResolver + ResolvedPaymentMethod.
  • Use resolver in src/Action/Order/PaymentMethods.php and src/Form/Checkout/CheckoutPaymentType.php.
  • Validate payment-method selection against resolver to prevent selecting unavailable methods.
  • Add unit tests for resolver behavior.

Notes

  • apple_pay/google_pay remain API-only (not shown in checkout form).
  • Pawapay: card is excluded when the restaurant has Pawapay disabled.

Testing

  • docker compose run --rm php vendor/bin/phpunit --filter PaymentMethodsResolverTest

CI (fork)

@hackmanser hackmanser closed this Feb 20, 2026
@alexsegura
Copy link
Copy Markdown
Member

@hackmanser why did you close it?

@hackmanser hackmanser reopened this Feb 26, 2026
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

Refactor/centralize payment methods resolution

2 participants