lib/stripe/handlers/index.js
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);
      });

    }
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);
      });

    }
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 ) ; } ) ; }
stripe sent us a webhook, so respond appropriately
stripe sent us a webhook so respond appropriately