1

我正在阅读 gocardless 入门指南,但是当我尝试设置 webhook(沙盒模式)时,我没有得到正确的值。

代码从https://developer.gocardless.com/getting-started/api/staying-up-to-date-with-webhooks/#building-a-webhook-handler复制粘贴

看起来像这样

computed_signature = OpenSSL::HMAC.hexdigest(OpenSSL::Digest.new('sha256'),
                                             secret,
                                             request.raw_post)

provided_signature = request.headers['Webhook-Signature']

Rack::Utils.secure_compare(provided_signature, computed_signature)

# => false

我错过了什么?谢谢你的帮助

4

0 回答 0