Skip to content

[CC-3628] Remove deprecated code - #231

Draft
Ryouzanpaku wants to merge 21 commits into
mainfrom
CC-3628/remove-deprecated-payment-methods
Draft

Ryouzanpaku wants to merge 21 commits into
mainfrom
CC-3628/remove-deprecated-payment-methods

Conversation

@Ryouzanpaku

@Ryouzanpaku Ryouzanpaku commented May 11, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Major release cleanup for PHP SDK 5.0.0: removes deprecated payment types, deprecated API methods and the examples folder, and switches baskets to the v3 endpoint.

CC-3628 Remove Sofort and Giropay

  • Removes the Sofort and Giropay payment types, their IdStrings constants and factory cases.

CC-3663 Remove deprecated code

  • Removes the payment types PIS, Invoice, InvoiceSecured (incl. the invoice-guaranteed and invoice-factoring ids), SepaDirectDebitSecured and InstallmentSecured (plus fetchInstallmentPlans() and the InstalmentPlans resource). Replacement for invoice: PaylaterInvoice.
  • Removes Unzer::authorize(), charge(), chargeAuthorization(), chargePayment() (use performAuthorization(), performCharge(), performChargeOnPayment()) and Unzer::setKey().
  • Removes HttpService::send(); ResourceService uses sendRequest(ApiRequest). The request uses the resource's API version when no version is passed.
  • Removes the v1 Basket / BasketItem fields, Payment::getCancellation(), CanRecur::activateRecurring(), Paypage\Urls::$favicon.
  • Basket v3 by default: Basket creates baskets on /v3/baskets (bearer auth). Baskets with a pre-v3 id (no UUID) are read and updated on /v2/baskets. No more v1 fallback in fetchBasket(). V3\Basket is kept as an alias.
  • The v2 basket/basket item properties moved from the V2\BasketProperties / V2\BasketItemProperties traits into Basket and BasketItem (review comment).

CC-777 Remove examples folder

Tests

  • Integration tests use the replacement methods; tests for removed types are removed (incl. ShipmentTest, which only used InvoiceSecured).
  • New unit tests for the basket API version selection.

Bug fixes

  • expiresAt serialization in V2/Paypage::expose() (ISO-8601 with milliseconds and Z).

Documentation

CHANGELOG entry for 5.0.0. Upgrade guide: unzercorp/connectivity-docs#651 (needs an update: remove Invoice and InvoiceSecured, add PIS, basket v3).

Resolves CC-3628 | CC-777 | CC-3663

🤖 Generated with Claude Code

https://claude.ai/code/session_015dBvhivgsdFR9LnoQcg3o1

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@Ryouzanpaku
Ryouzanpaku requested a review from a team as a code owner May 11, 2026 10:19
… examples, and deprecated API methods

- Remove examples folder (CC-777)
- Remove InstallmentSecured, InvoiceSecured, Invoice, SepaDirectDebitSecured, HirePurchase payment types and all related source/test files (CC-3628)
- Remove all deprecated methods: authorize(), charge(), chargeAuthorization(), chargePayment(), fetchInstallmentPlans(), setKey() (CC-3663)
- Replace HttpService::send() with sendRequest(ApiRequest) in ResourceService
- Update BasketItem and Basket to V2 API only (remove V1 properties)
- Fix test helpers to use performAuthorization() and performCharge()

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@Ryouzanpaku Ryouzanpaku changed the title [CC-3628] Remove Sofort and Giropay payment types [CC-3628] Remove deprecated code May 11, 2026
Ryouzanpaku and others added 9 commits May 11, 2026 15:20
…ate source delegation

- Update CanAuthorize::authorize() and CanDirectCharge::charge() traits to delegate to performAuthorization()/performCharge() instead of removed methods
- Update Payment::charge() and Authorization::charge() to delegate to performChargeOnPayment()
- Add Charge import to Authorization.php
- Fix ChargeAfterAuthorizationTest to use performChargeOnPayment()
- Update CanAuthorizeTest and CanDirectChargeTest to mock new API methods with data providers
- Fix AuthorizationTest::chargeShouldCallChargeAuthorizationOnUnzerObject to mock performChargeOnPayment

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…calls from PaymentCancelTest

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…n BancontactTest

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…place chargeAuthorization/authorize

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- EPS, Ideal, PIS, SepaDirectDebit, Wechatpay: replace authorize() with performAuthorization()
- Przelewy24: replace authorize() with performAuthorization(), setKey() with useLegacyKey()
- RecurringPaymentTest: remove tests for deleted activateRecurring() trait method and SepaDirectDebitSecured type; replace card.activateRecurring() with unzer.activateRecurringPayment()

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…tor parameter

