- hash_hmac: documentation ( source)
- base64_encode: documentation ( source)
- json_encode: documentation ( source)
<?php
$merchant = 'VB-USA';
$secretKey = '6c5e27ca-fe94-4e2d-a940-ac7ba4fedd49';
$data = \json_encode(['order_id' => 1000001067]);
echo base64_encode(
hash_hmac('sha512',
$merchant . $data . $merchant,
$secretKey)
);