Guest User

Untitled

a guest
Mar 20th, 2016
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.56 KB | None | 0 0
  1. <?php
  2. session_start();
  3.  
  4. // Get the credit card details submitted by the form
  5. $token = $_POST['stripeToken'];
  6.  
  7. if (isset($_SESSION['error'])){
  8. $error = $_SESSION['error'] . " Redirecting you to sign up form now!";
  9. echo "$error";
  10. header('refresh:3;url=signup.php');
  11. unset($_SESSION['error']);
  12. }
  13. else{
  14.  
  15. $firstname = $_POST["firstname"];
  16. $lastname = $_POST["lastname"];
  17. $email = $_POST["email"];
  18. $username = $_POST["username"];
  19. $password = $_POST["password"];
  20. $address = $_POST["address"];
  21. $apt = $_POST["apt"];
  22. $city = $_POST["city"];
  23. $state = $_POST["state"];
  24. $zip = $_POST["zip"];
  25. $cardname = $_POST["cardname"];
  26. $creditnum= $_POST["creditnum"];
  27. $expmonth = $_POST["expmonth"];
  28. $expyear = $_POST["expyear"];
  29. $ccv = $_POST["ccv"];
  30.  
  31. }
  32.  
  33. ?>
  34.  
  35.  
  36.  
  37.  
  38. <script type="text/javascript">
  39. #<!-- STRIPE CHARGING -->
  40. require_once("./stripe/init.php");
  41.  
  42. // Set your secret key: remember to change this to your live secret key in production
  43. // See your keys here https://dashboard.stripe.com/account/apikeys
  44. #\Stripe\Stripe::setApiKey("pk_test_");
  45. \Stripe\Stripe::setApiKey("sk_test");
  46.  
  47. // Create the charge on Stripe's servers - this will charge the user's card
  48.  
  49.  
  50.  
  51.  
  52. $customer = \Stripe\Customer::create(array(
  53. //"amount" => 500, // amount in cents, again
  54. //"currency" => "usd",
  55. "source" => $token,
  56. "plan" => "basic",
  57. "email" => $email
  58.  
  59. ));
  60.  
  61. </script>
Add Comment
Please, Sign In to add comment