title: Error handling for custom stripe checkout
body: <p>I am working on custom stripe integration(gateway).If i do payment using credit/debit card i am getting successfull json response with token id from this url <a href="https://api.stripe.com/v1/tokens" rel="nofollow noreferrer">https://api.stripe.com/v1/tokens</a>. but for invalid cvc i am not getting any error response.i checked in network from this url <a href="https://api.stripe.com/v1/tokens" rel="nofollow noreferrer">https://api.stripe.com/v1/tokens</a> i am getting error response. but in program i dont know where to get this response. pls help me i am stuck here.</p>
  
  <p>here is my code</p>
  
  <pre><code>var handler = StripeCheckout.configure({
    key: 'pk_test_mXJ6f6GEBqPLjz3GfgDjZ8ig',
    image: 'https://stripe.com/img/documentation/checkout/marketplace.png',
    locale: 'auto',
    token: function(token) {
      // You can access the token ID with `token.id`.
      // Get the token ID to your server-side code for use.
    }
  });
  
  document.getElementById('customButton').addEventListener('click', function(e) {
    // Open Checkout with further options:
    handler.open({
      name: 'Demo Site',
      description: '2 widgets',
      amount: 2000
    });
    e.preventDefault();
  });
  
  // Close Checkout on page navigation:
  window.addEventListener('popstate', function() {
    handler.close();
  });
  </code></pre>