Skip to content

Use the requested execution date for transfers and omit an empty creditor BIC - #14

Draft
Cosnavel wants to merge 1 commit into
nemiah:masterfrom
Cosnavel:fix/transfer-execution-date-and-empty-bic
Draft

Cosnavel wants to merge 1 commit into
nemiah:masterfrom
Cosnavel:fix/transfer-execution-date-and-empty-bic

Conversation

@Cosnavel

Copy link
Copy Markdown

Problem

  1. SEPATransfer::addCreditor() groups the creditors by their reqestedExecutionDate, but toXML() always wrote the literal 1999-01-01 (the FinTS marker for "execute now"). A scheduled transfer (Terminüberweisung, HKCSE/HKCME over FinTS) was therefore impossible, and the date the bundled test passes (P1D) was silently ignored. The pain.001.001.09 branch additionally compared against the wrong string ('001.001.09') and produced an invalid <addChild> element.
  2. SEPACreditor::XMLTransfer() always wrote <CdtrAgt><FinInstnId><BIC/> even when no BIC was given, which banks reject; CdtrAgt is optional since IBAN-only.

Both of our applications override toXML() in a subclass for exactly these two reasons (Volksbank/Atruvia and Sparkasse via nemiah/php-fints).

Change

  • Write the group's date when it lies in the future; dates up to today keep emitting 1999-01-01, so immediate transfers over FinTS (HKCCS/HKCCM) behave exactly as before.
  • pain.001.001.09 emits <ReqdExctnDt><Dt>…</Dt></ReqdExctnDt>.
  • Omit CdtrAgt when the BIC is empty (spaces stripped like in XMLDirectDebit()).

Verified by generating pain.001.001.03 documents for tomorrow / today / an empty BIC and for pain.001.001.09.

Note on authorship

Developed with AI assistance (Cursor) and reviewed by the submitting human; the vouching statement per nemiah/phpFinTS#586 will be added by the author once the review is complete.

…itor BIC

SEPATransfer::addCreditor() groups the creditors by their reqestedExecutionDate, but
toXML() always wrote the literal 1999-01-01 (the FinTS marker for "execute now"), so
a scheduled transfer was impossible and the date given in the test was ignored. Write
the group's date when it lies in the future; dates up to today keep emitting
1999-01-01 so immediate transfers over FinTS (HKCCS/HKCCM) behave as before. The
pain.001.001.09 branch compared against the wrong string and produced an invalid
<addChild> element; it now emits <ReqdExctnDt><Dt>...</Dt></ReqdExctnDt>.

SEPACreditor::XMLTransfer() always wrote <CdtrAgt><FinInstnId><BIC/> even when no BIC
was given, which banks reject. CdtrAgt is optional since IBAN-only, so omit it when
the BIC is empty (spaces are stripped like in XMLDirectDebit()).
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