[CC-4064] Deprecate the PIS (Unzer Bank Transfer) payment type and remove its integration tests. - #238
Merged
Merged
Conversation
sixer1182
enabled auto-merge
September 9, 2026 08:05
Ryouzanpaku
approved these changes
Sep 9, 2026
sixer1182
disabled auto-merge
September 9, 2026 08:21
The unzer-bank-transfer (PIS / FlexiPay Direct) payment method has been retired. PAPI's PISController is @hidden and POST /v1/types/pis is being removed; the checkout frontends were retired under CC-4027. Add a class-level @deprecated docblock to PIS so merchants see the warning in their IDE and static analysis instead of a runtime failure. Deprecation only - nothing is removed. Removal belongs in the next major release, the way CC-3628 handled Sofort and Giropay. Mirrors the Giropay deprecation exactly: the annotation lives on the class only, and no other reference site is modified. Note: this does not affect the separate openbanking-pis payment method (UnzerSDK\Resources\PaymentTypes\OpenbankingPis), which remains supported despite now carrying the "Unzer Bank Transfer" marketing name in PAPI. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Deletes test/integration/PaymentTypes/PISTest.php. The tests exercised POST /v1/types/pis against the live sandbox, an endpoint PAPI is removing, so the coverage cannot hold once the endpoint is gone. Note this deviates from CC-4064 as originally written, which forbade removing any test and required a diff with no test-case deletions. Removal was requested explicitly by the ticket reporter; the ticket has been updated to record the override. The PIS rows in test/unit/Services/ResourceServiceTest.php are kept - that is a shared file covering many payment types, and those cases assert the id-string to class mapping that ResourceService still performs. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
sixer1182
force-pushed
the
CC-4064/deprecate-pis
branch
from
September 9, 2026 08:22
d901785 to
1624202
Compare
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.
What
PIS(Unzer Bank Transfer / FlexiPay Direct) payment type as deprecated.Resolves CC-4064.
Important
This PR deliberately deviates from CC-4064 as originally written. The ticket forbade removing any test and required a diff with no test-case deletions. The reporter explicitly requested the test removal afterwards, and the ticket has been updated to record the override. Reviewers checking against the original acceptance criteria should read that ticket comment first.
Why
unzer-bank-transfer(PIS) has been retired. PAPI'sPISControlleris@HiddenandPOST /v1/types/pisis being removed; the checkout frontends were retired under CC-4027. Until now the SDK offered the type as if it were supported, so a merchant calling it got a runtime failure with no warning from their tooling. A@deprecatedannotation surfaces that in every IDE and static analyser instead.The integration tests exercised
POST /v1/types/pisagainst the live sandbox. That coverage cannot survive the endpoint's removal, which is why it goes now rather than being left to fail.Changes
UnzerSDK\Resources\PaymentTypes\PIS(src/Resources/PaymentTypes/PIS.php)@deprecateddocblock added, mirroringGiropay.phptest/integration/PaymentTypes/PISTest.php2 files changed, 1 insertion(+), 81 deletions(-)The deleted class contained
pisShouldBeCreatableAndFetchable,pisShouldBeAbleToChargeandpisShouldNotBeAuthorizable— all integration tests requiring live sandbox credentials.References kept, and why
grep -rn --include='*.php' -w 'PIS' src/ examples/ test/still returns the hits below. Nothing else was removed: thePISclass itself, its id-string constant and theResourceServicemapping all stay, so existingpisresources continue to deserialise exactly as before. Full removal belongs in the next major release, the way CC-3628 handled Sofort and Giropay.src/Constants/IdStrings.php:47—public const PIS = 'pis';GIROPAYhere "no more and no less".GIROPAY(line 28) carries no annotation, so per that instruction the constant is untouched. Still needed to deserialise existingpisresources.src/Constants/IdStrings.php:91—self::PISin the arrayself::GIROPAY(line 73) is likewise bare. Removing it would break type resolution for existing resources.src/Services/ResourceService.php:45,947-948— import +switchcasepisresources still deserialise — the "a deprecated call must still do what it does today" requirement. MatchesGiropayat lines 31/906.examples/index.php:370— menu labelGiropayat line 149 is unannotated.test/unit/Services/ResourceServiceTest.php:44,1422,1517ResourceServicestill performs, and they are pure unit tests needing no sandbox. Deleting them would leave live mapping code untested.Verified that no
OpenbankingPisfile is in the change set —openbanking-pisis a separate, still-supported payment method that confusingly now carries the "Unzer Bank Transfer" marketing name in PAPI.Static analysis
The ticket anticipated an analyser flagging the SDK's own use of the deprecated class and asked for a suppression or baseline entry. Neither is needed: this repo has no PHPStan or Psalm and no baseline file. The only static tooling is
friendsofphp/php-cs-fixer(a formatter — it does not evaluate@deprecatedannotations) plus Codacy.phpunit.xmlsetsconvertDeprecationsToExceptions="true", but that applies to PHP runtime deprecation notices; a@deprecateddocblock is inert at runtime. The pre-existing Giropay deprecation confirms this — it has never tripped the suite.Verification
CI unit tests passed on PHP 8.1 – 8.5 on the first commit.
Note:
php-cs-fixerreports 88 fixable files across the repo, all pre-existing onmainand none touched here — out of scope. Thesecurity-scan / Checkmarx Onecheck fails on a pre-existing broken action pin (Unable to resolve action checkmarx/ast-github-action@2.3.33); it dies before scanning any code and fails identically onmain.Integration tests were not run — they require live API credentials.
Not done, on purpose
PISclass,IdStrings::PIS, theResourceServicecase and the example entry all remain — deprecation, not removal.OpenbankingPisand its tests/fixtures untouched.