Advertisement
Guest User

Untitled

a guest
Apr 16th, 2014
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. <?php
  2. error_reporting(E_ALL);
  3. ini_set("display_errors", 1);
  4.  
  5. require_once(dirname(__FILE__) . '/config.php');
  6.  
  7. $token = $_POST['stripeToken'];
  8.  
  9. $customer = Stripe_Customer::create(array(
  10. 'email' => 'customer@example.com',
  11. 'card' => $token
  12. ));
  13.  
  14. $charge = Stripe_Charge::create(array(
  15. 'customer' => $customer->id,
  16. 'amount' => 2000,
  17. 'currency' => 'usd'
  18. ));
  19.  
  20. echo '<h1>Successfully charged $20.00!</h1>';
  21. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement