Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if ($_SERVER['REQUEST_METHOD'] == 'POST') {
- $error = false;
- try {
- if (!isset($_POST['stripeToken'])) throw new Exception("The Stripe Token was not generated correctly");
- if (!isset($_POST['stripeEmail'])) throw new Exception("The Stripe Email was not received");
- $charge = \Stripe\Charge::create(array(
- 'source' => $_POST['stripeToken'],
- 'amount' => 3400,
- 'currency' => 'EUR',
- 'receipt_email' => $_POST['stripeEmail']
- ));
- } catch (Exception $e) {
- $error = $e->getMessage();
- }
- if (!$error) {
- echo "";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement