Skip to content

Instantly share code, notes, and snippets.

<?php
require_once('./lib/Stripe.php');
if ($_POST) {
Stripe::setApiKey("blah");
$error = '';
$success = '';
try {
if (!isset($_POST['stripeToken'])) {
throw new Exception("The Stripe Token was not generated correctly");
$customer = Stripe_Customer::create(array(
'email' => $_POST['email'],
'description' => $_POST['first-name'] . " " . $_POST['last-name'],
'card' => $_POST['stripeToken'],
'plan' => 'wh_15'
)
);