Skip to content

Commit

Permalink
handle coinbase callback
Browse files Browse the repository at this point in the history
  • Loading branch information
grishick committed Apr 22, 2024
1 parent 68e55f3 commit a6f1cac
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions server/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -400,16 +400,16 @@ APP.post('/api/coinbasecommerce', async (req, res) => {
const sharedSecret = COINBASE_SHARED_SECRET;

// Verify the webhook notification using the shared secret
// const signature = req.headers['x-cc-webhook-signature'];
// const isValid = coinbaseLib.verifyWebhookPayload(signature, req.body, sharedSecret, Sentry);
// if (isValid) {
const signature = req.headers['x-cc-webhook-signature'];
const isValid = coinbaseLib.verifyWebhookPayload(signature, req.body, sharedSecret, Sentry);
if (isValid) {
const DB = CLIENT.db(DBNAME);
coinbaseLib.updateCharge(DB, Sentry, req.body);
res.sendStatus(200);
/*} else {
} else {
Sentry.captureException(new Error('Invalid signature for Coinbase Commerce webhook'));
res.sendStatus(500);
}*/
}
});

/**
Expand Down

0 comments on commit a6f1cac

Please sign in to comment.