Is there any way to create a HmacSHA256 signature of a string in php?
I can't answer due to lack of reputation, but @Melomans way in combination with ZPiDER's answer leads to using only
$hash = hash_hmac('sha256', $string, $secret);
for a correct Datatrans signing