title: Submit form after creating stripe token
body: <p>Unable to submit form using jquery with stripe.js plugin. I want to submit form after creating stripe token. Jquery validation is working good. It showing an error message in console "object is not a function" , i am able to create token.</p>
  
  <pre><code>    &lt;?php
      if(count($_REQUEST)&gt;4)
      {
          print_r($_REQUEST);
          exit;
      }
      ?&gt;
      &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;
      &lt;html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"&gt;
  
      &lt;head&gt;
          &lt;title&gt;untitled&lt;/title&gt;
          &lt;meta http-equiv="content-type" content="text/html;charset=utf-8" /&gt;
          &lt;meta name="generator" content="Geany 0.21" /&gt;
      &lt;/head&gt;
  
      &lt;body&gt;
          &lt;script type="text/javascript" src="https://js.stripe.com/v2/"&gt;&lt;/script&gt;
              &lt;script src="http://jqueryvalidation.org/files/lib/jquery.js"&gt;&lt;/script&gt;
          &lt;script src="http://jqueryvalidation.org/files/dist/jquery.validate.js"&gt;&lt;/script&gt;
  
      &lt;!-- ///////////////////////////////////////////////////////////////////////////////// --&gt;
         &lt;!-- CONTACT FORM --&gt;
         &lt;div class="col-lg-6"&gt;
         &lt;h1&gt;CONTACT&lt;/h1&gt;
  
               &lt;h3 class="service_h3"&gt;Say Hello! Ask something?&lt;/h3&gt;               
  
      &lt;form class="cmxform" id="signupForm" method="post" action=""&gt;
              &lt;fieldset&gt;
                  &lt;legend&gt;Validating a complete form&lt;/legend&gt;
                  &lt;p&gt;
                      &lt;label for="firstname"&gt;Firstname&lt;/label&gt;
                      &lt;input id="firstname" name="firstname" type="text"&gt;
                  &lt;/p&gt;
                  &lt;p&gt;
                      &lt;label for="lastname"&gt;Lastname&lt;/label&gt;
                      &lt;input id="lastname" name="lastname" type="text"&gt;
                  &lt;/p&gt;
                  &lt;p&gt;
                      &lt;label for="username"&gt;Username&lt;/label&gt;
                      &lt;input id="username" name="username" type="text"&gt;
                  &lt;/p&gt;
  
  
               &lt;fieldset&gt;
                &lt;div class="cardform"&gt;
                &lt;span class="payment-errors"&gt;&lt;/span&gt;
                &lt;div class="field"&gt;
                   &lt;label&gt;Card Number&lt;/label&gt;
                   &lt;input type="text" size="20" autocomplete="off" class="input card-number" value="4242424242424242"&gt;
                &lt;/div&gt;              
                &lt;div class="field small"&gt;
                    &lt;label&gt;CVC&lt;/label&gt;
                    &lt;input type="text" size="4" autocomplete="off" class="input card-cvc" value="424"&gt;
                &lt;/div&gt;
                &lt;div class="field medium"&gt;
                    &lt;label&gt;Expiration (MM/YYYY)&lt;/label&gt;
                    &lt;input type="text" class="input card-expiry-month" size="2" placeholder="MM" value="05"&gt;
  
                    &lt;input type="text" class="input card-expiry-year" size="4" placeholder="YYYY" value="2018"&gt;
                &lt;/div&gt;
                &lt;/div&gt;
                  &lt;/fieldset&gt;
  
                  &lt;p&gt;
                      &lt;input class="btn" type="submit" name="submit" id="submit" value="Submit"/&gt;
                  &lt;/p&gt;
              &lt;/fieldset&gt;
          &lt;/form&gt;
               &lt;/div&gt;
      &lt;/body&gt;
  
      &lt;/html&gt;
      &lt;script&gt;
  
  
          Stripe.setPublishableKey("pk_test_q8JKhn0ydXmENnxCnJxxV7xC");
  
          function stripeResponseHandler(status, response) {
            var $form = $('#signupForm');
  
            if (response.error) {
              // Show the errors on the form
              $form.find('.payment-errors').text(response.error.message);
              $form.find('#submit').prop('disabled', false);
            } else {
              // response contains id and card, which contains additional card details
              var token = response.id;
              // Insert the token into the form so it gets submitted to the server
              $form.append($('&lt;input type="hidden" name="stripeToken" /&gt;').val(token));
              // and submit
              $form.get(0).submit();
            }
          };
  
          $().ready(function() {
          $("#signupForm").validate({
                  rules: {
                      firstname: "required",
                      lastname: "required",
                      username: {
                          required: true,
                          minlength: 2
                      }
                  },
                  messages: {
                      firstname: "Please enter your firstname",
                      lastname: "Please enter your lastname",
                      username: {
                          required: "Please enter a username",
                          minlength: "Your username must consist of at least 2 characters"
                      }
              },  
              submitHandler: function(form) {
  
                      Stripe.createToken({
                          number: $('.card-number').val(),
                          cvc: $('.card-cvc').val(),
                          exp_month: $('.card-expiry-month').val(),
                          exp_year: $('.card-expiry-year').val()
                      }, stripeResponseHandler);
                      return false; // submit from callback
                  }
  
              });
  
          });
          &lt;/script&gt;
  </code></pre>