14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
# File 'lib/coinbase_commerce_client/webhooks.rb', line 14
def self.(payload, , secret)
unless [payload, , secret].all?
raise CoinbaseCommerceClient::Errors::WebhookInvalidPayload.new("Missing, payload or signature", , http_body: payload)
end
expected_sig = compute_signature(payload, secret)
unless secure_compare(expected_sig, )
raise CoinbaseCommerceClient::Errors::SignatureVerificationError.new(
"No signatures found matching the expected signature for payload",
, http_body: payload
)
end
true
end
|