-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcharge.php
More file actions
34 lines (28 loc) · 735 Bytes
/
charge.php
File metadata and controls
34 lines (28 loc) · 735 Bytes
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
<?php
require_once('./stripe-php-1.7.1/lib/Stripe.php');
Stripe::setApiKey("JTeqqyrUnqR0lEj8RmKFavE0JGg9x1Fs");
// get the credit card details submitted by the form
$token = $_POST['token'];
// create a Customer
$customer = Stripe_Customer::create(array(
"card" => $token,
"description" => "yuliinfo@gmail.com")
);
// charge the Customer instead of the card
Stripe_Charge::create(array(
"amount" => 1000, # amount in cents, again
"currency" => "usd",
"customer" => $customer->id)
);
?>
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8" />
<title></title>
<!--[if lt IE 9]><script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
</head>
<body>
<p>Done!</p>
</body>
</html>