<?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 Verify webhook payload in Integration and Testing</title>
    <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Verify-webhook-payload/m-p/73758#M45729</link>
    <description>&lt;P&gt;I have a webhooks endpoint setup in a node project build using Hapi.js. I am using the crypto module to generate the hash to verify the payload. Everything seems to work fine when I do a test webhook, the hash I generate matches the hash in the headers. However, when I turn on the webhook and subscribe to the '&lt;SPAN&gt;net.authorize.payment.authorization.created' event the hashes don't seem to match. I don't know what I could be doing wrong because the test event works fine, the only difference I can thing of is that the test event is an authCapture instead of an authorization.created. I don't know why that would make a difference, but here is my code.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;const isValidPayload = (request) =&amp;gt; {
  const header = _.get('headers.x-anet-signature', request);
  const payload = JSON.stringify(request.payload);
  const hash = crypto.createHmac('sha512', config.get('authorizenet:signature_key'))
    .update(payload)
    .digest('hex');

  return header === `sha512=${hash.toUpperCase()}`;
};&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;I've been banging my head against a wall with this problem for the last week. If anyone has some insight please let me know. Thanks.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;edit: I should probably mention this is in a sandbox environment as well&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 27 Oct 2020 19:38:34 GMT</pubDate>
    <dc:creator>nbreaux</dc:creator>
    <dc:date>2020-10-27T19:38:34Z</dc:date>
    <item>
      <title>Verify webhook payload</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Verify-webhook-payload/m-p/73758#M45729</link>
      <description>&lt;P&gt;I have a webhooks endpoint setup in a node project build using Hapi.js. I am using the crypto module to generate the hash to verify the payload. Everything seems to work fine when I do a test webhook, the hash I generate matches the hash in the headers. However, when I turn on the webhook and subscribe to the '&lt;SPAN&gt;net.authorize.payment.authorization.created' event the hashes don't seem to match. I don't know what I could be doing wrong because the test event works fine, the only difference I can thing of is that the test event is an authCapture instead of an authorization.created. I don't know why that would make a difference, but here is my code.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;const isValidPayload = (request) =&amp;gt; {
  const header = _.get('headers.x-anet-signature', request);
  const payload = JSON.stringify(request.payload);
  const hash = crypto.createHmac('sha512', config.get('authorizenet:signature_key'))
    .update(payload)
    .digest('hex');

  return header === `sha512=${hash.toUpperCase()}`;
};&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;I've been banging my head against a wall with this problem for the last week. If anyone has some insight please let me know. Thanks.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;edit: I should probably mention this is in a sandbox environment as well&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Oct 2020 19:38:34 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Verify-webhook-payload/m-p/73758#M45729</guid>
      <dc:creator>nbreaux</dc:creator>
      <dc:date>2020-10-27T19:38:34Z</dc:date>
    </item>
    <item>
      <title>Re: Verify webhook payload</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Verify-webhook-payload/m-p/83833#M52867</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hello, did you ever resolve this issue? I am unfortunately at a loss for days with the same problem&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Aug 2022 17:52:36 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Verify-webhook-payload/m-p/83833#M52867</guid>
      <dc:creator>three60sb</dc:creator>
      <dc:date>2022-08-18T17:52:36Z</dc:date>
    </item>
    <item>
      <title>Re: Verify webhook payload</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Verify-webhook-payload/m-p/85035#M53502</link>
      <description>&lt;P&gt;Please response if you ever resolved the above problem&lt;/P&gt;</description>
      <pubDate>Thu, 24 Nov 2022 13:00:51 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Verify-webhook-payload/m-p/85035#M53502</guid>
      <dc:creator>DivyaArun</dc:creator>
      <dc:date>2022-11-24T13:00:51Z</dc:date>
    </item>
  </channel>
</rss>

