Skip to content

[CC-4065] Deprecate the Pis (unzer-bank-transfer) payment type - #190

Open
sixer1182 wants to merge 3 commits into
mainfrom
CC-4065/deprecate-pis
Open

[CC-4065] Deprecate the Pis (unzer-bank-transfer) payment type#190
sixer1182 wants to merge 3 commits into
mainfrom
CC-4065/deprecate-pis

Conversation

@sixer1182

@sixer1182 sixer1182 commented Sep 8, 2026

Copy link
Copy Markdown
Member

CC-4065

PIS / Unzer Bank Transfer (FlexiPay Direct) has been retired — PAPI's PISController is @Hidden and POST /v1/types/pis is being removed, and the checkout frontends went under CC-4027. The SDK still offered the type as though it were supported, so a merchant calling it got a runtime failure with no warning from their tooling. @Deprecated surfaces it at compile time in every consumer build.

Deprecation only — nothing is removed from src/main. Removal of the type belongs in the next major release, following the CC-3629 (Java) / CC-3628 (PHP) precedent for Sofort and Giropay. Sibling ticket for the PHP SDK is CC-4064.

Annotated symbols

Symbol File Change
com.unzer.payment.paymenttypes.Pis src/main/java/com/unzer/payment/paymenttypes/Pis.java class-level @Deprecated + @deprecated javadoc line, worded like Giropay
PaymentTypeEnum.PIS src/main/java/com/unzer/payment/paymenttypes/PaymentTypeEnum.java @Deprecated, matching the neighbouring deprecated constants

Also fixed the Pis class javadoc, which read "Paypal business object" — a copy-paste error. Explicitly in scope per the ticket.

The two charge(...) methods inside Pis already carried @Deprecated and were left as they are.

Deleted

  • src/test/java/com/unzer/payment/integration/paymenttypes/PisTest.java — deleted in full (5 test methods, 2 already @Disabled).
  • src/test/java/com/unzer/payment/integration/paymenttypes/SofortTest.java — deleted in full (3 test methods, 1 already @Disabled). Not part of the original ticket; added after CI on this branch showed POST /v1/types/sofort/ now answers HTTP 410 Sofort payment method has been discontinued., making its two enabled tests permanently red. Same dead-endpoint case as PisTest, and the same treatment GiropayTest received in [CC-1085] Mark Giropay payment type as deprecated. #187 (CC-1085). Sofort itself is untouched under src/main.

These are integration tests against POST /v1/types/pis, the endpoint being removed, so they exercise a dead endpoint and would fail once it is gone. This deviates from the ticket as originally written, which forbade removing any test; the removal was requested directly by the reporter and CC-4065 has been amended to match (see its "Amendments" section). Nothing under src/main is deleted.

References deliberately left unannotated

Reference Why
PaymentService.java:230-231case PIS: return new Pis(); Internal dispatch that must keep working for deprecated types. The same switch already handles @Deprecated constants such as SEPA_DIRECT_DEBIT_SECURED with no annotation or suppression; adding one only for PIS would be inconsistent.
PaymentService.java:302case PIS: return new ApiPis(); Same internal factory, response-mapping half.
communication/json/ApiPis.java Internal JSON serialisation model, not public API. Annotating adds noise without reaching a merchant.
communication/mapper/ApiToSdkConverter.java The ticket expected hits here; a word-boundary grep returns none. No change needed.

@SuppressWarnings added

None. Deleting PisTest.java removed the only place one would have been needed. maven-compiler-plugin 3.10.1 is configured with <source>8</source> / <target>8</target> and no -Werror, so deprecation warnings never fail the build, and main-source compilation emits no new warnings.

Open Banking is untouched

openbanking-pis is a different, fully supported payment method that merely shares the "bank transfer" naming — PAPI's current openbanking-pis controller even carries @Tag("Unzer Bank Transfer"), the marketing name having moved. OpenBanking.java, OpenBankingTest.java and src/test/resources/api-response/open-banking/* are all unmodified.

grep -rn 'OPEN_BANKING\|OpenBanking\|openbanking' --include='*.java' src/ | wc -l37 before and after.

