The generated signature is not matching the proposed signature from Dwolla
Here is the code snippet for my code:
public function verify_gateway_signature($proposedSignature, $payloadBody)
{
$signature = hash_hmac(‘sha256’, $payloadBody, $this->webhook_secret);
Logger::info('GeneratedSignature: ’ . $signature);
return [‘generated_signature’ => $signature, ‘is_valid’ => $signature == $proposedSignature];
}
And reading the proposed signature from headers:
$request->header(‘X-Request-Signature-SHA-256’);
Hi Brijesh! Would you be able to share your accountID or your Webhook subscription ID?
It is possible that you may have multiple Webhook subscriptions and that you may be comparing the signature of the webhook sent for subscription A with the one you set for subscription B. Again, just a speculation that I thought we’d confirm is not the case before diving deep!
Thanks for getting back. I found the issue and it was due to the escaped characters when converting Dwolla payload to string. I was able to fix it by encoding Dwolla payload to string without escaping “/”.
Unfortunately, I’m unable to view the secret you used to create the subscription on our end. I cross checked with an online HMAC-SHA256 generator tool to check my results, and was unable to create the same hash with the secret you posted. I’d check that the secret is accurate, and the code you’re using to create the SHA256 HMAC hash is creating the hash properly.
Let me know if I can help check anything on my end!