-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathservice.php
More file actions
33 lines (27 loc) · 824 Bytes
/
Copy pathservice.php
File metadata and controls
33 lines (27 loc) · 824 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
<?php
require_once('WEB-INF/includes/classes/api.php'); // including service class to work with database
if ($_SERVER['REQUEST_METHOD'] !== 'POST') {
die('Only POST requests are accepted');
}
$token = $_POST["Token"];
$resellerId = $_POST["ResellerID"];
$oApi = new Api($resellerId,$token);
// process actions
switch ($_REQUEST['action']) {
case 'offers':
$offers = $oApi->getAvailableOffers();
echo $offers;
break;
case 'availability':
$offerAvailability = $oApi->getOfferAvailability();
echo $offerAvailability;
break;
case 'reservation':
$reservation = $oApi->makeReservation();
echo $reservation;
break;
case 'confirmation':
$confirmBooking = $oApi->confirmBooking();
echo $confirmBooking;
break;
}