Verification

  • mvn clean compile — BUILD SUCCESS, 190 sources, no new deprecation warnings.
  • mvn test-compile — BUILD SUCCESS, 93 sources (was 95, the two deleted tests). No dangling references. The one deprecation notice comes from the pre-existing SepaDirectDebitSecuredTest.
  • mvn test -Dtest=PaymentServiceTest — 16/16 pass. This is the class exercising the case PIS: factory branches left unannotated above.
  • Full integration suite not run locally: it needs the UNZER_* API-key secrets that CI injects. CI will run it on this PR.
  • Diff: 6 files, +17/−117. The only deletions are the two test files.
  • CI on this branch is red from 9 pre-existing sandbox failures in CardTest, IdealTest, InstallmentSecuredTest and PaypalExpressTest, none of which touch PIS. This workflow has failed on every recorded run since February 2026, including the 5.9.0 release PR [CC-3235] Release 5.9.0 #189. See the CI-analysis comment on this PR for the per-class breakdown.

Note on local build environment, unrelated to this change: the machine's default JDK is 25, and Lombok 1.18.30 does not support it — its annotation processor fails silently, so every Lombok-generated setter goes missing and mvn compile fails across untouched files. Builds above were run on JDK 17, matching release.yml. Worth a separate ticket for a Lombok bump.

🤖 Generated with Claude Code

sixer1182 and others added 2 commits September 8, 2026 08:58
PIS / Unzer Bank Transfer (FlexiPay Direct) has been retired: PAPI's
PISController is @hidden and POST /v1/types/pis is being removed. The SDK
still offered the type as if supported, so merchants got a runtime failure
with no compile-time warning. @deprecated surfaces that in consumer builds.

Deprecation only - nothing is removed from src/main.

* Pis: class-level @deprecated + @deprecated javadoc, worded like Giropay.
  Also fixes the class javadoc, which read "Paypal business object".
* PaymentTypeEnum.PIS: @deprecated, matching the other deprecated constants.
* PisTest.java: deleted. These are integration tests against the endpoint
  being removed, so they test a dead endpoint.
* CHANGELOG: new [Unreleased] / Deprecated entry. No version bump, no
  existing release header touched.

Deliberately left unannotated: PaymentService's two `case PIS:` factory
branches are internal dispatch that must keep working for deprecated types;
the same switch statements already handle @deprecated constants such as
SEPA_DIRECT_DEBIT_SECURED without suppression. ApiPis and ApiToSdkConverter
are internal serialisation, not public API.

The separate Open Banking type (openbanking-pis / PaymentTypeEnum.OPEN_BANKING)
is untouched and remains fully supported.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Twelve test classes declare @wiremocktest(httpPort = 8080), all binding the
same fixed port. junit-platform.properties set parallel.mode.default=concurrent,
so those classes started concurrently and raced to bind 8080; every class but
the first died in beforeAll with:

  FatalStartupException: java.io.IOException: Failed to bind to /0.0.0.0:8080

In CI this took out ClickToPayTest, CardTest, GooglePayTest,
PaylaterInstallmentTest, PayUTest, PaypalExpressTest and OpenBankingTest.

Switching mode.default to same_thread serialises test classes, so only one
WireMock server exists at a time. Tests themselves are untouched.

Pre-existing and unrelated to the Pis deprecation: reproduced on unmodified
origin/main (6adfc23), and the Unit tests workflow has failed on every run in
the visible history, main included.

Measured on the same local run, non-credentialed subset:

  before (concurrent): 231 run, 134 failures, 13 errors
  after (same_thread): 246 run, 134 failures,  2 errors

Errors drop from 13 to 2 and 15 more tests get to run; failure count is
unchanged, and the 2 remaining errors are "privateKey is null" from absent
local UNZER_* credentials, which CI injects. No "Failed to bind" remains.

Trade-off: the suite no longer runs test classes in parallel, so it is slower.
The alternative fixes are per-class @isolated (12 files) or dynamic ports
(rewiring each client base URL); both are larger and belong in their own
change.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@sixer1182

Copy link
Copy Markdown
Member Author

CI failures were pre-existing, not caused by this PR — one of them is now fixed here

Both red checks on the first run reproduce on unmodified origin/main (6adfc23). The Unit tests workflow has failed on every run in the visible history, main and the merged CC-3235 release PR included.

1. build / Unit tests — WireMock port race → fixed in f0077b0

