Release/2.0.0#21
Merged
Merged
Conversation
Wiz Scan Summary
To detect these findings earlier in the dev lifecycle, try using Wiz Code VS Code Extension. |
There was a problem hiding this comment.
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 inPaymentActiontoward 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.
| 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 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:-}" |
|
|
||
| ## 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 |
jhoaraupp
approved these changes
Jun 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Related Issue
Ticket: PRE-XXXX
Type of Change
[ ] 🐛 Bug fix
[ ] ✨ New feature
[x] 💥 Breaking change
[x] ♻️ Refactor
[ ] 🔧 Configuration / CI
[x] 🚀 Release (
release/*branch targetingmaster)[x] 📦 Dependency update
[x] 🔒 Security fix
[ ] 📝 Documentation update
✅ Quality Checklist
Local Environment & Hooks
(PRE|SMP)-XXXX: descriptionpattern.phpstan.neon/.php-cs-fixer.php) were generated successfully from.disttemplates.Testing & Code Quality
composer cs:fix).vendor/bin/phpstan).CI/CD Deployment Context
release/*branch, I am targeting the correct base branch to allow the automatedapply-releaseversion bumping job to run.Screenshots (if applicable)
Notes for Reviewer