Skip to content

Release/2.0.0#21

Merged
adumont-payplug merged 2 commits into
mainfrom
release/2.0.0
Jun 29, 2026
Merged

Release/2.0.0#21
adumont-payplug merged 2 commits into
mainfrom
release/2.0.0

Conversation

@adumont-payplug

Copy link
Copy Markdown
Collaborator

Description

Related Issue

Ticket: PRE-XXXX

Type of Change

[ ] 🐛 Bug fix
[ ] ✨ New feature
[x] 💥 Breaking change
[x] ♻️ Refactor
[ ] 🔧 Configuration / CI
[x] 🚀 Release (release/* branch targeting master)
[x] 📦 Dependency update
[x] 🔒 Security fix
[ ] 📝 Documentation update


✅ Quality Checklist

Local Environment & Hooks

  • Local Git hooks (CaptainHook) are installed and executed cleanly.
  • Commit messages strictly follow the (PRE|SMP)-XXXX: description pattern.
  • Core configuration files (phpstan.neon / .php-cs-fixer.php) were generated successfully from .dist templates.

Testing & Code Quality

  • Coding style rules have been applied locally (composer cs:fix).
  • Static analysis checks pass with no new regressions (vendor/bin/phpstan).
  • I have added/updated unit or integration tests if applicable.
  • I have verified these changes locally on a native PrestaShop environment.

CI/CD Deployment Context

  • The CI pipeline passes fully on GitHub.
  • For Release Branches: If this is a release/* branch, I am targeting the correct base branch to allow the automated apply-release version bumping job to run.

Screenshots (if applicable)

Notes for Reviewer

@adumont-payplug adumont-payplug self-assigned this Jun 29, 2026
Copilot AI review requested due to automatic review settings June 29, 2026 12:47
@wiz-14d684d7a6

Copy link
Copy Markdown

Wiz Scan Summary

Scanner Findings
Vulnerability Finding Vulnerabilities -
Data Finding Sensitive Data -
Secret Finding Secrets -
IaC Misconfiguration IaC Misconfigurations 3 Medium 1 Low
SAST Finding SAST Findings -
Software Management Finding Software Management Findings -
Total 3 Medium 1 Low

View scan details in Wiz

To detect these findings earlier in the dev lifecycle, try using Wiz Code VS Code Extension.

Copilot AI left a comment

Copy link
Copy Markdown

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 payplug-plugin-mcp 2.0.0 release by renaming the package/namespace from the former Core naming, updating the toolchain/CI to PHP 7.4, and adding a first-class refund flow (DTOs, validators, gateway, API wrapper, and tests).

Changes:

  • Introduce refund support end-to-end (RefundInputDTO/RefundOutputDTO, RefundValidator, RefundGateway, PaymentAction::refundAction(), Api::refundPaymentResource()), with unit + integration tests.
  • Rename package + namespaces to PayPlugPluginMcp\* and refactor dependency loading in PaymentAction toward explicit factory methods (get_api(), etc.).
  • Update build/dev/release tooling (Docker/Makefile/CI, composer constraints, PR template, hooks) and remove the previous PHP 7.2 downgrade/release pipeline (Rector + release composer generator).

Reviewed changes

Copilot reviewed 47 out of 49 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
tests/Units/Gateways/Refund/RefundGateway/refundGatewayBase.php Adds a shared base test class for refund gateway unit tests.
tests/Units/Gateways/Refund/RefundGateway/formatRefundAttributesTest.php Adds unit tests for refund attribute formatting.
tests/Units/Gateways/PaymentGateway.php Updates test gateway loader to new namespace and loosens property typing for PHP compatibility.
tests/Units/Gateways/Payment/StandardPaymentGateway/standardPaymentGatewayBase.php Updates namespace and replaces typed properties with docblocks.
tests/Units/Gateways/Payment/StandardPaymentGateway/formatPaymentAttributesTest.php Updates namespace/imports and improves reflection invocation + generator docblock.
tests/Units/Actions/PaymentAction/refundActionTest.php Adds unit tests covering refund action validation and API error/success paths.
tests/Units/Actions/PaymentAction/paymentActionBase.php Updates namespace and replaces typed properties with docblocks.
tests/Units/Actions/PaymentAction/createActionTest.php Refactors unit tests to mock get_api() instead of the removed service loader.
tests/Traits/TestingTools.php Updates namespace and mock resolution to new PayPlugPluginMcp\Tests\Mock\* classes.
tests/Traits/FormatDataProvider.php Updates namespace and adds generator return docblocks.
tests/Mock/RefundOutputDTOMock.php Introduces a RefundOutputDTO mock helper for tests.
tests/Mock/RefundInputDTOMock.php Introduces a RefundInputDTO mock helper for tests.
tests/Mock/PaymentOutputDTOMock.php Updates namespace/imports; removes unused public properties.
tests/Mock/PaymentMock.php Updates namespace and removes typed static property to keep syntax compatible.
tests/Mock/PaymentInputDTOMock.php Updates namespace/imports to new DTO and traits.
tests/Integration/PaymentAction/refundActionTest.php Adds integration tests for refund creation failure/success behavior.
tests/Integration/PaymentAction/createActionTest.php Updates namespaces and replaces typed properties with docblocks.
src/Validators/RefundValidator.php Adds validation for refund amount bounds and refundable window checks.
src/Validators/PaymentResourceValidator.php Adds validation of payment resource id/failure/is_paid fields.
src/Utilities/Traits/DependenciesLoader.php Removes the previous generic service/gateway loader trait.
src/Utilities/Services/Api.php Adds refund API wrapper method and refactors initialization/typing.
src/Models/Entities/RefundOutputDTO.php Adds refund output DTO hydration + accessors.
src/Models/Entities/RefundInputDTO.php Adds refund input DTO hydration + accessors.
src/Models/Entities/PaymentOutputDTO.php Updates namespace and makes resource optional during hydration.
src/Models/Entities/PaymentInputDTO.php Updates namespace and adjusts optional metadata/context handling.
src/Gateways/RefundGateway.php Adds refund attribute formatting gateway.
src/Gateways/PaymentGatewayManager.php Updates namespace and class-resolution path to new root namespace.
src/Gateways/Payment/StandardPaymentGateway.php Updates namespace/imports to new root namespace.
src/Gateways/Payment/EmailLinkPaymentGateway.php Updates namespace/imports to new root namespace.
src/Gateways/AbstractPaymentGateway.php Updates namespace/imports and replaces typed properties with docblocks.
src/Actions/PaymentAction.php Adds refund flow orchestration and replaces dependency loader with explicit factories.
scripts/generate-release-composer.php Removes the previous script-based release composer generation.
rector.php Removes the previous Rector downgrade configuration.
Readme.md Updates requirements and local workflow commands toward Make targets.
phpstan.neon Removes fixed phpVersion and adds ignoreErrors for Payplug SDK dynamic properties.
Makefile Refactors targets and adds Xdebug-oriented debug workflow.
Dockerfile Switches to PHP 7.4 image, installs Xdebug 3.1.6, adds non-root user + healthcheck.
docker-compose.yml Adjusts Xdebug environment configuration.
composer.json Renames package, sets PHP constraint to ^7.4, adjusts dev tool versions and scripts.
captainhook.json Updates commit/branch naming regex and pre-commit actions.
.php-cs-fixer.dist.php Switches migration set to PHP 7.1 and adjusts trailing comma rule config.
.gitignore Adds additional cache paths and ignores docs/.
.github/workflows/release.yml Adds tag-driven GitHub Release workflow.
.github/workflows/pre-release.yml Adds RC workflow with quality gate and RC release publishing.
.github/workflows/ci.yml Simplifies CI to PR-based quality + SonarCloud on develop.
.github/workflows/auto-tag-rc.yml Adds auto RC0 tag workflow for release branches.
.github/PULL_REQUEST_TEMPLATE.md Replaces PR template with structured checklist format.
.github/copilot-instructions.md Adds repository-specific Copilot review guidance and project context.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Makefile
DC = docker compose
PHP = $(DC) run --rm php
PHP_DEBUG = XDEBUG_MODE=debug $(DC) run --rm php
PHP_DEBUG = XDEBUG_MODE=debug XDEBUG_SESSION=1 $(DC) run --rm php
Comment thread docker-compose.yml
Comment on lines +11 to +12
# Xdebug 2.x: pass XDEBUG_CONFIG="remote_enable=1 remote_autostart=1" to enable step-debug
XDEBUG_CONFIG: "${XDEBUG_CONFIG:-}"
Comment thread Readme.md

## Requirements
- PHP 7.2 or higher
- PHP 7.1 or higher
Comment on lines +18 to +26
$formated_attributes = [
'amount' => $refund_inputDTO->getAmount(),
'metadata' => [
'customer_id' => $refund_inputDTO->getCustomerId(),
'reason' => $refund_inputDTO->getReason(),
],
];

return $formated_attributes;
return;
}

$now = time();
throw new Exception(
\sprintf(
'RefundValidator: refund is not yet available (refundable_after: %s).',
date('Y-m-d H:i:s', (int) $resource->refundable_after)
throw new Exception(
\sprintf(
'RefundValidator: refund period has expired (refundable_until: %s).',
date('Y-m-d H:i:s', (int) $resource->refundable_until)
throw new Exception('PaymentResourceValidator: id must be a non-null string.');
}

if (!preg_match(self::ID_PATTERN, $id)) {
/**
* @param Payment|null $resource
*/
public function setResource($resource): void
/**
* @param Refund|null $resource
*/
public function setResource($resource): void
@adumont-payplug adumont-payplug merged commit ff41edf into main Jun 29, 2026
7 of 8 checks passed
@adumont-payplug adumont-payplug deleted the release/2.0.0 branch June 29, 2026 13:01
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.

4 participants