Skip to content

Fix TypeError when reading the minimal SEPA direct debit lead time - #580

Open
renky wants to merge 1 commit into
nemiah:masterfrom
renky:fix/minimale-vorlaufzeit-nullable
Open

Fix TypeError when reading the minimal SEPA direct debit lead time#580
renky wants to merge 1 commit into
nemiah:masterfrom
renky:fix/minimale-vorlaufzeit-nullable

Conversation

@renky

@renky renky commented Aug 20, 2026

Copy link
Copy Markdown

MinimaleVorlaufzeitSEPALastschrift::create() accepts the two coded fields as ?int, but the properties they are assigned to are typed non-nullable int. Every caller that omits them therefore raises

TypeError: Cannot assign null to property
MinimaleVorlaufzeitSEPALastschrift::$unterstuetzteSEPALastschriftartenCodiert
of type int

Three call sites inside the library do exactly that:

  • ParameterTerminierteSEPAEinzellastschriftEinreichenV1::getMinimalLeadTime()
  • ParameterTerminierteSEPAFirmenEinzellastschriftEinreichenV1::getMinimalLeadTime()
  • MinimaleVorlaufzeitSEPALastschrift::parseCodedB2B()

So the lead time cannot be read for HIDSES/HIDMES/HIBSES/HIBMES in version 1 at all, nor for B2B in version 2. Postbank offers all four of those segments only in version 1 — its own response in the Postbank integration test fixtures reproduces the error. Version 1 does not transmit the two codes (it states the lead time per sequence type instead), and the B2B coded format has no field for the direct debit type, so null is the accurate value in both cases.

Both properties are made nullable, matching the signature of create(). Neither is read anywhere in the library or its samples, so nothing downstream changes.

MinimaleVorlaufzeitSEPALastschrift::create() accepts the two coded fields as
?int, but the properties they are assigned to are typed non-nullable int. Every
caller that omits them therefore raises

    TypeError: Cannot assign null to property
    MinimaleVorlaufzeitSEPALastschrift::$unterstuetzteSEPALastschriftartenCodiert
    of type int

Three call sites inside the library do exactly that:

- ParameterTerminierteSEPAEinzellastschriftEinreichenV1::getMinimalLeadTime()
- ParameterTerminierteSEPAFirmenEinzellastschriftEinreichenV1::getMinimalLeadTime()
- MinimaleVorlaufzeitSEPALastschrift::parseCodedB2B()

So the lead time cannot be read for HIDSES/HIDMES/HIBSES/HIBMES in version 1 at
all, nor for B2B in version 2. Postbank offers all four of those segments only
in version 1 — its own response in the Postbank integration test fixtures
reproduces the error. Version 1 does not transmit the two codes (it states the
lead time per sequence type instead), and the B2B coded format has no field for
the direct debit type, so null is the accurate value in both cases.

Both properties are made nullable, matching the signature of create(). Neither
is read anywhere in the library or its samples, so nothing downstream changes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant