Skip to content

[CC-4064] Deprecate the PIS (Unzer Bank Transfer) payment type and remove its integration tests. - #238

Merged
sixer1182 merged 2 commits into
mainfrom
CC-4064/deprecate-pis
Sep 9, 2026
Merged

[CC-4064] Deprecate the PIS (Unzer Bank Transfer) payment type and remove its integration tests.#238
sixer1182 merged 2 commits into
mainfrom
CC-4064/deprecate-pis

Conversation

@sixer1182

@sixer1182 sixer1182 commented Sep 8, 2026

Copy link
Copy Markdown
Member

What

  1. Marks the PIS (Unzer Bank Transfer / FlexiPay Direct) payment type as deprecated.
  2. Removes the PIS integration test class.

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's PISController is @Hidden and POST /v1/types/pis is 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 @deprecated annotation surfaces that in every IDE and static analyser instead.

The integration tests exercised POST /v1/types/pis against the live sandbox. That coverage cannot survive the endpoint's removal, which is why it goes now rather than being left to fail.

Changes

Symbol / file Change
UnzerSDK\Resources\PaymentTypes\PIS (src/Resources/PaymentTypes/PIS.php) class-level @deprecated docblock added, mirroring Giropay.php
test/integration/PaymentTypes/PISTest.php deleted (81 lines, 3 test methods)

2 files changed, 1 insertion(+), 81 deletions(-)

The deleted class contained pisShouldBeCreatableAndFetchable, pisShouldBeAbleToCharge and pisShouldNotBeAuthorizable — 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: the PIS class itself, its id-string constant and the ResourceService mapping all stay, so existing pis resources continue to deserialise exactly as before. Full removal belongs in the next major release, the way CC-3628 handled Sofort and Giropay.

Reference Why kept
src/Constants/IdStrings.php:47public const PIS = 'pis'; The ticket said to match GIROPAY here "no more and no less". GIROPAY (line 28) carries no annotation, so per that instruction the constant is untouched. Still needed to deserialise existing pis resources.
src/Constants/IdStrings.php:91self::PIS in the array Same; self::GIROPAY (line 73) is likewise bare. Removing it would break type resolution for existing resources.
src/Services/ResourceService.php:45,947-948 — import + switch case Internal wiring, not merchant-callable API. Must keep working so already-created pis resources still deserialise — the "a deprecated call must still do what it does today" requirement. Matches Giropay at lines 31/906.
examples/index.php:370 — menu label Static HTML label in the example index, not an API surface. Giropay at line 149 is unannotated.
test/unit/Services/ResourceServiceTest.php:44,1422,1517 Kept on purpose. Shared unit-test file covering many payment types, not a PIS-specific test class. These cases assert the id-string→class mapping that ResourceService still performs, and they are pure unit tests needing no sandbox. Deleting them would leave live mapping code untested.

Verified that no OpenbankingPis file is in the change set — openbanking-pis is 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 @deprecated annotations) plus Codacy.

phpunit.xml sets convertDeprecationsToExceptions="true", but that applies to PHP runtime deprecation notices; a @deprecated docblock is inert at runtime. The pre-existing Giropay deprecation confirms this — it has never tripped the suite.

Verification

$ ./vendor/bin/phpunit --no-coverage test/unit
OK (737 tests, 2559 assertions)          # unchanged; deleted tests were integration-only

$ ./vendor/bin/php-cs-fixer fix --dry-run --path-mode=intersection src/Resources/PaymentTypes/PIS.php
Found 0 of 1 files that can be fixed      # exit 0

$ grep -rn 'openbanking' --include='*.php' src/ test/ | wc -l
1        # identical before and after

$ grep -rn 'PISTest' --exclude-dir=vendor --exclude-dir=.git .
(no output)                               # no dangling references

$ git diff --name-only origin/main | grep -i openbank
(no output)

CI unit tests passed on PHP 8.1 – 8.5 on the first commit.

Note: php-cs-fixer reports 88 fixable files across the repo, all pre-existing on main and none touched here — out of scope. The security-scan / Checkmarx One check 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 on main.

Integration tests were not run — they require live API credentials.

Not done, on purpose

  • The PIS class, IdStrings::PIS, the ResourceService case and the example entry all remain — deprecation, not removal.
  • OpenbankingPis and its tests/fixtures untouched.
  • No behaviour change: a deprecated call does exactly what it did before.
  • No version bump and no changelog release header edit — the release is handled separately.

@sixer1182
sixer1182 requested a review from a team as a code owner September 8, 2026 06:55
@sixer1182 sixer1182 changed the title [CC-4064] Mark PIS (Unzer Bank Transfer) payment type as deprecated. [CC-4064] Deprecate the PIS (Unzer Bank Transfer) payment type and remove its integration tests. Sep 8, 2026
@sixer1182
sixer1182 enabled auto-merge September 9, 2026 08:05
@sixer1182
sixer1182 disabled auto-merge September 9, 2026 08:21
sixer1182 and others added 2 commits September 9, 2026 10:22
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
sixer1182 force-pushed the CC-4064/deprecate-pis branch from d901785 to 1624202 Compare September 9, 2026 08:22
@sixer1182
sixer1182 merged commit 1e9c47a into main Sep 9, 2026
7 of 8 checks passed
@sixer1182
sixer1182 deleted the CC-4064/deprecate-pis branch September 9, 2026 08:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants