title: Am I using this PHP code wrong? (working with Stripe)
body: <p>I'm using Stripe for a payment gateway. I can successfully obtain a card's "token" as Stripe calls it, which is explained here:  <a href="https://stripe.com/docs/checkout#api" rel="nofollow">https://stripe.com/docs/checkout#api</a>
   Good to go with that. I successfully receive the token in my stripe dashboard.  Now what I need to do is actually charge that card(token). Here is how they put it:     "You've got your user's credit card details, now what? Now you charge them money. This happens on your server, and the fastest way to do it is by using one of our client libraries."    Well they supply the php needed right on that page:</p>
  
  <pre><code>        // Set your secret key: remember to change this to your live secret key in          production
         // See your keys here https://manage.stripe.com/account
          Stripe::setApiKey("sk_test_68YYnDTKPzcxxRZbkxEJtOVq");
  
          // Get the credit card details submitted by the form
          $token = $_POST['stripeToken'];
  
          // Create the charge on Stripe's servers - this will charge the user's card
           try {
            $charge = Stripe_Charge::create(array(
             "amount" =&gt; 1000, // amount in cents, again
               "currency" =&gt; "usd",
               "card" =&gt; $token,
                "description" =&gt; "payinguser@example.com")
                 );
                  } catch(Stripe_CardError $e) {
                 // The card has been declined
                  }
  </code></pre>
  
  <p>You can see exactly how they explain it here:  <a href="https://stripe.com/docs/tutorials/charges" rel="nofollow">https://stripe.com/docs/tutorials/charges</a></p>
  
  <p>Here is where things go wrong. 
  1) Where in this code actually pinpoints what card to charge?! I have the card's token ID number in my private dashboard. I now need to charge it, but this code doesn't say anything about the card. The only spot I see is:</p>
  
  <pre><code>          $token = $_POST['stripeToken'];
  </code></pre>
  
  <p>'stripeToken' do I put in the card's ID number here?</p>
  
  <p>2)I've created a simple page to run this with:</p>
  
  <pre><code> &lt;div id="payment"&gt;
  
  
      &lt;form action="charge-cards.php"&gt;
          &lt;?php require 'Stripe.php';?&gt;
  
          &lt;input type="submit"&gt;
  &lt;/form&gt;
  
  
  &lt;/div&gt;&lt;!--end payment--&gt;
  </code></pre>
  
  <p>"charge-cards.php" is the code at the top provided by Stripe. When I click submit, I get the follow error:</p>
  
  <pre><code>    Fatal error: Class 'Stripe' not found in /home/preemin/public_html/fun.dit       /testing/charge-cards.php on line 5
  </code></pre>
  
  <p>Can anyone see what I"m doing wrong? Thanks!</p>