import CryptoJS from 'crypto-js'
import hmacSHA256 from 'crypto-js/hmac-sha256'
export default (req, res) => {
const signature = req.headers['x-commercelayer-signature']
const hash = hmacSHA256(JSON.stringify(req.body), process.env.SHARED_SECRET)
const encode = hash.toString(CryptoJS.enc.Base64)
if (req.method === 'POST' && signature === encode) {