From 4d2864a465c5fbba4cd01dd46a926f347bc2a79b Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 3 Feb 2026 08:16:48 +0000 Subject: [PATCH] Move transfer receipt after segment reconstruction The ackClosure callback now receives the transaction with the order data already reconstructed (decoded, decrypted, decompressed), allowing the callback to inspect the actual order data before deciding whether to acknowledge the transfer. https://claude.ai/code/session_01Fgz6ncXaoswt84uuC3QUCU --- src/EbicsClient.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/EbicsClient.php b/src/EbicsClient.php index 40d6497..2fe8be7 100644 --- a/src/EbicsClient.php +++ b/src/EbicsClient.php @@ -422,14 +422,6 @@ private function downloadTransaction(callable $requestClosure, ?callable $ackClo $lastSegment = $segment; } - if (null !== $ackClosure) { - $acknowledged = call_user_func_array($ackClosure, [$transaction]); - } else { - $acknowledged = true; - } - - $this->transferReceipt($transaction, $acknowledged); - $orderDataEncoded = $this->bufferFactory->create(); foreach ($transaction->getSegments() as $segment) { $orderDataEncoded->write($segment->getOrderData()); @@ -460,6 +452,14 @@ private function downloadTransaction(callable $requestClosure, ?callable $ackClo $transaction->setOrderData($orderData->readContent()); unset($orderData); + if (null !== $ackClosure) { + $acknowledged = call_user_func_array($ackClosure, [$transaction]); + } else { + $acknowledged = true; + } + + $this->transferReceipt($transaction, $acknowledged); + return $transaction; }