From 127ad8fd786b622aacd7ceed95c90ad93c3b954a Mon Sep 17 00:00:00 2001 From: Ivan Stasiuk Date: Mon, 26 Feb 2024 10:44:16 +0000 Subject: [PATCH] fix: mac --- src/Client.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Client.php b/src/Client.php index 87ca976..c4b2c8c 100644 --- a/src/Client.php +++ b/src/Client.php @@ -81,10 +81,11 @@ public function send(TransactionInterface $transaction): ?Response ->withUserID($this->config->getUsername()) ->withPassword($this->config->getPassword()); + $mac = hash('sha512', "{$transaction->getReference()}{$transaction->getRecipientBankAccount()}{$transaction->getAmount()}", false); + return $this->soap->sendRequest(new SendRequest( (new UploadData()) ->withClientInfo($user) - ->withUseSingleDebitMultipleCredit(true) ->withTransactionRequest( (new ArrayOfTransaction())->withTransaction((new Transaction()) ->withAmount((string)$transaction->getAmount()) @@ -95,6 +96,8 @@ public function send(TransactionInterface $transaction): ?Response ->withTransactionRef($transaction->getReference()) ->withPaymentDueDate($transaction->getDueDate()->format('Y-m-d'))) ) + ->withMAC($mac) + ->withUseSingleDebitMultipleCredit(false) ))->getSendRequestResult(); } }