Stripe.js - Cannot read property 'stripeToken' of undefined
<p>I'm trying to integrate stripe.js into a web app I'm working on, however I'm being thrown the following error:</p>

<pre><code>Cannot read property 'stripeToken' of undefined
</code></pre>

<p>The clientside is setting the hidden input of the token but for some reason, the server can't pull it this:</p>

<pre><code>var stripeToken = request.body.stripeToken;
</code></pre>

<p>Any ides as to why this might be?</p>

<p>Client-side JS</p>

<pre><code>jQuery(function($) {
  $('#payment-form').submit(function(event) {
    var $form = $(this);

    // Disable the submit button to prevent repeated clicks
    $form.find('button').prop('disabled', true);

    Stripe.card.createToken({
      number: $('.card-number').val(),
      cvc: $('.card-cvc').val(),
      exp_month: $('.card-expiry-month').val(),
      exp_year: $('.card-expiry-year').val()
    }, stripeResponseHandler);

    // Prevent the form from submitting with the default action
    return false;
  });
});

function stripeResponseHandler(status, response) {
  // Grab the form:
  var $form = $('#payment-form');
  if (response.error) { // Problem!

    // Show the errors on the form:
    $form.find('.payment-errors').text(response.error.message);
    $form.find('.submit').prop('disabled', false); // Re-enable submission

  } else { // Token was created!

    // Get the token ID:
    var token = response.id;

    // Insert the token ID into the form so it gets submitted to the server:
    $form.append($('&lt;input type="hidden" name="stripeToken"&gt;').val(token));

    // Submit the form:
    $form.get(0).submit();
  }
};

jQuery(function($) {
  $('[data-numeric]').payment('restrictNumeric');
  $('.cc-number').payment('formatCardNumber');
  $('.cc-exp').payment('formatCardExpiry');
  $('.cc-cvc').payment('formatCardCVC');
  $.fn.toggleInputError = function(erred) {
    this.parent('.form-group').toggleClass('has-error', erred);
    return this;
  };
  $('form').submit(function(e) {
    e.preventDefault();
    var cardType = $.payment.cardType($('.cc-number').val());
    $('.cc-number').toggleInputError(!$.payment.validateCardNumber($('.cc-number').val()));
    $('.cc-exp').toggleInputError(!$.payment.validateCardExpiry($('.cc-exp').payment('cardExpiryVal')));
    $('.cc-cvc').toggleInputError(!$.payment.validateCardCVC($('.cc-cvc').val(), cardType));
    $('.cc-brand').text(cardType);
    $('.validation').removeClass('text-danger text-success');
    $('.validation').addClass($('.has-error').length ? 'text-danger' : 'text-success');
  });
});
</code></pre>

<p>Server-side JS</p>

<pre><code>app.post('/', function(req, res) {
  var stripeToken = request.body.stripeToken;

  var charge = stripe.charges.create({
    amount: 1000, // amount in cents, again
    currency: "usd",
    source: stripeToken,
    description: "Example charge"
  }, function(err, charge) {
    if (err &amp;&amp; err.type === 'StripeCardError') {
      // The card has been declined
    }
  });
});
</code></pre>

<p>Form (jade)</p>

<pre><code> form(novalidate='', autocomplete='on', method='POST' id="payment-form")
  .form-group
    label.control-label(for='cc-number')
      | Card number formatting 
      small.text-muted
        | [
        span.cc-brand
        | ]
    input#cc-number.input-lg.form-control.cc-number(type='tel', autocomplete='cc-number', placeholder='•••• •••• •••• ••••', required='')
  .form-group
    label.control-label(for='cc-exp') Card expiry formatting
    input#cc-exp.input-lg.form-control.cc-exp(type='tel', autocomplete='cc-exp', placeholder='•• / ••', required='')
  .form-group
    label.control-label(for='cc-cvc') Card CVC formatting
    input#cc-cvc.input-lg.form-control.cc-cvc(type='tel', autocomplete='off', placeholder='•••', required='')
  button.btn.btn-lg.btn-primary(type='submit' class='submit') Submit
  h2.validation
</code></pre>