SOLUTION: CURL-PHP5 WAS NOT INSTALLED BE SURE TO ENABLE ERRORS IN PHP
Guide I followed: https://stripe.com/docs/checkout/guides/php
Path to the Stripe PHP Library: /var/www/stripe-php/lib/Stripe.php or /stripe-php/lib/Stripe.php
Error Message: Fatal error: Class 'Stripe_Customer' not found in /var/www/charge.php on line 9
index.php:
<?php require_once('config.php'); ?>
<form action="charge.php" method="post">
<script src="https://checkout.stripe.com/checkout.js" class="stripe-button"
data-key="<?php echo $stripe['publishable_key']; ?>"
data-amount="2000" data-billing-address data-description="Test"></script>
</form>
config.php: (the keys are just test ones provided by stripe)
<?php
require_once('stripe-php/lib/Stripe.php');
$stripe = array(
"secret_key" => "sk_test_************************",
"publishable_key" => "pk_test_************************"
);
Stripe::setApiKey($stripe['secret_key']);
?>
charge.php:
<?php
error_reporting(E_ALL);
ini_set("display_errors", 1);
require_once(dirname(__FILE__) . '/config.php');
$token = $_POST['stripeToken'];
$customer = Stripe_Customer::create(array(
'email' => 'customer@example.com',
'card' => $token
));
$charge = Stripe_Charge::create(array(
'customer' => $customer->id,
'amount' => 2000,
'currency' => 'usd'
));
echo '<h1>Successfully charged $20.00!</h1>';
?>