Skip to content

Commit

Permalink
fix: mac
Browse files Browse the repository at this point in the history
  • Loading branch information
brokeyourbike committed Feb 26, 2024
1 parent 6fc00ad commit 127ad8f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand All @@ -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();
}
}

0 comments on commit 127ad8f

Please sign in to comment.