From 7608c8de311e2c281b4e44632309377217411947 Mon Sep 17 00:00:00 2001 From: Tim Rasche Date: Tue, 19 May 2026 14:28:03 +0200 Subject: [PATCH 1/3] =?UTF-8?q?Fix:=20Add=20missing=20control=20sum=20(Sum?= =?UTF-8?q?menfeld)=20to=20HKCCM/HKCME=20for=20SEPA=20batch=20transfers=20?= =?UTF-8?q?When=20initiating=20a=20SEPA=20batch=20transfer=20(Sammel=C3=BC?= =?UTF-8?q?berweisung)=20using=20the=20HKCCM=20or=20HKCME=20segments,=20so?= =?UTF-8?q?me=20strict=20bank=20servers=20(e.g.,=20Atruvia=20data=20center?= =?UTF-8?q?s=20for=20Volksbanken/Raiffeisenbanken)=20reject=20the=20reques?= =?UTF-8?q?t=20with=20the=20error:=20HIRMS:5:2:3+9010::Summenfeld=20nicht?= =?UTF-8?q?=20vorhanden.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit While some banks parse the total sum directly from the PAIN XML payload, others strictly enforce the HBCI specification, which requires the control sum to be explicitly declared in the segment parameters (e.g., HKCCM:3:1+...). Currently, SendSEPATransfer leaves this field empty. Changes made: Updated SendSEPATransfer::createRequest() to extract the from the provided PAIN XML (GrpHdr). Initialized the $segment->summenfeld property using \Fhp\Segment\Common\Btg::create(). --- src/Action/SendSEPATransfer.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Action/SendSEPATransfer.php b/src/Action/SendSEPATransfer.php index 1dff6fab..e0f84ae2 100644 --- a/src/Action/SendSEPATransfer.php +++ b/src/Action/SendSEPATransfer.php @@ -165,6 +165,13 @@ protected function createRequest(BPD $bpd, ?UPD $upd) // For batch transfers: set einzelbuchungGewuenscht if bank allows it if ($numberOfTransactions > 1) { + + // Fix for strict banks (e.g. Atruvia): Extract the batch control sum from the PAIN XML and set it on the segment + if (isset($xmlAsObject->CstmrCdtTrfInitn->GrpHdr->CtrlSum)) { + $ctrlSum = (float) $xmlAsObject->CstmrCdtTrfInitn->GrpHdr->CtrlSum; + $segment->summenfeld = \Fhp\Segment\Common\Btg::create($ctrlSum ?: 0); + } + $paramSegmentId = $hasReqdExDates ? 'HICMES' : 'HICCMS'; $paramSegment = $bpd->getLatestSupportedParameters($paramSegmentId); if ($paramSegment !== null && $paramSegment->getParameter()->einzelbuchungErlaubt) { From 9bc6c643be968fc244b4f6e6641b0775a55696ca Mon Sep 17 00:00:00 2001 From: Tim Rasche Date: Tue, 19 May 2026 14:34:23 +0200 Subject: [PATCH 2/3] style: fix cs-fixer warning (no_extra_blank_lines) Removed an extra blank line to comply with the project's coding standards. --- src/Action/SendSEPATransfer.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Action/SendSEPATransfer.php b/src/Action/SendSEPATransfer.php index e0f84ae2..8b39a119 100644 --- a/src/Action/SendSEPATransfer.php +++ b/src/Action/SendSEPATransfer.php @@ -165,7 +165,6 @@ protected function createRequest(BPD $bpd, ?UPD $upd) // For batch transfers: set einzelbuchungGewuenscht if bank allows it if ($numberOfTransactions > 1) { - // Fix for strict banks (e.g. Atruvia): Extract the batch control sum from the PAIN XML and set it on the segment if (isset($xmlAsObject->CstmrCdtTrfInitn->GrpHdr->CtrlSum)) { $ctrlSum = (float) $xmlAsObject->CstmrCdtTrfInitn->GrpHdr->CtrlSum; From fa5d647046763118c05cbd33832e7eb722eb573d Mon Sep 17 00:00:00 2001 From: Tim Rasche Date: Thu, 21 May 2026 06:56:29 +0200 Subject: [PATCH 3/3] Fix CtrlSum assignment for batch control sum --- src/Action/SendSEPATransfer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Action/SendSEPATransfer.php b/src/Action/SendSEPATransfer.php index 8b39a119..3d8606c1 100644 --- a/src/Action/SendSEPATransfer.php +++ b/src/Action/SendSEPATransfer.php @@ -168,7 +168,7 @@ protected function createRequest(BPD $bpd, ?UPD $upd) // Fix for strict banks (e.g. Atruvia): Extract the batch control sum from the PAIN XML and set it on the segment if (isset($xmlAsObject->CstmrCdtTrfInitn->GrpHdr->CtrlSum)) { $ctrlSum = (float) $xmlAsObject->CstmrCdtTrfInitn->GrpHdr->CtrlSum; - $segment->summenfeld = \Fhp\Segment\Common\Btg::create($ctrlSum ?: 0); + $segment->summenfeld = \Fhp\Segment\Common\Btg::create($ctrlSum); } $paramSegmentId = $hasReqdExDates ? 'HICMES' : 'HICCMS';