Skip to content

Add configurable single booking support for SEPA Direct Debits (Sammellastschrift)#561

Merged
nemiah merged 1 commit into
nemiah:masterfrom
mamisch-digital:feature/single-booking-direct-debit
May 23, 2026
Merged

Add configurable single booking support for SEPA Direct Debits (Sammellastschrift)#561
nemiah merged 1 commit into
nemiah:masterfrom
mamisch-digital:feature/single-booking-direct-debit

Conversation

@timrasche
Copy link
Copy Markdown
Contributor

This adds the ability to request individual bookings (einzelbuchungGewuenscht) for batch SEPA Direct Debits, matching the existing functionality already available in SendSEPATransfer.

Previously, einzelbuchungGewuenscht was hardcoded to false in SendSEPADirectDebit, meaning batch direct debits always appeared as a single aggregated entry on the bank statement — regardless of the caller's intent.

Changes:

  • Added $singleBookingRequested property to SendSEPADirectDebit
  • Added setSingleBookingRequested(bool): self setter method (consistent with SendSEPATransfer API)
  • einzelbuchungGewuenscht now uses the configurable value instead of hardcoded false
  • Updated __serialize() / __unserialize() to include the new property

Usage:

$action = SendSEPADirectDebit::create($account, $painXml);
$action->setSingleBookingRequested(true);

The bank-side parameter einzelbuchungErlaubt is still respected — the flag is only sent when the bank advertises support for it.

@timrasche timrasche force-pushed the feature/single-booking-direct-debit branch from 2bf3004 to 429e90b Compare May 20, 2026 10:15
* @param bool $singleBookingRequested If true, each transaction appears separately on the statement.
* @return $this
*/
public function setSingleBookingRequested(bool $singleBookingRequested): self
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Now that PHP8 supports named arguments, have you considered using a create() parameter rather than adding a new setter? I believe this would be the only case in this library so far where a setter is used on an action.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, I initially considered that as well, but then decided against it because I adopted the approach from SEPATransfer, as I didn't want to have two different logics for the two similar cases. I just adapted it from SEPATransfer. Therefore, we should either switch both cases to named arguments, or leave it as it is.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ah you're right, I overlooked that we have a setter there already, and even for exactly the same kind of property.

@nemiah
Copy link
Copy Markdown
Owner

nemiah commented May 23, 2026

Great! Merging…

@nemiah nemiah merged commit 4800d6a into nemiah:master May 23, 2026
6 checks passed
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.

3 participants