-
Notifications
You must be signed in to change notification settings - Fork 0
/
request.php
67 lines (54 loc) · 2.13 KB
/
request.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<!DOCTYPE html>
<html>
<head>
<title>Berlin Geekettes Hackathon | PAYMILL Live Demo</title>
<meta http-equiv="content-type"
content="text/html; charset=utf-8"/>
<link href="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/css/bootstrap-combined.min.css" rel="stylesheet">
<?php
//
// Please download the Paymill PHP Wrapper at
// https://github.com/Paymill/Paymill-PHP
// and put the containing "lib" folder into your project
//
define('PAYMILL_API_HOST', 'https://api.paymill.com/v2/');
//
// PAYMILL private API key (Cockpit -> Settings -> API-Keys)
//
define('PAYMILL_API_KEY', '<YOUR-PRIVATE-KEY>');
//
// Include PHP Wrapper
//
set_include_path(
implode(PATH_SEPARATOR, array(
realpath(realpath(dirname(__FILE__)).'/lib'),
get_include_path())
)
);
if ($token = $_POST['paymillToken']) {
require "Services/Paymill/Transactions.php";
$transactionsObject = new Services_Paymill_Transactions(PAYMILL_API_KEY, PAYMILL_API_HOST);
$params = array(
'amount' => '15', // E.g. "15" for 0.15 EUR!
'currency' => 'EUR', // ISO 4217
'token' => $token,
'description' => 'ShoppingCartID 12345'
);
$transaction = $transactionsObject->create($params);
}
?>
</head>
<body style="background-color: #ec4f00; padding: 15px 40px; color: #fff; font-family: Arial;">
<img src="img/glogo.png" style="margin-bottom: 30px; height: 120px;">
<img src="img/logo.png" style="margin: 30px 15px; height: 50px;">
<br>
<div class="container">
<h2>We appreciate your first successful transaction!</h2>
<h4>Transaction:</h4>
<pre>
<?php print_r($transaction); ?>
</pre>
</div>
<script src="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/js/bootstrap.min.js"></script>
</body>
</html>