X-PaySway-Signature
header.
By replicating this same process with your secret, you can confirm that the webhook request is authentic and has not been tampered with.
Obtain your secret
secret
field that is base64-encoded. You must decode this string before using it to generate an HMAC signature.Extract the timestamp and signature
X-PaySway-Signature
header in each webhook request. This header contains two key-value pairs separated by commas:t
: The UNIX timestamp of when the message was signedv1
: The actual signature in hexadecimal formatt
and v1
values. Ignore any other values that may appear in the header.Reconstruct the signing payload
Generate the expected signature
Verify the signature and timestamp
expectedSignature
with the v1
value from the X-PaySway-Signature
header:t
to implement replay attack protection by setting a maximum acceptable age for requests (e.g., 5 minutes).