code: function (req, res) {
  
        var event = req.stripeEvent;
        var data = event.data.object;
  
        // takes care of unexpected event types
        var transactionMethod = stripeTransactions[event.type] || stripeTransactions.unhandled;
  
        transactionMethod(req, data, function (err){
          if ( !err ) {
            return res.send(200);
          }
          console.log('stripe webhook error');
          console.log(event.type);
          console.log(err.stack);
          res.send(500, err);
        });
  
      }
docs: stripe sent us a webhook, so respond appropriately