- hash_hmac: documentation ( source)
- base64_encode: documentation ( source)
- json_encode: documentation ( source)
<?php
$merchant = 'VB-TIER1-NON-US';
$secretKey = '04ea9fb0-1c90-4b32-929a-0767126820ea';
echo base64_encode(
hash_hmac(
'sha512',
$merchant . \json_encode(['order_id' => 1000001067]) . $merchant,
$secretKey
)
);