title: Stripe API Error - Missing required param: amount - PHP library
body: <p>I have implemented a Stripe payment, but the problem is that I am continuously getting this error:</p>
  
  <blockquote>
    <p>{status: 500, error: "Missing required param: amount."}</p>
  </blockquote>
  
  <p>As can be seen in the code, I have all the parameters, but still I do not know why this error is coming up. Here is the code I am using:</p>
  
  <pre><code>public function process(){
      try {
          Stripe::setApiKey('sk_text_key');
          $charge = Stripe_Charge::create(array(
                       "amount" =&gt; 2000,
                      "currency" =&gt; "USD",
                      "card" =&gt; $this-&gt;input-&gt;post('access_token'),
                      "description" =&gt; "Stripe Payment"
          ));
      } catch (Stripe_InvalidRequestError $e) {
          // Invalid parameters were supplied to Stripe's API
          echo json_encode(array('status' =&gt; 500, 'error' =&gt; $e-&gt;getMessage()));
          exit();
      }
  }   
  </code></pre>
  
  <p>This is the javascript I am using to submit the form:</p>
  
  <pre><code>$(function() {
      var $form = $('#payment-form');
      $form.submit(function(event) {
          $form.find('.submit').prop('disabled', true);
          $form.find('.submit').val('Please wait...');
  
          Stripe.card.createToken($form, stripeResponseHandler);
          return false;
      });
  });
  
  function stripeResponseHandler(status, response) 
  {
      if (response.error) {
          alert(response.error.message);
      } 
      else {
          $.ajax({
              url: '&lt;?php echo base_url('payment/process');?&gt;',
              data: {access_token: response.id},
              type: 'POST',
              dataType: 'JSON',
              success: function(response){
                  console.log(response);
                  if(response.success)
                  window.location.href="&lt;?php echo base_url('booking/thankyou'); ?&gt;";
              },
              error: function(error){
                  console.log(error);
              }
          });
      }
  }
  </code></pre>