-
Notifications
You must be signed in to change notification settings - Fork 95
Description
When a click on Intent to Receive then it always showed me the same like Intent to Received required, not showed 200 OK.
Method for ensuring_security is:
def ensuring_security?
key = 'XERO_WEBHOOK_KEY'
payload = request.body.read
calculated_hmac = Base64.encode64(OpenSSL::HMAC.digest('sha256', key, payload))
begin
if calculated_hmac.strip() == request.headers['x-xero-signature']
true
else
false
end
rescue JSON::ParserError => e
false
end
end
The result is alweays false because the calculated_hmac.strip() is not equal to request.headers['x-xero-signature']. I think if the intent can't be 200 OK so if I will updation in Contacts or Invoices the webhook can not be received. So What should I do?
I want to show a result of 200 OK and after this will get a webhook if updation in invoices and contacts.
Screenshot of which is receiving when click on Intent to Receive:

You can see in the above screenshot that two values can't be equal; first is from calculated_hmac and second from request.headers['x-xero-signature'].
And on webhook config at Xero site here:

So how can I get 200 OK at status and receive invoice status (regarding update any invoice), anyone please reply me ASAP. Thanks!