18 lines
395 B
Go
18 lines
395 B
Go
|
|
//go:build integration
|
||
|
|
// +build integration
|
||
|
|
|
||
|
|
package integration
|
||
|
|
|
||
|
|
import (
|
||
|
|
"crypto/hmac"
|
||
|
|
"crypto/sha512"
|
||
|
|
"encoding/hex"
|
||
|
|
)
|
||
|
|
|
||
|
|
// computeWebhookSignature computes HMAC-SHA512 signature for Hyperswitch webhook payload.
|
||
|
|
func computeWebhookSignature(payload []byte, secret string) string {
|
||
|
|
mac := hmac.New(sha512.New, []byte(secret))
|
||
|
|
mac.Write(payload)
|
||
|
|
return hex.EncodeToString(mac.Sum(nil))
|
||
|
|
}
|