diff --git a/src/Action/SendSEPATransfer.php b/src/Action/SendSEPATransfer.php index 1dff6fab..3d8606c1 100644 --- a/src/Action/SendSEPATransfer.php +++ b/src/Action/SendSEPATransfer.php @@ -165,6 +165,12 @@ 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); + } + $paramSegmentId = $hasReqdExDates ? 'HICMES' : 'HICCMS'; $paramSegment = $bpd->getLatestSupportedParameters($paramSegmentId); if ($paramSegment !== null && $paramSegment->getParameter()->einzelbuchungErlaubt) {