Skip to content

Commit

Permalink
Implemented Ticket_ATCShopperMasterPricerTravelBoardSearch message fo…
Browse files Browse the repository at this point in the history
…r ATC shopper flow support (#39)
  • Loading branch information
DerMika committed Mar 3, 2017
1 parent 5fbac6b commit 6eaeefe
Show file tree
Hide file tree
Showing 27 changed files with 962 additions and 40 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Release 1.3.0 (UNRELEASED)
* Added support for Multiple Office ID's in ``Fare_MasterPricerTravelBoardSearch`` (https://github.com/amabnl/amadeus-ws-client/pull/44) - Michal Hernas
* Implemented ``Ticket_CheckEligibility`` message for ATC Shopper flow (https://github.com/amabnl/amadeus-ws-client/issues/39)
* Implemented ``Ticket_ATCShopperMasterPricerTravelBoardSearch`` message for ATC Shopper flow (https://github.com/amabnl/amadeus-ws-client/issues/39)
* Implemented ``Ticket_CreateTSMFareElement`` message for ATC Shopper flow (https://github.com/amabnl/amadeus-ws-client/issues/39)

# Release 1.2.0 (23 February 2017)
Expand Down
2 changes: 1 addition & 1 deletion docs/list-of-supported-messages.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ This is the list of messages that are at least partially supported at this time:
- Ticket_DeleteTSMP
- Ticket_DisplayTSMFareElement
- Ticket_CheckEligibility
- Ticket_ATCShopperMasterPricerTravelBoardSearch
- DocIssuance_IssueTicket
- DocIssuance_IssueMiscellaneousDocuments
- DocIssuance_IssueCombined
Expand Down Expand Up @@ -74,7 +75,6 @@ These messages will be implemented at some point in the future. *Pull requests a
- Air_RebookAirSegment
- Air_TLAGetAvailability
- PointOfRef_CategoryList
- Ticket_ATCShopperMasterPricerTravelBoardSearch
- Ticket_RepricePNRWithBookingClass
- Ticket_ReissueConfirmedPricing
- Ticket_ProcessEDoc
Expand Down
78 changes: 76 additions & 2 deletions docs/samples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1339,7 +1339,7 @@ Delete the form of payment from the TSM of tattoo 18:
$createTsmResponse = $client->ticketCreateTSMFareElement(
new TicketCreateTsmFareElOptions([
'elementType' => TicketCreateTsmFareElOptions::TYPE_FORM_OF_PAYMENT,
'type' => TicketCreateTsmFareElOptions::TYPE_FORM_OF_PAYMENT,
'tattoo' => 18,
'info' => '#####'
])
Expand All @@ -1354,7 +1354,7 @@ Set the form of payment Check to the TSM of tattoo 18:
$createTsmResponse = $client->ticketCreateTSMFareElement(
new TicketCreateTsmFareElOptions([
'elementType' => TicketCreateTsmFareElOptions::TYPE_FORM_OF_PAYMENT,
'type' => TicketCreateTsmFareElOptions::TYPE_FORM_OF_PAYMENT,
'tattoo' => 18,
'info' => 'CHECK/EUR304.89'
])
Expand Down Expand Up @@ -1521,6 +1521,80 @@ Ticket eligibility request for one Adult passenger with ticket number 172-230000
])
);
----------------------------------------------
Ticket_ATCShopperMasterPricerTravelBoardSearch
----------------------------------------------

Basic Search With Mandatory Elements:

.. code-block:: php
use Amadeus\Client\RequestOptions\TicketAtcShopperMpTbSearchOptions;
use Amadeus\Client\RequestOptions\Fare\MPDate;
use Amadeus\Client\RequestOptions\Fare\MPItinerary;
use Amadeus\Client\RequestOptions\Fare\MPLocation;
use Amadeus\Client\RequestOptions\Fare\MPPassenger;
use Amadeus\Client\RequestOptions\Ticket\ReqSegOptions;
$response = $client->ticketAtcShopperMasterPricerTravelBoardSearch(
new TicketAtcShopperMpTbSearchOptions([
'nrOfRequestedPassengers' => 2,
'nrOfRequestedResults' => 2,
'passengers' => [
new MPPassenger([
'type' => MPPassenger::TYPE_ADULT,
'count' => 1
]),
new MPPassenger([
'type' => MPPassenger::TYPE_CHILD,
'count' => 1
])
],
'flightOptions' => [
TicketAtcShopperMpTbSearchOptions::FLIGHTOPT_PUBLISHED,
TicketAtcShopperMpTbSearchOptions::FLIGHTOPT_UNIFARES
],
'itinerary' => [
new MPItinerary([
'segmentReference' => 1,
'departureLocation' => new MPLocation(['city' => 'MAD']),
'arrivalLocation' => new MPLocation(['city' => 'LHR']),
'date' => new MPDate([
'date' => new \DateTime('2013-08-12T00:00:00+0000', new \DateTimeZone('UTC'))
])
]),
new MPItinerary([
'segmentReference' => 2,
'departureLocation' => new MPLocation(['city' => 'LHR']),
'arrivalLocation' => new MPLocation(['city' => 'MAD']),
'date' => new MPDate([
'date' => new \DateTime('2013-12-12T00:00:00+0000', new \DateTimeZone('UTC'))
])
])
],
'ticketNumbers' => [
'0572187777498',
'0572187777499'
],
'requestedSegments' => [
new ReqSegOptions([
'requestCode' => ReqSegOptions::REQUEST_CODE_KEEP_FLIGHTS_AND_FARES,
'connectionLocations' => [
'MAD',
'LHR'
]
]),
new ReqSegOptions([
'requestCode' => ReqSegOptions::REQUEST_CODE_CHANGE_REQUESTED_SEGMENT,
'connectionLocations' => [
'LHR',
'MAD'
]
])
]
])
);
***********
DocIssuance
Expand Down
16 changes: 16 additions & 0 deletions src/Amadeus/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -918,6 +918,22 @@ public function ticketCheckEligibility(
return $this->callMessage($msgName, $options, $messageOptions);
}

/**
* Ticket_ATCShopperMasterPricerTravelBoardSearch
*
* @param RequestOptions\TicketAtcShopperMpTbSearchOptions $options
* @param array $messageOptions (OPTIONAL)
* @return Result
*/
public function ticketAtcShopperMasterPricerTravelBoardSearch(
RequestOptions\TicketAtcShopperMpTbSearchOptions $options,
$messageOptions = []
) {
$msgName = 'Ticket_ATCShopperMasterPricerTravelBoardSearch';

return $this->callMessage($msgName, $options, $messageOptions);
}

/**
* DocIssuance_IssueTicket
*
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?php
/**
* amadeus-ws-client
*
* Copyright 2015 Amadeus Benelux NV
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* @package Amadeus
* @license https://opensource.org/licenses/Apache-2.0 Apache 2.0
*/

namespace Amadeus\Client\RequestCreator\Converter\Ticket;

use Amadeus\Client\RequestCreator\Converter\BaseConverter;
use Amadeus\Client\RequestOptions\TicketAtcShopperMpTbSearchOptions;
use Amadeus\Client\Struct;

/**
* ATCShopperMasterPricerTravelBoardSearchConv
*
* @package Amadeus\Client\RequestCreator\Converter\Ticket
* @author Dieter Devlieghere <dieter.devlieghere@benelux.amadeus.com>
*/
class ATCShopperMasterPricerTravelBoardSearchConv extends BaseConverter
{
/**
* @param TicketAtcShopperMpTbSearchOptions $requestOptions
* @param int|string $version
* @return Struct\Ticket\AtcShopperMasterPricerTravelBoardSearch
*/
public function convert($requestOptions, $version)
{
return new Struct\Ticket\AtcShopperMasterPricerTravelBoardSearch($requestOptions);
}
}
12 changes: 12 additions & 0 deletions src/Amadeus/Client/RequestOptions/Fare/MPItinerary.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,22 @@
class MPItinerary extends LoadParamsFromArray
{
/**
* Segment Reference (optional)
*
* @var int
*/
public $segmentReference;

/**
* Departure location
*
* @var MPLocation
*/
public $departureLocation;

/**
* Arrival location
*
* @var MPLocation
*/
public $arrivalLocation;
Expand Down
60 changes: 60 additions & 0 deletions src/Amadeus/Client/RequestOptions/Pnr/Element/Commission.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<?php
/**
* amadeus-ws-client
*
* Copyright 2015 Amadeus Benelux NV
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* @package Amadeus
* @license https://opensource.org/licenses/Apache-2.0 Apache 2.0
*/

namespace Amadeus\Client\RequestOptions\Pnr\Element;

use Amadeus\Client\RequestOptions\Pnr\Element;

/**
* Commission - FM element
*
* @package Amadeus\Client\RequestOptions\Pnr\Element
* @author Dieter Devlieghere <dieter.devlieghere@benelux.amadeus.com>
*/
class Commission extends Element
{
const PAXTYPE_INFANT_WITHOUT_SEAT = 766;
const PAXTYPE_INFANT_WITH_SEAT = 767;
const PAXTYPE_CABIN_BAGGAGE = "C";
const PAXTYPE_EXTRA_SEAT = "E";
const PAXTYPE_GROUP = "G";
const PAXTYPE_INFANT_NOT_OCCUPYING_A_SEAT = "INF";
const PAXTYPE_MONTH = "MTH";
const PAXTYPE_PASSENGER = "PAX";
const PAXTYPE_YEAR = "YRS";

const INDICATOR_COMMISSION = "FM";

/**
* Passenger type
*
* Choose from self::PAXTYPE_*
*
* @var string|int
*/
public $passengerType;

/**
* @var string
*/
public $indicator;
}
57 changes: 57 additions & 0 deletions src/Amadeus/Client/RequestOptions/Ticket/ReqSegOptions.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<?php
/**
* amadeus-ws-client
*
* Copyright 2015 Amadeus Benelux NV
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* @package Amadeus
* @license https://opensource.org/licenses/Apache-2.0 Apache 2.0
*/

namespace Amadeus\Client\RequestOptions\Ticket;

use Amadeus\Client\LoadParamsFromArray;

/**
* Changed ticket requested segments.
*
*
* @package Amadeus\Client\RequestOptions\Ticket
* @author Dieter Devlieghere <dieter.devlieghere@benelux.amadeus.com>
*/
class ReqSegOptions extends LoadParamsFromArray
{
const REQUEST_CODE_ADD = "A";
const REQUEST_CODE_CHANGE_REQUESTED_SEGMENT = "C";
const REQUEST_CODE_IGNORE_ONEWAYCOMBINEABLE = "I";
const REQUEST_CODE_KEEP_FLIGHTS = "K";
const REQUEST_CODE_KEEP_FLIGHTS_AND_FARES = "KF";
const REQUEST_CODE_IGNORE_OTHER = "O";
const REQUEST_CODE_REMOVE = "R";

/**
* What action to perform
*
* choose from self::REQUEST_CODE_*
*
* @var string
*/
public $requestCode;

/**
* @var string[]
*/
public $connectionLocations = [];
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?php
/**
* amadeus-ws-client
*
* Copyright 2015 Amadeus Benelux NV
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* @package Amadeus
* @license https://opensource.org/licenses/Apache-2.0 Apache 2.0
*/

namespace Amadeus\Client\RequestOptions;

use Amadeus\Client\RequestOptions\Ticket\ReqSegOptions;

/**
* Ticket_ATCShopperMasterPricerTravelBoardSearch request options
*
* @package Amadeus\Client\RequestOptions
* @author Dieter Devlieghere <dieter.devlieghere@benelux.amadeus.com>
*/
class TicketAtcShopperMpTbSearchOptions extends FareMasterPricerTbSearch
{
/**
* List of ticket numbers to change
*
* @var string[]
*/
public $ticketNumbers = [];

/**
* Changed ticket requested segments.
*
* @var ReqSegOptions[]
*/
public $requestedSegments = [];
}
Loading

0 comments on commit 6eaeefe

Please sign in to comment.