I am building a custom payment processor integration with SBPay.me for my SimplyBook.me account (company login: illuminall).
I am receiving the POST callback correctly and can see all the fields including the signature. However, I cannot reproduce the correct HMAC SHA256 signature on my end to verify the request.
I have tried two approaches:
- Stripping the signature field from the raw URL-encoded POST body and computing HMAC SHA256 of the remainder using my Secret key
- Parsing all fields except signature into an array, sorting alphabetically, rebuilding as a query string, and computing HMAC SHA256 of that
Neither approach produces a signature that matches the one SBPay.me sends.
Could you please tell me exactly:
- What string is used as the input to the HMAC SHA256 function when generating the signature?
- Is the input the raw URL-encoded POST body, a decoded string, a JSON string, or something else?
- Are any fields excluded from the signature besides the signature field itself?
- Is the Secret key used as-is, or does it need to be decoded first?
Many thanks,
Mick