Webhook test fails

I’m making some tests before pushing crypto payments to my website. I created a route using express (server is https and certificate is signed) but when testing the webhook no calls are sent to my server. The actual code itself within the route doesn’t matter, the issue is simply that nothing is recieved, and the test fails.

server.post('/webhook-coinbase', (req, res) => {
    var sig = req.headers['x-cc-webhook-signature'];
    var webhookSecret = '(mywebhook secret)';
  
    var calculatedSig = crypto.createHmac('sha256', webhookSecret)
                              .update(JSON.stringify(req.body))
                              .digest('hex');
  
    if (calculatedSig === sig) {
        log('verified');
        
    } else {
        log('verification failed');
    }

    res.sendStatus(200);
});

image

Welcome to Developer Forum Community, @Borry !

Can you please replace the header from x-cc-webhook-signature to X-CC-Webhook-Signature . You may also refer to Securing Webhook documentation.

We hope this. Please reply back if you still face any issues.

Thank you and have a good day!

I applied the change, but the error remains, the request isn’t recieved at all from my server. The issue isn’t regarding what’s in the documentation.
I also tried executing the code in the example github repository, testing the webhook with express, yet I face the same issue.

Hey @Borry Thank you for your reply.

To further help you with your concern, we suggest you to open a support ticket here with our team with the following details:

  • Please provide the code snippet of your request body
  • Please provide a screenshot of the error that you are experiencing in the response/result.
  • If you have any more information or screenshot that can demonstrate your concern, feel free to share it with us. Please ensure to send any images or screenshots as attachments, as we’re unable to see images/screenshots when they are inserted in the body of your email and be reminded to omit any personal info.

if i remember correctly, when i used commerce the test options also did not work for me but actual charges processed just fine. I would try running an actual legit charge and see what happens.