title: Wordpress custom page template Stripe integration showing - "PHP Fatal error: Uncaught Error: Class 'Stripe\Stripe' not found" ERROR"
body: <p>I have used the following code in the payment.php page template...</p>
  
  <pre><code>    &lt;?php
  /*
  Template Name: Page: Donate Success
  */  
  // Check whether stripe token is not empty
  
      if(!empty($_POST['stripeToken'])){ 
  
  // Retrieve stripe token, card and user info from the submitted form data 
  $token  = $_POST['stripeToken']; 
  $name = $_POST['forename']." ". $_POST['surname']; 
  $email = $_POST['email']; 
  $card_number = $_POST['card_number']; 
  $card_exp_month = $_POST['card_exp_month']; 
  $card_exp_year = $_POST['card_exp_year']; 
  $card_cvc = $_POST['card_cvc']; 
  
  // Include Stripe PHP library 
  require_once(site_url().'/stripe-php/init.php'); 
  
  \Stripe\Stripe::setApiKey("sk_test_my_secret_key");    
  
  // Add customer to stripe 
  $customer = \Stripe\Customer::create(array( 
      'email' =&gt; $email, 
      'source'  =&gt; $token 
  )); 
  
  // Unique order ID 
  $orderID = strtoupper(str_replace('.','',uniqid('', true))); 
  
  // Convert price to cents 
  $itemPrice = ($itemPrice*100); 
  
  // Charge a credit or a debit card 
  $charge = \Stripe\Charge::create(array( 
      'customer' =&gt; $customer-&gt;id, 
      'amount'   =&gt; $itemPrice, 
      'currency' =&gt; $currency, 
      'description' =&gt; $itemName, 
      'metadata' =&gt; array( 
          'order_id' =&gt; $orderID 
      ) 
  )); 
  
  // Retrieve charge details 
  $chargeJson = $charge-&gt;jsonSerialize(); 
  
  // Check whether the charge is successful 
  if($chargeJson['amount_refunded'] == 0 &amp;&amp; empty($chargeJson['failure_code']) &amp;&amp; $chargeJson['paid'] == 1 &amp;&amp; $chargeJson['captured'] == 1){ 
      // Order details  
      $transactionID = $chargeJson['balance_transaction']; 
      $paidAmount = $chargeJson['amount']; 
      $paidCurrency = $chargeJson['currency']; 
      $payment_status = $chargeJson['status'];  
  
  
      // If the order is successful 
      if($payment_status == 'succeeded'){ 
          $ordStatus = 'success'; 
          $statusMsg = 'Your Payment has been Successful!'; 
      }else{ 
          $statusMsg = "Your Payment has Failed!"; 
      } 
  }else{ 
  
      $statusMsg = "Transaction has been failed!"; 
  } 
  }else{ 
  $statusMsg = "Error on form submission."; 
  } 
  ?&gt;
  
  &lt;div class="container"&gt;
  &lt;div class="status"&gt;
          &lt;h1 class="&lt;?php echo $ordStatus; ?&gt;"&gt;&lt;?php echo $statusMsg; ?&gt;&lt;/h1&gt;
  
          &lt;h4&gt;Payment Information&lt;/h4&gt;
          &lt;p&gt;&lt;b&gt;Reference Number:&lt;/b&gt; &lt;?php echo $payment_id; ?&gt;&lt;/p&gt;
          &lt;p&gt;&lt;b&gt;Transaction ID:&lt;/b&gt; &lt;?php echo $transactionID; ?&gt;&lt;/p&gt;
          &lt;p&gt;&lt;b&gt;Paid Amount:&lt;/b&gt; &lt;?php echo $paidAmount.' '.$paidCurrency; ?&gt;&lt;/p&gt;
          &lt;p&gt;&lt;b&gt;Payment Status:&lt;/b&gt; &lt;?php echo $payment_status; ?&gt;&lt;/p&gt;
  
          &lt;h4&gt;Product Information&lt;/h4&gt;
          &lt;p&gt;&lt;b&gt;Name:&lt;/b&gt; &lt;?php echo $itemName; ?&gt;&lt;/p&gt;
          &lt;p&gt;&lt;b&gt;Price:&lt;/b&gt; &lt;?php echo $itemPrice.' '.$currency; ?&gt;&lt;/p&gt;
      &lt;/div&gt;
      &lt;a href="index.php" class="btn-link"&gt;Back to Payment Page&lt;/a&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>I include the stripe sdk files in the root folder of the Wordpress...</p>
  
  <p>token is generated from the payment form and found in the above template but I found the error in the following line of code  \Stripe\Stripe::setApiKey("sk_test_my_secret_key"); called "PHP Fatal error:  Uncaught Error: Class 'Stripe\Stripe' not found" ERROR"...</p>
  
  <p>Thank You..</p>