The V1 constructor had (orderId, amountTotal, currencyCode, basketItems).
The V2 migration dropped amountTotal, shifting currencyCode to arg 2 and
breaking integration tests that still passed an amount there.

Restore the parameter as ?float $totalValueGross mapped to setTotalValueGross(),
and update the two call sites that were passing a string in that position.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ameter

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ys are now valid

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Replace authorize()/charge() with performAuthorization()/performCharge() in integration tests
- Remove tests for deleted payment types: InvoiceSecured, SepaDirectDebitSecured
- Delete ShipmentTest (depended on InvoiceSecured) and V1 BasketTest (V2/V3 coverage exists)
- Fix Paypage expiresAt format to ISO-8601 with ms+UTC Z suffix (Y-m-d\TH:i:s.v\Z)
- Remove duplicate constructor from V3/Basket (identical to parent)
- Drop setNote() from createBasket() helper — sandbox does not return note on GET
- Fix Basket unit test: getNote() default is null, not empty string
- Add UnzerOne key setup to OpenBankingTest and WeroTest
- Fix PaypageV2Test: resources is not null after create; assert metadataId instead

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@Ryouzanpaku
Ryouzanpaku force-pushed the CC-3628/remove-deprecated-payment-methods branch from 536ef80 to e07cd38 Compare May 12, 2026 09:02

@sixer1182 sixer1182 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check my comments and the failed integration tests.

Comment thread src/Constants/IdStrings.php Resolved
@Ryouzanpaku
Ryouzanpaku marked this pull request as draft June 25, 2026 08:49
sixer1182 and others added 8 commits October 28, 2026 08:49
Resolve conflicts: drop PISTest (removed on main), keep the replacement
methods in BasketV2/V3 tests with main's amounts, take main's Paypage
resource assertions, keep main's performCharge/performSca null tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015dBvhivgsdFR9LnoQcg3o1
Invoice (ivc) stays in 5.0.0: restore the class, IdStrings::INVOICE, the
type factory case, InvoiceTest and the invoice cancel tests.
PIS (pis) is removed in 5.0.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015dBvhivgsdFR9LnoQcg3o1
- Basket creates baskets on /v3/baskets (bearer auth). Baskets with an id
  from before v3 (no UUID) are read and updated on /v2/baskets.
- fetchBasket no longer falls back to the v1 endpoint.
- V3\Basket is kept as an alias of Basket.
- Move the v2 basket and basket item properties from the V2 traits into
  Basket and BasketItem (review comment on PR #231).
- Fix ResourceService::send() to use the resource's API version when no
  version is passed (it used Unzer::API_VERSION for every resource).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015dBvhivgsdFR9LnoQcg3o1
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015dBvhivgsdFR9LnoQcg3o1
…actoring)

Invoice secured is deprecated but still available in PAPI, so it stays in
5.0.0: restore the class, IdStrings constants, type factory cases and
tests. CanDirectChargeWithCustomer::charge() now uses performCharge(),
because Unzer::charge() is removed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015dBvhivgsdFR9LnoQcg3o1
Resolve the CHANGELOG conflict: the PHP 8.1 removal from main goes into
the 5.0.0 section.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015dBvhivgsdFR9LnoQcg3o1
Both types were deprecated in favour of PaylaterInvoice. Removes the
classes, the IdStrings constants ivc, ivs, ivg, ivf, their factory cases
in ResourceService and the related unit and integration tests
(incl. ShipmentTest, which only used InvoiceSecured). CHANGELOG updated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015dBvhgEZKYXe2biVeR1fTL
…remove-deprecated-payment-methods

# Conflicts:
#	src/Interfaces/PaymentServiceInterface.php
#	src/Resources/PaymentTypes/Sofort.php
#	src/Services/PaymentService.php
#	src/Unzer.php
#	test/unit/Services/PaymentServiceTest.php

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>

This branch has not been deployed

No deployments
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.

3 participants