Release/2.1.0#292
Conversation
e6d89eb to
3ac36f6
Compare
| { | ||
| "name": "payplug/sylius-payplug-plugin", | ||
| "type": "sylius-plugin", | ||
| "version": "2.0.0.", |
There was a problem hiding this comment.
Code review is billed via overage credits. To resume reviews, an organization admin can raise the monthly limit at claude.ai/admin-settings/claude-code.
Once credits are available, push a new commit or reopen this pull request to trigger a review.
There was a problem hiding this comment.
Pull request overview
This PR prepares the 2.1.0 release by adding the Scalapay APM to the Sylius PayPlug plugin, expanding runtime filtering of supported payment methods based on PayPlug account configuration, and introducing a substantial PHPUnit unit test suite alongside CI/tooling updates.
Changes:
- Add Scalapay gateway (factory, configuration type, payment method resolver, refund support, UI hook + logo, translations).
- Replace hardcoded currency/amount eligibility with PayPlug
getAccount()-driven filtering (plus allowed-countries filtering). - Add extensive PHPUnit coverage for validators, resolvers, payment creation/status handling, notifications, refunds, and processors; update CI/tooling configs.
Reviewed changes
Copilot reviewed 82 out of 85 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| translations/validators.it.yml | Add Scalapay validator messages (test mode / access). |
| translations/validators.fr.yml | Add Scalapay validator messages (test mode / access). |
| translations/validators.en.yml | Add Scalapay validator messages (test mode / access). |
| translations/messages.it.yml | Add Scalapay gateway label. |
| translations/messages.fr.yml | Add Scalapay gateway label. |
| translations/messages.en.yml | Add Scalapay gateway label. |
| tests/TestApplication/src/Entity/PaymentMethod.php | Fix import ordering for test application entity. |
| tests/TestApplication/config/bundles.php | Add declare(strict_types=1); to bundles config. |
| tests/PHPUnit/Validator/PaymentMethodValidatorTest.php | New unit tests for PaymentMethodValidator behavior. |
| tests/PHPUnit/Resolver/OneyPaymentMethodsResolverDecoratorTest.php | New unit tests for Oney resolver decorator filtering. |
| tests/PHPUnit/Provider/SupportedMethodsProviderTest.php | New unit tests for SupportedMethodsProvider filtering logic (currency/amount/country). |
| tests/PHPUnit/PhoneNumberFormatTest.php | Fix test class name casing to match file/convention. |
| tests/PHPUnit/PaymentProcessing/RefundPaymentProcessorTest.php | New unit tests for refund processor (incl. Scalapay support). |
| tests/PHPUnit/PaymentProcessing/RefundPaymentHandlerTest.php | New unit tests for refund handler request-to-command mapping. |
| tests/PHPUnit/PaymentProcessing/AbortPaymentProcessorTest.php | New unit tests for abort processor behavior. |
| tests/PHPUnit/Handler/PaymentNotificationHandlerTest.php | New unit tests for payment notification handling and card saving. |
| tests/PHPUnit/Creator/PayPlugPaymentDataCreatorTest.php | New unit tests for payment payload creation (incl. Scalapay context). |
| tests/PHPUnit/Action/StatusActionTest.php | New unit tests for Payum status action logic. |
| tests/PHPUnit/Action/ConvertPaymentActionTest.php | New unit tests for Payum convert action. |
| templates/shop/select_payment/_scalapay.html.twig | New Scalapay payment choice/logo rendering hook. |
| src/Validator/PaymentMethodValidator.php | Add Scalapay support to payment method validation flow. |
| src/Resolver/ScalapayPaymentMethodsResolverDecorator.php | New resolver decorator applying SupportedMethodsProvider for Scalapay. |
| src/Resolver/PayPlugPaymentMethodsResolverDecorator.php | Update resolver to use dynamic filtering (amount + billing country). |
| src/Resolver/PaymentStateResolver.php | Import cleanup / type adjustments. |
| src/Resolver/OneyPaymentMethodsResolverDecorator.php | Import cleanup / type adjustments. |
| src/Resolver/BancontactPaymentMethodsResolverDecorator.php | Update resolver to use dynamic filtering (amount + billing country). |
| src/Resolver/ApplePayPaymentMethodsResolverDecorator.php | Update resolver to use dynamic filtering (amount + billing country). |
| src/Resolver/AmericanExpressPaymentMethodsResolverDecorator.php | Update resolver to use dynamic filtering (amount + billing country). |
| src/Repository/PaymentRepository.php | Small refactor to store query result in a variable for typing clarity. |
| src/Provider/SupportedRefundPaymentMethodsProviderDecorator.php | Import cleanup / type adjustments. |
| src/Provider/SupportedMethodsProvider.php | Replace hardcoded eligibility with PayPlug account-driven currency/amount + allowed-countries filtering. |
| src/Provider/ScalapaySupportedRefundPaymentMethodsProviderDecorator.php | New decorator enabling Scalapay as a supported refund method. |
| src/Provider/Payment/ApplePayPaymentProvider.php | Minor formatting/logging spacing changes. |
| src/Provider/OneySupportedPaymentChoiceProvider.php | Import cleanup / type adjustments. |
| src/Provider/AbstractSupportedRefundPaymentMethodsProvider.php | Import cleanup / type adjustments. |
| src/PaymentProcessing/RefundPaymentProcessor.php | Add Scalapay to supported refund gateway list + import cleanup. |
| src/PaymentProcessing/RefundPaymentHandler.php | Trailing comma / formatting tweak. |
| src/PaymentProcessing/AbortPaymentProcessor.php | Switch to factory interface + minor formatting. |
| src/OrderPay/Provider/CaptureHttpResponseProvider.php | Register capture http-response provider tag for Scalapay. |
| src/MessageHandler/RefundPaymentGeneratedHandler.php | Add Scalapay to refund generation handling list + import cleanup. |
| src/Handler/PaymentNotificationHandler.php | Guard against missing status key in details array. |
| src/Gateway/Validator/Constraints/IsOneyEnabledValidator.php | Import cleanup / type adjustments. |
| src/Gateway/Validator/Constraints/IsCanSavePaymentMethod.php | Minor formatting. |
| src/Gateway/ScalapayGatewayFactory.php | New Scalapay gateway factory constants. |
| src/Gateway/PayPlugGatewayFactory.php | Remove hardcoded authorized currencies constants. |
| src/Gateway/Form/Type/ScalapayGatewayConfigurationType.php | New Scalapay gateway configuration type registration. |
| src/Gateway/Form/Type/AbstractGatewayConfigurationType.php | Minor formatting. |
| src/Gateway/BancontactGatewayFactory.php | Remove hardcoded authorized currencies constants. |
| src/Gateway/ApplePayGatewayFactory.php | Remove hardcoded authorized currencies constants. |
| src/Gateway/AmericanExpressGatewayFactory.php | Remove hardcoded authorized currencies constants. |
| src/Form/Extension/PaymentTypeExtension.php | Import cleanup / type adjustments. |
| src/EventListener/PostSavePaymentMethodEventListener.php | Remove unused import + minor docblock formatting. |
| src/Entity/Traits/PaymentMethodTrait.php | Remove unused import. |
| src/Entity/Traits/CustomerTrait.php | Remove unused import. |
| src/Creator/RefundUnitsCommandCreatorDecorator.php | Minor formatting/trailing comma update. |
| src/Creator/PayPlugPaymentDataCreator.php | Add Scalapay payment_context + map Scalapay to payment_method key. |
| src/Controller/OrderController.php | Minor formatting changes. |
| src/Controller/OneClickAction.php | Import cleanup / type adjustments. |
| src/Command/Provider/StatusPaymentRequestCommandProvider.php | Register Scalapay status command provider tag. |
| src/Command/Provider/NotifyPaymentRequestCommandProvider.php | Register Scalapay notify command provider tag. |
| src/Command/Provider/CapturePaymentRequestCommandProvider.php | Register Scalapay capture command provider tag. |
| src/Command/Handler/StatusPaymentRequestHandler.php | Minor typing/docblock improvement + formatting. |
| src/Command/Handler/CapturePaymentRequestHandler.php | Add “already created” guard (status+factory_name) + add logger and store factory_name in details. |
| src/ApiClient/PayPlugApiClientFactory.php | Refactor config selection for test/live client config + typing comments. |
| src/Action/Admin/Auth/UnifiedAuthenticationController.php | Minor formatting/logging spacing changes. |
| ruleset/rector.php | Formatting (trailing whitespace/newline). |
| ruleset/phpstan-baseline.neon | Add phpstan baseline entry for Scalapay resolver return type warning. |
| README.md | Replace CI badges with SonarCloud badges. |
| public/assets/scalapay/logo.svg | Add Scalapay logo asset. |
| grumphp.yml | Add commit/branch checks, adjust phpstan/ecs options and paths. |
| ecs.php | Add root ECS config (paths + unused imports rule). |
| config/twig_hooks/shop.yaml | Add Scalapay payment choice details hook/template mapping. |
| config/twig_hooks/admin.yaml | Add Scalapay gateway configuration section hooks. |
| config/services/gateway.xml | Register Payum gateway factory builder for Scalapay. |
| config/services/client.xml | Register Scalapay API client service. |
| config/services.yaml | Register Scalapay command provider and http response provider. |
| composer.json | Update dev dependency constraint and scripts; add (currently invalid) version field. |
| .gitignore | Ignore PHPUnit result cache file. |
| .github/workflows/sylius.yaml | Remove legacy Sylius matrix workflow. |
| .github/workflows/release.yml | Add reusable “Release — RC” workflow. |
| .github/workflows/pull_request_template.md | Remove misplaced PR template under workflows directory. |
| .github/workflows/ci.yml | Add reusable CI workflow for specific base branches + SonarCloud job. |
| .github/workflows/auto-tag-rc.yml | Add auto-tag RC0 workflow for release/* branches. |
| .github/workflows/analysis.yaml | Remove legacy analysis workflow. |
| .github/PULL_REQUEST_TEMPLATE.md | Add standardized PR template at correct GitHub location. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| { | ||
| "name": "payplug/sylius-payplug-plugin", | ||
| "type": "sylius-plugin", | ||
| "version": "2.0.0.", |
| [](https://github.com/payplug/SyliusPayPlugPlugin/blob/master/LICENSE) | ||
| [](https://github.com/payplug/SyliusPayPlugPlugin/actions/workflows/analysis.yaml) | ||
| [](https://github.com/payplug/SyliusPayPlugPlugin/actions/workflows/sylius.yaml) | ||
| [](https://sonarcloud.io/summary/new_code?id=github-payplug-payplug-syliuspayplugplugin) | ||
| [](https://sonarcloud.io/summary/new_code?id=github-payplug-payplug-syliuspayplugplugin) | ||
| [](https://sonarcloud.io/summary/new_code?id=github-payplug-payplug-syliuspayplugplugin) |
| @@ -33,6 +38,15 @@ public function provide( | |||
| continue; | |||
| } | |||
|
|
|||
| $authorizedCurrencies ??= $this->resolveAuthorizedCurrencies($factoryName); | |||
| $allowedCountries ??= $this->resolveAllowedCountries($factoryName); | |||
|
|
|||
| if ($billingCountryCode !== null && $allowedCountries !== [] && !\in_array($billingCountryCode, $allowedCountries, true)) { | |||
| unset($supportedMethods[$key]); | |||
| $payplugPayment = $client->createPayment($data); | ||
| } catch (HttpException $exception) { | ||
| $paymentRequest->setResponseData(\json_decode($exception->getHttpResponse(), true)); // @phpstan-ignore-line | ||
| $this->logger->error('[PayPlug] Scalapay capture failed', ['response' => $exception->getHttpResponse()]); |
| confirmation_modal: | ||
| confirm_card_deletion: Are you sure you want to delete this card? | ||
| bancontact_gateway_label: Bancontact by Payplug | ||
| scalapay_gateway_label: Scalapay by PayPlug | ||
| apple_pay_gateway_label: Apple Pay by Payplug | ||
| american_express_gateway_label: American Express by Payplug | ||
| apple_pay_not_available: Apple Pay is not available on this browser or device. |
| confirmation_modal: | ||
| confirm_card_deletion: Êtes-vous sûr(e) de vouloir supprimer cette carte ? | ||
| bancontact_gateway_label: Bancontact by Payplug | ||
| scalapay_gateway_label: Scalapay by PayPlug | ||
| apple_pay_gateway_label: Apple Pay by Payplug | ||
| american_express_gateway_label: American Express by Payplug | ||
| apple_pay_not_available: Apple Pay n'est pas disponible sur ce navigateur ou appareil. |
| confirmation_modal: | ||
| confirm_card_deletion: Desideri cancellare questa carta? | ||
| bancontact_gateway_label: Bancontact by Payplug | ||
| scalapay_gateway_label: Scalapay by PayPlug | ||
| apple_pay_gateway_label: Apple Pay by Payplug | ||
| american_express_gateway_label: American Express by Payplug | ||
| apple_pay_not_available: Apple Pay non è disponibile su questo browser o dispositivo. |
| - 🐛 Bug fix (non-breaking change that fixes an issue) [ ] | ||
| - ✨ New feature (non-breaking change that adds functionality) [ ] | ||
| - 💥 Breaking change (fix or feature that causes existing functionality to change and that could impact other libs) [ ] | ||
| - 🔧 Refactor (no functional changes, code improvement only) [ ] | ||
| - 📦 Dependency update [ ] | ||
| - 🔒 Security fix [ ] | ||
| - 📝 Documentation update [ ] |
Description
Motivation:
Type of Change
Checklist
Code Quality
Testing
Security & Ops