Skip to content

[CC-3628] Remove deprecated code#231

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

[CC-3628] Remove deprecated code#231
Ryouzanpaku wants to merge 12 commits into
mainfrom
CC-3628/remove-deprecated-payment-methods

Conversation

@Ryouzanpaku
Copy link
Copy Markdown
Contributor

@Ryouzanpaku Ryouzanpaku commented May 11, 2026

Summary

This PR removes all deprecated payment types, deprecated API methods, and the examples folder as part of a major release cleanup.

CC-3628 Remove deprecated payment types:

  • Fully removes Sofort, Giropay, InstallmentSecured, InvoiceSecured, Invoice, SepaDirectDebitSecured, and HirePurchase payment type classes
  • Removes associated constants from IdStrings and factory switch cases in ResourceService

CC-777 Remove examples folder:

  • Deletes the entire examples/ directory (was previously maintained separately)

CC-3663 Remove all deprecated API methods:

  • Removes Unzer::authorize(), charge(), chargeAuthorization(), chargePayment() — replaced by performAuthorization(), performCharge(), performChargeOnPayment()
  • Removes fetchInstallmentPlans() and InstalmentPlans resource class
  • Removes setKey() from Unzer (validation inlined into constructor)
  • Removes HttpService::send()ResourceService now uses sendRequest(ApiRequest) exclusively
  • Removes V1 Basket and BasketItem properties (amountTotalGross, amountTotalDiscount, amountTotalVat, amountPerUnit, etc.)
  • Removes activateRecurring() alias in Paypal; CanRecur trait simplified
  • Updates CanAuthorize::authorize() and CanDirectCharge::charge() traits to delegate to new methods

Integration test fixes:

  • Replaces all deprecated authorize() / charge() / chargeAuthorization() / setKey() calls across integration test suite
  • Removes test classes for deleted payment types: ShipmentTest (InvoiceSecured), V1 BasketTest
  • Removes test cases and data provider entries for InvoiceSecured, SepaDirectDebitSecured, InstallmentSecured
  • Fixes PaypageV2Test assertions to match actual API response (resources not null after create)
  • Adds UnzerOne key setup to OpenBankingTest and WeroTest

Bug fixes:

  • Fixes expiresAt serialization in V2/Paypage::expose() — API requires ISO-8601 with milliseconds and UTC Z suffix (Y-m-d\TH:i:s.v\Z), not DATE_ATOM
  • Removes duplicate constructor from V3/Basket (identical to parent)
  • Fixes Basket::getNote() unit test — default is null, not empty string

Test plan

  • All 631 unit tests pass
  • Integration tests updated and verified against sandbox environment

Documentation

Upgrade guide for v5.0.0: draft PR | preview

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

🤖 Generated with Claude Code

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
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