File: //home/awaldron/_domains/pennhillscdc.org/txn.php
<?php
// TEST SK: sk_test_syw0UUqiY0EkFX0gRqd1kFFT
// TEST PK: pk_test_HRnbcCSYLNaustWV5YbiNgVf
// LIVE SK: sk_live_898f1firnALrL9AunS723t6L
// LIVE PK: pk_live_DykLEQnefWy8M9UtjfUAHLHk
require 'stripe/init.php';
$token = $_POST['stripeToken'];
$email = $_POST['stripeEmail'];
// Create a Customer
$customer = \Stripe\Customer::create(array(
"email" => "paying.user@example.com",
"source" => $token,
));
// Save the customer id in your own database!
// Charge the Customer instead of the card
$charge = \Stripe\Charge::create(array(
"amount" => 2000,
"currency" => "usd",
"customer" => $customer->id
));
echo '<h1>Successfully charged $50.00!</h1>';