-
Notifications
You must be signed in to change notification settings - Fork 42
/
example.php
80 lines (67 loc) · 1.77 KB
/
example.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
68
69
70
71
72
73
74
75
76
77
78
79
80
<?php
/**
* Amadeus Sample client
*/
include 'vendor/autoload.php';
use Sunspikes\Amadeus\Client;
// Instantiate the Amadeus class (Debug enabled)
$ws = new Client('wsdl/AmadeusWebServices.wsdl', true);
// Authenticate
$ws->securityAuthenticate([YOUR_SOURCE], [YOUR_ORIGIN], [YOUR_PASSWORD], [PASSWORD_LENGTH], [ORGANIZATION_ID]);
// Travel from and to locations
$from = 'DEL';
$to = 'BLR';
// Travel Segments
$segments[] = array(
'dep_date' => '230612',
'dep_location' => 'DEL',
'dest_location' => 'BLR',
'company' => 'IT',
'flight_no' => '201',
'class' => 'Y',
'passengers' => '2',
);
$segments[] = array(
'dep_date' => '250612',
'dep_location' => 'BLR',
'dest_location' => 'DEL',
'company' => 'IT',
'flight_no' => '202',
'class' => 'Y',
'passengers' => '2',
);
// Setup travellers
$travellers['A'] = array(
array(
'surname' => 'DOE',
'first_name' => 'JOHN'
),
);
$travellers['C'] = array(
array(
'surname' => 'DWYNE',
'first_name' => 'JOHNSON'
),
);
$travellers['I'] = array(
array(
'first_name' => 'JANE'
),
);
// Setup address and phone
$address = 'MR ESTEBAN LORENZO, BUCKINGHAM PALACE, LONDON, N1 1BP, UK';
$phone = '012345 678910';
// Airline Code
$code = 'IT';
// Here 2 types of passengers -> Adult and a Child
$types = 2;
// Make the booking
$ws->airSellFromRecommendation($from, $to, $segments);
$ws->pnrAddMultiElements($travellers, $address, $phone);
$ws->farePricePnrWithBookingClass($code);
$ws->ticketCreateTstFromPricing($types);
$ws->pnrAddMultiElementsFinal();
// To Retreive PNR pass the PNR ID returned by the previous booking call.
// $ws->pnrRetrieve('YFJG9V');
// Signout
$ws->securitySignout();