<commit_before>var express = require('express'),
    app = express(),
    PaypalStrategy = require('kaching-paypal'),
    kaching = require('kaching');

app.set('views', __dirname);
app.set('view engine', 'jade');

/**
 * Test account: <EMAIL>
 * Password: <PASSWORD>
 */
kaching.use(new PaypalStrategy({
  'client_id': 'AVNKWRCWeT5AB6KEzKD28qyLwAl5rGi8vt3jtWpZtx--ybYDUjFivZd3EP9-',
  'client_secret': '<KEY>'
}));

app.use(express.logger('dev'));
app.use(express.bodyParser());
app.use(express.methodOverride());
app.use(express.cookieParser());
app.use(express.session({ secret: 'secret' }));
app.use(kaching.initialize());

app.get('/', function(req, res) {
  res.render('index');
});

app.get('/kaching/paypal', function(req, res, next) {
  // Construct payment detail in `req.payment`
  req.payment = {
    // Payment amount, with optional details
    amount:{
      total:'7.47',
      currency:'USD',
      details: {
        shipping: '1.00',
        subtotal: '6.00',
        tax: '0.47'
      }
    },
    // Item list, optional
    item_list: {
      items: [
        { name: 'Product', price: '3', quantity: '2', currency: 'USD' }
      ]
    },
    // Payment transaction description
    description:'Kaching paypal test transaction'
  };
  // Proceed to next step
  next();
}, kaching.create('paypal', {
  // Redirect URL is required for paypal payment.
  redirect_urls: {
    return_url: 'http://localhost:3000/kaching/paypal/return',
    cancel_url: 'http://localhost:3000/kaching/paypal/cancel'
  }
}));

app.get('/session', function(req, res) {
  res.json(req.session);
});

app.listen(3000);<commit_msg>Add passToNext use case to example.<commit_after>var express = require('express'),
    app = express(),
    PaypalStrategy = require('kaching-paypal'),
    kaching = require('kaching');

app.set('views', __dirname);
app.set('view engine', 'jade');

/**
 * Test account: <EMAIL>
 * Password: <PASSWORD>
 */
kaching.use(new PaypalStrategy({
  'client_id': 'AVNKWRCWeT5AB6KEzKD28qyLwAl5rGi8vt3jtWpZtx--ybYDUjFivZd3EP9-',
  'client_secret': '<KEY>'
}));

app.use(express.logger('dev'));
app.use(express.bodyParser());
app.use(express.methodOverride());
app.use(express.cookieParser());
app.use(express.session({ secret: 'secret' }));
app.use(kaching.initialize());

app.get('/', function(req, res) {
  res.render('index');
});

app.get('/kaching/paypal', function(req, res, next) {
  // Construct payment detail in `req.payment`
  req.payment = {
    // Payment amount, with optional details
    amount:{
      total:'7.47',
      currency:'USD',
      details: {
        shipping: '1.00',
        subtotal: '6.00',
        tax: '0.47'
      }
    },
    // Item list, optional
    item_list: {
      items: [
        { name: 'Product', price: '3', quantity: '2', currency: 'USD' }
      ]
    },
    // Payment transaction description
    description:'Kaching paypal test transaction'
  };
  // Proceed to next step
  next();
}, kaching.create('paypal', {
  // Redirect URL is mandatory for paypal payment.
  redirect_urls: {
    return_url: 'http://localhost:3000/kaching/paypal/return',
    cancel_url: 'http://localhost:3000/kaching/paypal/cancel'
  },
  // We have a request handler coming after, so set `passToNext` to true
  passToNext: true
}), function(req, res) {
  console.log(JSON.stringify(req.payment));
});

app.get('/session', function(req, res) {
  res.json(req.session);
});

app.listen(3000);
{'fraction_non_alphanumeric': 0.18134110787172011, 'fraction_numerical': 0.02040816326530612, 'mean_word_length': 3.550397877984085, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2683114', 'n_tokens_mistral': 1215, 'n_tokens_neox': 1178, 'n_words': 231}