Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- // Get the credit card details submitted by the form
- $token = $_POST['stripeToken'];
- if (isset($_SESSION['error'])){
- $error = $_SESSION['error'] . " Redirecting you to sign up form now!";
- echo "$error";
- header('refresh:3;url=signup.php');
- unset($_SESSION['error']);
- }
- else{
- $firstname = $_POST["firstname"];
- $lastname = $_POST["lastname"];
- $email = $_POST["email"];
- $username = $_POST["username"];
- $password = $_POST["password"];
- $address = $_POST["address"];
- $apt = $_POST["apt"];
- $city = $_POST["city"];
- $state = $_POST["state"];
- $zip = $_POST["zip"];
- $cardname = $_POST["cardname"];
- $creditnum= $_POST["creditnum"];
- $expmonth = $_POST["expmonth"];
- $expyear = $_POST["expyear"];
- $ccv = $_POST["ccv"];
- }
- ?>
- <script type="text/javascript">
- #<!-- STRIPE CHARGING -->
- require_once("./stripe/init.php");
- // Set your secret key: remember to change this to your live secret key in production
- // See your keys here https://dashboard.stripe.com/account/apikeys
- #\Stripe\Stripe::setApiKey("pk_test_");
- \Stripe\Stripe::setApiKey("sk_test");
- // Create the charge on Stripe's servers - this will charge the user's card
- $customer = \Stripe\Customer::create(array(
- //"amount" => 500, // amount in cents, again
- //"currency" => "usd",
- "source" => $token,
- "plan" => "basic",
- "email" => $email
- ));
- </script>
Add Comment
Please, Sign In to add comment