<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Wehbook post request header hash not always matching in Integration and Testing</title>
    <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Wehbook-post-request-header-hash-not-always-matching/m-p/62843#M37090</link>
    <description>&lt;P&gt;Hi. I cannot explain the behavior you are seeing, but am on the Authorize.net Webhooks development team, and will talk to my colleagues about this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A couple of questions to get context on your situation:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Are you able to say how often the hash matches, and how often it does not? (rough percentages)&lt;/P&gt;&lt;P&gt;Are you now just starting to use webhooks in production (and observing the hash match failure) or have you previously been using webhooks without observing this problem?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks, I will update you as soon as I can.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;BobQ&lt;/P&gt;</description>
    <pubDate>Thu, 26 Apr 2018 01:06:47 GMT</pubDate>
    <dc:creator>bobq</dc:creator>
    <dc:date>2018-04-26T01:06:47Z</dc:date>
    <item>
      <title>Wehbook post request header hash not always matching</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Wehbook-post-request-header-hash-not-always-matching/m-p/62826#M37073</link>
      <description>&lt;P&gt;Upon receiving the webhook post request we hash the request body using HMAC-SHA12 and our signature key (to binary) and then compare&amp;nbsp;the result with the X-ANET header hash sent.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sometimes it matches, sometimes it does not. This only happens with production credentials, not sandbox.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What could be&amp;nbsp;causing&amp;nbsp;this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 25 Apr 2018 13:58:48 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Wehbook-post-request-header-hash-not-always-matching/m-p/62826#M37073</guid>
      <dc:creator>naivysr_2018Dev</dc:creator>
      <dc:date>2018-04-25T13:58:48Z</dc:date>
    </item>
    <item>
      <title>Re: Wehbook post request header hash not always matching</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Wehbook-post-request-header-hash-not-always-matching/m-p/62843#M37090</link>
      <description>&lt;P&gt;Hi. I cannot explain the behavior you are seeing, but am on the Authorize.net Webhooks development team, and will talk to my colleagues about this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A couple of questions to get context on your situation:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Are you able to say how often the hash matches, and how often it does not? (rough percentages)&lt;/P&gt;&lt;P&gt;Are you now just starting to use webhooks in production (and observing the hash match failure) or have you previously been using webhooks without observing this problem?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks, I will update you as soon as I can.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;BobQ&lt;/P&gt;</description>
      <pubDate>Thu, 26 Apr 2018 01:06:47 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Wehbook-post-request-header-hash-not-always-matching/m-p/62843#M37090</guid>
      <dc:creator>bobq</dc:creator>
      <dc:date>2018-04-26T01:06:47Z</dc:date>
    </item>
    <item>
      <title>Re: Wehbook post request header hash not always matching</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Wehbook-post-request-header-hash-not-always-matching/m-p/62878#M37111</link>
      <description>&lt;P&gt;Hi! thanks for taking the time to answer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We found the issue and it's silly simple.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Auth.net hashes the payload amounts&amp;nbsp;with&amp;nbsp;decimal zeroes, e.x: 0.30.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Our api is written in&amp;nbsp;NodeJS&amp;nbsp;and the default body parser we had in place was parsing the request body to a JSON&amp;nbsp;and removing&amp;nbsp;decimal zeroes, which&amp;nbsp;don't not exist in js, and that was what we were hashing which was causing the mismatch. So payloads with amounts like 1.00, 1.10 were not being hashed correctly on our end.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, the fix for this was setting the body parser to take the body as a string which preserves the amount as we need&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&amp;nbsp;&lt;SPAN&gt;BobQ, hope this helps other&amp;nbsp;developers&amp;nbsp;facing the same problem.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Apr 2018 17:24:45 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Wehbook-post-request-header-hash-not-always-matching/m-p/62878#M37111</guid>
      <dc:creator>naivysr_2018Dev</dc:creator>
      <dc:date>2018-04-30T17:24:45Z</dc:date>
    </item>
  </channel>
</rss>

