title: Can't send email data to Stripe using my virtual terminal
body: <p>I have some Stripe.com virtual Terminal code here:</p>
  
  <p><a href="https://www.reverbstudios.ie/pay/" rel="nofollow">ReverbStudios.ie/Pay</a></p>
  
  <p>I tried adding an email field so the customers email would be passed to Stripe and they'd get a nice email receipt but no email data is being saved at the Stripe end despite payments going through fine.</p>
  
  <p>Here's the code:</p>
  
  <pre><code>&lt;?
  
  // comment this out to allow http:
  if($_SERVER['SERVER_PORT'] == 80){
      header("Location: https://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
      die();
  }
  
  // Test
  $key_publishable    = '';
  $key_secret         = '';
  $note_prefix        = 'Reverb Studios Payment'; //this will be used in the charge's description
  $title              = 'Pay Reverb Studios Design';
  $currency           = 'eur';
  $currency_symbol    = '€';
  $demo_mode          = false;
  
  if(!$key_publishable || !$key_secret) die('Please set stripe API keys');
  
  if($_POST){
      require_once 'stripe-php/lib/Stripe.php';
  
      $note_parts = array();
      if($note_prefix) $note_parts[] = $note_prefix;
      if($_POST['note']) $note_parts[] = $_POST['note'];
  
      $params = array(
          'amount'        =&gt; $_POST['amount'],
          'currency'      =&gt; $currency,
          'card'          =&gt; $_POST['token'],
          //'email'       =&gt; "leon@leonvq.com",
          'email'         =&gt; $_POST['input_email'],
          'description'   =&gt; implode(' - ', $note_parts)
      );
  
      $response = array(
          'success' =&gt; false
      );
  
      try{
          Stripe::setApiKey($key_secret);
          $charge = Stripe_Charge::create($params);
  
          $response['success']    = true;
          $response['id']         = $charge-&gt;id;
          $response['amount']     = number_format($charge-&gt;amount / 100, 2);
          $response['fee']        = number_format($charge-&gt;fee / 100, 2);
          $response['card_type']  = $charge-&gt;card-&gt;type;
          $response['card_last4'] = $charge-&gt;card-&gt;last4;
      }catch (Exception $e) {
          $response['error'] = $e-&gt;getMessage();
      }
  
      echo json_encode($response);
      die();
  }
  
  ?&gt;
  &lt;!DOCTYPE html&gt;
  &lt;html&gt;
      &lt;head&gt;
          &lt;title&gt;&lt;?= $title ?&gt;&lt;/title&gt;
          &lt;link rel="stylesheet" type="text/css" media="screen" href="layout.css?&lt;?= filemtime('layout.css') ?&gt;" /&gt;
          &lt;meta name="description" content="Make a secure Credit Card, Visa payment to Reverb Studios Design."&gt;
          &lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;div id="wrap"&gt;        
              &lt;div id="logo"&gt;
  
                  &lt;a href="../index.php" title="Reverb Studios Design" /&gt;&lt;img src="reverb-logo.jpg" alt="Reverb Studios Design" /&gt;&lt;/a&gt;
  
                  &lt;h2&gt;&lt;?= $title ?&gt;&lt;/h2&gt;
              &lt;/div&gt;            
  
  
              &lt;? if($demo_mode){ ?&gt;
                  &lt;div id="demo_warning"&gt;
                      This is a &lt;b&gt;DEMO&lt;/b&gt;. Please don't enter real payment info. You can use &lt;b&gt;4242424242424242&lt;/b&gt; as a valid card number. &lt;a href="https://stripe.com/docs/testing"&gt;Stripe Testing FAQ&lt;/a&gt;
                  &lt;/div&gt;
              &lt;? } ?&gt;
  
              &lt;form action="" method="POST" id="payment_form"&gt;
  
                  &lt;label&gt;Amount (€ Euros)&lt;/label&gt;
  
                  &lt;div class="form_input"&gt;
                      &lt;input id="input_amount" type="text" placeholder="Ex: 19.99" /&gt;
                  &lt;/div&gt;
  
                  &lt;div class="clear"&gt;&lt;/div&gt;
                  &lt;div id="error_amount" class="error_wrapper"&gt;&lt;/div&gt;
  
  
                  &lt;label&gt;Card Number&lt;/label&gt;
  
                  &lt;div class="form_input"&gt;
                      &lt;input id="input_number" type="text" pattern="[0-9]*"/&gt;
                  &lt;/div&gt;
  
                  &lt;div class="clear"&gt;&lt;/div&gt;
                  &lt;div id="error_number" class="error_wrapper"&gt;&lt;/div&gt;
  
                  &lt;label&gt;Expiration&lt;/label&gt;
  
                  &lt;div class="form_input"&gt;
                      &lt;input id="input_exp_month" type="text" pattern="[0-9]*" placeholder="MM" /&gt;
                      &lt;span&gt; / &lt;/span&gt;
                      &lt;input id="input_exp_year" type="text" pattern="[0-9]*" placeholder="YYYY" /&gt;
                  &lt;/div&gt;
  
                  &lt;div class="clear"&gt;&lt;/div&gt;
                  &lt;div id="error_exp_month" class="error_wrapper"&gt;&lt;/div&gt;
                  &lt;div id="error_exp_year" class="error_wrapper"&gt;&lt;/div&gt;
  
                  &lt;label&gt;CVC&lt;/label&gt;
  
                  &lt;div class="form_input"&gt;
                      &lt;input id="input_cvc" type="text" pattern="[0-9]*" /&gt;
                  &lt;/div&gt;
  
                  &lt;div class="clear"&gt;&lt;/div&gt;
                  &lt;div id="error_cvc" class="error_wrapper"&gt;&lt;/div&gt;
  
  
                  &lt;label&gt;Invoice/Estimate No.&lt;/label&gt;
  
                  &lt;div class="form_input"&gt;
                      &lt;input id="input_note" type="text" placeholder="" /&gt;
                  &lt;/div&gt;
  
                  &lt;label&gt;Email&lt;/label&gt;
  
                  &lt;div class="form_input"&gt;
                      &lt;input name="email" id="input_email" type="text" placeholder="" /&gt;
                  &lt;/div&gt;
  
                  &lt;div class="clear"&gt;&lt;/div&gt;
                  &lt;div id="error_note" class="error_wrapper"&gt;&lt;/div&gt;
  
  
                  &lt;div id="transaction_error"&gt;&lt;/div&gt;
                  &lt;div class="left" id="progress_message"&gt;&lt;/div&gt;
  
                  &lt;div class="right" style="margin-top: 10px;"&gt;
                      &lt;button id="submit_button" type="submit"&gt;Submit Payment&lt;/button&gt;
                  &lt;/div&gt;
  
                  &lt;div class="clear"&gt;&lt;/div&gt;
              &lt;/form&gt;
  
              &lt;hr /&gt;
  
              &lt;div id="visa"&gt;
                  &lt;img src="visa.png" alt="Visa Mastercard Discover American Express" /&gt;
                  &lt;br /&gt;Payments handled securely by &lt;a href="http://www.stripe.com"/ target="_blank"&gt;Stripe&lt;/a&gt;
              &lt;/div&gt;
  
              &lt;div id="secure"&gt;&lt;img src="RapidSSL.gif" alt="Secured by RapidSSL" width="90px" height="50px" /&gt;&lt;/div&gt;
          &lt;/div&gt;
  
          &lt;div id="reverb"&gt;
              Payment page provided by &lt;a href="../index.php" title="Reverb Studios Design" /&gt;ReverbStudios.ie&lt;/a&gt;
          &lt;/div&gt;
  
          &lt;script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"&gt;&lt;/script&gt;
          &lt;script type="text/javascript" src="https://js.stripe.com/v1/"&gt;&lt;/script&gt;
          &lt;script type="text/javascript" src="form.js?&lt;?= filemtime('form.js') ?&gt;"&gt;&lt;/script&gt;
          &lt;script type="text/javascript"&gt;
              Stripe.setPublishableKey('&lt;?= $key_publishable ?&gt;');
          &lt;/script&gt;
  
          &lt;script type="text/javascript"&gt;
  
    var _gaq = _gaq || [];
    _gaq.push(['_setAccount', 'UA-302404-1']);
    _gaq.push(['_trackPageview']);
  
    (function() {
      var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
      ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
      var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
    })();
  
  &lt;/script&gt;
  
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>