-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkomfortkasse_send.php
49 lines (34 loc) · 981 Bytes
/
komfortkasse_send.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
<html>
<body>
<?php
// Komfortkasse Generic Example
// This file will send an API call conatining a new order to the komfortkasse API.
include_once ('komfortkasse_settings.php');
// first, build the example order
include_once ('komfortkasse_buildorder.php');
getorder();
$query_raw = http_build_query($order);
$query_enc = base64_encode($query_raw);
$query = http_build_query(array (
'q' => $query_enc,
'hash' => $accesscode,
'key' => $apikey
));
$contextData = array (
'method' => 'POST',
'timeout' => 2,
'header' => "Connection: close\r\n" . "Content-Length: " . strlen($query) . "\r\n",
'content' => $query
);
$context = stream_context_create(array (
'http' => $contextData
));
// Development: http://localhost:8080/kkos01/api...
$result = @file_get_contents('https://ssl.komfortkasse.eu/api/shop/neworder.jsf', false, $context);
echo 'Result:<br/><br/>';
echo '<textarea rows="5" cols="80">';
echo $result;
echo '</textarea>';
?>
</body>
</html>