-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcharge.php
38 lines (36 loc) · 1.01 KB
/
charge.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<!DOCTYPE html>
<html lang="en">
<body>
<?php
require_once('config.php');
echo "loaded";
$name = $_POST['full_name'];
$email = $_POST['email_addr'];
$link1 = $_POST['link1'];
$link2 = $_POST['link2'];
$link3 = $_POST['link3'];
$link4 = $_POST['link4'];
$link5 = $_POST['link5'];
$total = $_POST['total'];
$token = $_POST['stripeToken'];
echo "<br>link1 = $link1 <br> link2 = $link2 <br> link3 = $link3 <br> link4 = $link4 <br> link5 = $link5 <br>";
var_dump($token);
echo "<br>token = $token <br> name = $name <br> email = $email <br> link = $link <br> total = $total ";
$customer = Stripe_Customer::create(
array(
'email' => $email,
'card' => $token
)
);
echo "<br> customer created customer = $customer <br> total = $total";
$charge = Stripe_Charge::create(
array(
'customer' => $customer->id,
'amount' => $total,
'currency' => 'usd'
)
);
echo "<h1>Successfully charged ($total/100)!</h1>";
?>
</body>
</html>