Skip to content

Release/2.1.0#292

Open
adumont-payplug wants to merge 5 commits into
masterfrom
release/2.1.0
Open

Release/2.1.0#292
adumont-payplug wants to merge 5 commits into
masterfrom
release/2.1.0

Conversation

@adumont-payplug
Copy link
Copy Markdown
Collaborator

Description

Motivation:

  • Implementing Scalapay APM
  • Adding Unit tests on the plugin
  • Improving CI

Type of Change

  • ✨ New feature (non-breaking change that adds functionality)

Checklist

Code Quality

  • Code is linted and formatted
  • No unnecessary commented-out code or debug logs
  • No hardcoded values (use env variables or config)

Testing

  • Unit tests added / updated

Security & Ops

  • No sensitive data or secrets introduced
  • Logging and error handling are appropriate

Comment thread composer.json
{
"name": "payplug/sylius-payplug-plugin",
"type": "sylius-plugin",
"version": "2.0.0.",
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@adumont-payplug this should reverted imho

Copilot AI review requested due to automatic review settings May 26, 2026 15:22
Copy link
Copy Markdown

@claude claude Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Code review skipped — your organization's overage spend limit has been reached.

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.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread composer.json
{
"name": "payplug/sylius-payplug-plugin",
"type": "sylius-plugin",
"version": "2.0.0.",
Comment thread README.md
Comment on lines 1 to +4
[![License](https://img.shields.io/packagist/l/payplug/sylius-payplug-plugin.svg)](https://github.com/payplug/SyliusPayPlugPlugin/blob/master/LICENSE)
[![CI - Analysis](https://github.com/payplug/SyliusPayPlugPlugin/actions/workflows/analysis.yaml/badge.svg?branch=master)](https://github.com/payplug/SyliusPayPlugPlugin/actions/workflows/analysis.yaml)
[![CI - Sylius](https://github.com/payplug/SyliusPayPlugPlugin/actions/workflows/sylius.yaml/badge.svg?branch=master)](https://github.com/payplug/SyliusPayPlugPlugin/actions/workflows/sylius.yaml)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=github-payplug-payplug-syliuspayplugplugin&metric=alert_status&token=af29f9f3fbb3a74caff4e4a4d168bddab858f4dc)](https://sonarcloud.io/summary/new_code?id=github-payplug-payplug-syliuspayplugplugin)
[![Duplicated Lines (%)](https://sonarcloud.io/api/project_badges/measure?project=github-payplug-payplug-syliuspayplugplugin&metric=duplicated_lines_density&token=af29f9f3fbb3a74caff4e4a4d168bddab858f4dc)](https://sonarcloud.io/summary/new_code?id=github-payplug-payplug-syliuspayplugplugin)
[![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=github-payplug-payplug-syliuspayplugplugin&metric=code_smells&token=af29f9f3fbb3a74caff4e4a4d168bddab858f4dc)](https://sonarcloud.io/summary/new_code?id=github-payplug-payplug-syliuspayplugplugin)
Comment on lines 21 to +45
@@ -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()]);
Comment on lines 24 to 30
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.
Comment on lines 24 to 30
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.
Comment on lines 24 to 30
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.
Comment on lines +13 to +19
- 🐛 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 [ ]
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.

3 participants