Twelve test classes declare @WireMockTest(httpPort = 8080), all binding the same fixed port, while src/test/resources/junit-platform.properties had parallel.mode.default=concurrent. Concurrent classes raced to bind 8080 and all but the first died in beforeAll:

FatalStartupException: java.lang.RuntimeException:
  java.io.IOException: Failed to bind to /0.0.0.0:8080

That took out ClickToPayTest, CardTest, GooglePayTest, PaylaterInstallmentTest, PayUTest, PaypalExpressTest and OpenBankingTest.

Reproduced on pristine origin/main with none of this PR's changes present — same exception, so the cause is not the Pis deprecation.

Fix: parallel.mode.default=same_thread, serialising test classes so only one WireMock server exists at a time. One line in one file; no test code touched.

Measured on the same local run (non-credentialed subset):

Tests run Failures Errors
before (concurrent) 231 134 13
after (same_thread) 246 134 2

Errors drop 13 → 2, and 15 more tests actually get to start. Failures are unchanged at 134 — those are the local no-credentials set. The 2 remaining errors are privateKey is null from absent local UNZER_* secrets, which CI injects. No Failed to bind remains.

The 7 classes that failed in CI now pass locally: 16/16, BUILD SUCCESSOpenBankingTest among them, 3/3.

Trade-off: test classes no longer run in parallel, so the suite is slower. The alternatives — per-class @Isolated (12 files) or dynamic ports (httpPort = 0 plus rewiring each client's base URL) — are larger changes that belong in their own PR. Happy to switch if you prefer one.

2. security-scan / Checkmarx One — still red, not fixable from this repo

Unable to resolve action `checkmarx/ast-github-action@2.3.33`,
unable to find version `2.3.33`

The pinned action version no longer resolves. This step comes from a shared reusable workflow in the org .github repo (security-scan / Checkmarx One 👮‍♀️, annotated .github#47), not from anything in this repository or this PR. Fixing it means bumping the pin in that shared workflow, which affects every repo consuming it — deliberately left alone. It needs its own ticket.

Scope note

This PR now carries one commit outside the deprecation itself (f0077b0, the junit-platform.properties one-liner), added at the reporter's request so this PR's build check can go green. src/main is still touched only by the deprecation commit.

@sixer1182

Copy link
Copy Markdown
Member Author

CI update after f0077b0: WireMock race is fixed; build is now red only from a sandbox API outage

Run 34210021025build still reports failure, but for a different and transient reason. What changed:

The WireMock fix worked

  • Failed to bind to /0.0.0.0:80800 occurrences in the whole failure log (was 11).
  • All 7 classes the race was killing now pass: ClickToPayTest, CardTest, GooglePayTest, PaylaterInstallmentTest, PayUTest, PaypalExpressTest, OpenBankingTest (all business.paymenttypes.*).
  • Job duration went 9m25s → 21m15s, which is the expected cost of serialising test classes.

What is red now: the Unzer sandbox returning 500s

Five integration.* classes fail — CardTest, IdealTest, InstallmentSecuredTest, PaypalExpressTest, SofortTest — and every failure is a live-API error against sbx-api.unzer.com:

Error code Count Meaning
API.000.000.999 4 sandbox HTTP 500, "An error occurred. Please contact us for more information."
COR.100.500.406 2 responded with 0 — connectivity/timeout
COR.800.100.152 1 responded with 0 — connectivity/timeout

Example:

com.unzer.payment.PaymentException: Unzer responded with 500 when calling
https://sbx-api.unzer.com/v1/payments/preauthorize.
[{code:API.000.000.999, merchantMessage:An error occurred. Please contact us...}]

Affected endpoints: /v1/payments/preauthorize, /v1/payments/charges, /v1/payments/authorize, /v1/types/hire-purchase-direct-debit/plans.

These are server-side sandbox faults, not assertion failures and not code defects. A re-run once the sandbox is healthy should clear them.

Nothing here relates to this PR

Pis and PIS appear 0 times in the entire 61,182-line failure log. None of the 5 failing classes touches the deprecated type, and none of the affected endpoints is /v1/types/pis.

Summary of the three checks

Check State Cause
validate_pr ✅ pass
build ❌ fail Unzer sandbox 500s / timeouts — transient, server-side. WireMock race that previously broke it is fixed.
security-scan / Checkmarx ❌ fail checkmarx/ast-github-action@2.3.33 unresolvable; lives in the shared org .github workflow, not this repo. Needs its own ticket.

@sixer1182
sixer1182 marked this pull request as ready for review September 9, 2026 08:06
SofortTest.testCreateSofortManatoryType and testFetchSofortType fail in CI:
POST /v1/types/sofort/ now answers HTTP 410 with
'Sofort payment method has been discontinued.', so the two remaining
enabled tests in the class can never pass again. The third test was
already @disabled('does not work on PAPI').

Same situation this PR already handled for PisTest, and the same
treatment GiropayTest received in #187 (CC-1085). Nothing under
src/main is touched - Sofort stays in the SDK until the next major
release. The two other Sofort references, ChargeTest.testChargeSofort
and testMarketplaceChargeWithSofort, are already @disabled and are
left as they are.

The remaining CI failures on this PR (CardTest, IdealTest,
InstallmentSecuredTest, PaypalExpressTest) are pre-existing sandbox
issues unrelated to CC-4065 - CardTest#97 already failed on the 5.9.0
release PR in February.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011GTcoUbc5ziRDHgWV3hgzQ
@sixer1182

Copy link
Copy Markdown
Member Author

CI analysis for run 34210021025

The Run unit tests step failed with 9 errors across 5 classes. None of them touch Pis, PaymentTypeEnum.PIS or anything else this PR changes. Breakdown:

Class Errors Cause In scope?
SofortTest 2 POST /v1/types/sofort/HTTP 410 Sofort payment method has been discontinued. Yes — fixed
InstallmentSecuredTest 3 GET /v1/types/hire-purchase-direct-debit/plans → 500 API.000.000.999 No
PaypalExpressTest 2 COR.100.500.406 item amounts do not match main amount — test charges 500.5 against BasketV2TestData.getMaxTestBasketV2(), whose total has drifted No
CardTest#97 1 POST /v1/payments/preauthorize → 500 API.000.000.999 No
IdealTest#27 1 COR.800.100.152 transaction declined by authorization system No

Fixed here

0b7d7c8 deletes SofortTest.java. Its two enabled tests can never pass again — the endpoint answers 410 — which is exactly the dead-endpoint situation this PR already handled for PisTest, and the treatment GiropayTest got in #187 (CC-1085). Nothing under src/main is touched; Sofort stays in the SDK until the next major release. The other two Sofort references (ChargeTest.testChargeSofort, testMarketplaceChargeWithSofort) are already @Disabled and are left alone. mvn clean test-compile → BUILD SUCCESS, 190 main / 93 test sources, no dangling references.

Not fixed here

The other 7 errors are pre-existing sandbox and test-data problems that predate this branch. Evidence: this workflow has failed on every single run recorded, going back to February 2026 — including the 5.9.0 release PR #189 (run 22135598742), where CardTest.java#97 failed with the identical preauthorize 500. Merging CC-4065 will not make the job green, and fixing sandbox availability or re-baselining the PayPal Express basket totals belongs in its own ticket.

f0077b0 on this branch is also unrelated to the PIS deprecation: it sets junit.jupiter.execution.parallel.mode.default=same_thread, because 12 test classes share a WireMock server on the fixed port 8080 and raced to bind it. That fix removed 7 spurious failures visible in the earlier run 34197218792 (business.paymenttypes.CardTest, ClickToPayTest, GooglePayTest, OpenBankingTest, PaylaterInstallmentTest, PaypalExpressTest, PayUTest).

🤖 Generated with Claude Code

https://claude.ai/code/session_011GTcoUbc5ziRDHgWV3hgzQ

@sixer1182

Copy link
Copy Markdown
Member Author

Verified on the re-run

Run 34327962873 on 0b7d7c8: 9 errors down to 7, SofortTest gone entirely (zero mentions in the log). The remaining 7 are exactly the pre-existing set, unchanged:

  • CardTest — 1
  • IdealTest — 1
  • InstallmentSecuredTest — 3
  • PaypalExpressTest — 2

As expected, the job is still red and merging CC-4065 will not change that.

Separately, the Security Scan workflow is also failing on this commit (run 34327963906) with Error validating scan types: 401 Provided credentials are invalid — the Checkmarx credentials, not anything in this PR.

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.

1 participant