Last active
April 17, 2016 23:55
-
-
Save bryceadams/e3be6505ca6e1136c69ac88e7edf455b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * This is the endpoint WC needs to post through a webhook to, | |
| * when a new sale has been made. | |
| */ | |
| app.post('/print', function (req, res) { | |
| var webhookBody = req.body || {}; | |
| var webhookSignature = req.headers['x-wc-webhook-signature']; | |
| console.log('Receiving webhook...'); | |
| if (!webhookBody || !webhookSignature) { | |
| console.log('Access denied - invalid request'); | |
| return res.send('access denied', 'invalid request', null, 403); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment