diff --git a/CHANGELOG.md b/CHANGELOG.md index e96399b35..7d3a4459f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -65,6 +65,7 @@ * Added support for Form Of Payment overrides in all ``Fare_`` Pricing messages and in ``Service_IntegratedPricing`` (https://github.com/amabnl/amadeus-ws-client/issues/72) * Added support for Frequent Flyer override in ``Service_IntegratedPricing`` * Implemented ``DocRefund_InitRefund`` (https://github.com/amabnl/amadeus-ws-client/issues/56) +<<<<<<< HEAD * Implemented ``DocRefund_UpdateRefund`` (https://github.com/amabnl/amadeus-ws-client/issues/56) * Implemented ``DocRefund_ProcessRefund`` (https://github.com/amabnl/amadeus-ws-client/issues/56) * Implemented ``Fare_GetFareRules`` (https://github.com/amabnl/amadeus-ws-client/issues/63) @@ -72,6 +73,10 @@ # Release 1.3.1 (5 May 2017) * Loosened psr/log dependency to allow installation with Yii2 (https://github.com/amabnl/amadeus-ws-client/issues/73) +======= +* Implemented ``Hotel_MultiSingleAvailability`` +* Implemented ``Hotel_Sell`` +>>>>>>> hotel # Release 1.3.0 (5 April 2017) * Added support for Multiple Office ID's in ``Fare_MasterPricerTravelBoardSearch`` (https://github.com/amabnl/amadeus-ws-client/pull/44) - Michal Hernas @@ -116,6 +121,7 @@ * Implemented ``PNR_NameChange`` message * Implemented ``FOP_CreateFormOfPayment`` message * Implemented ``PointOfRef_Search`` message +* Implemented ``Hotel_Sell`` message * Request Creator split up in 1 dedicated class per message. * Response Handler split up in 1 dedicated class per message. diff --git a/README.md b/README.md index 9d41c0f58..3f13bca9f 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,11 @@ -# amadeus-ws-client: PHP client for the Amadeus GDS SOAP Web Service interface +# amadeus-ws-client: PHP client for the Amadeus GDS SOAP Web Service interface [![Latest Stable Version](https://poser.pugx.org/amabnl/amadeus-ws-client/v/stable)](https://packagist.org/packages/amabnl/amadeus-ws-client) [![Build Status](https://travis-ci.org/amabnl/amadeus-ws-client.svg?branch=master)](https://travis-ci.org/amabnl/amadeus-ws-client) [![Coverage Status](https://coveralls.io/repos/github/amabnl/amadeus-ws-client/badge.svg?branch=master)](https://coveralls.io/github/amabnl/amadeus-ws-client?branch=master) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/amabnl/amadeus-ws-client/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/amabnl/amadeus-ws-client/?branch=master) [![Style Status - PSR-2](https://styleci.io/repos/49078536/shield?branch=master)](https://styleci.io/repos/49078536) This client library provides access to the Amadeus GDS SOAP Web Service interface. -To use this client, you must first obtain your personal access to the Web Service interface through an Amadeus Sales channel of your choice. +To use this client, +you must first obtain your personal access to the Web Service interface through an Amadeus Sales channel of your choice. The Amadeus documentation portal can be found at https://webservices.amadeus.com/ diff --git a/composer.lock b/composer.lock index afefeb2f3..9c2c7d224 100644 --- a/composer.lock +++ b/composer.lock @@ -4,34 +4,26 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "fd536268a1568a34d8601d2a9ddc2da6", + "content-hash": "50e7b1888a2d37980098b7716396c50f", "packages": [ { "name": "psr/log", - "version": "1.0.2", + "version": "1.0.0", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d" + "reference": "fe0936ee26643249e916849d48e3a51d5f5e278b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", - "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "url": "https://api.github.com/repos/php-fig/log/zipball/fe0936ee26643249e916849d48e3a51d5f5e278b", + "reference": "fe0936ee26643249e916849d48e3a51d5f5e278b", "shasum": "" }, - "require": { - "php": ">=5.3.0" - }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, "autoload": { - "psr-4": { - "Psr\\Log\\": "Psr/Log/" + "psr-0": { + "Psr\\Log\\": "" } }, "notification-url": "https://packagist.org/downloads/", @@ -45,13 +37,12 @@ } ], "description": "Common interface for logging libraries", - "homepage": "https://github.com/php-fig/log", "keywords": [ "log", "psr", "psr-3" ], - "time": "2016-10-10T12:19:37+00:00" + "time": "2012-12-21T11:40:51+00:00" } ], "packages-dev": [ @@ -111,16 +102,16 @@ }, { "name": "phpdocumentor/reflection-docblock", - "version": "2.0.5", + "version": "2.0.4", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "e6a969a640b00d8daa3c66518b0405fb41ae0c4b" + "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/e6a969a640b00d8daa3c66518b0405fb41ae0c4b", - "reference": "e6a969a640b00d8daa3c66518b0405fb41ae0c4b", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/d68dbdc53dc358a816f00b300704702b2eaff7b8", + "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8", "shasum": "" }, "require": { @@ -156,37 +147,37 @@ "email": "mike.vanriel@naenius.com" } ], - "time": "2016-01-25T08:17:30+00:00" + "time": "2015-02-03T12:10:50+00:00" }, { "name": "phpspec/prophecy", - "version": "1.7.6", + "version": "v1.7.0", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "33a7e3c4fda54e912ff6338c48823bd5c0f0b712" + "reference": "93d39f1f7f9326d746203c7c056f300f7f126073" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/33a7e3c4fda54e912ff6338c48823bd5c0f0b712", - "reference": "33a7e3c4fda54e912ff6338c48823bd5c0f0b712", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/93d39f1f7f9326d746203c7c056f300f7f126073", + "reference": "93d39f1f7f9326d746203c7c056f300f7f126073", "shasum": "" }, "require": { "doctrine/instantiator": "^1.0.2", "php": "^5.3|^7.0", - "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0", - "sebastian/comparator": "^1.1|^2.0|^3.0", + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2", + "sebastian/comparator": "^1.1|^2.0", "sebastian/recursion-context": "^1.0|^2.0|^3.0" }, "require-dev": { "phpspec/phpspec": "^2.5|^3.2", - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5" + "phpunit/phpunit": "^4.8 || ^5.6.5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.7.x-dev" + "dev-master": "1.6.x-dev" } }, "autoload": { @@ -219,7 +210,7 @@ "spy", "stub" ], - "time": "2018-04-18T13:57:24+00:00" + "time": "2017-03-02T20:05:34+00:00" }, { "name": "phpunit/php-code-coverage", @@ -285,16 +276,16 @@ }, { "name": "phpunit/php-file-iterator", - "version": "1.4.5", + "version": "1.4.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4" + "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4", - "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/3cc8f69b3028d0f96a9078e6295d86e9bf019be5", + "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5", "shasum": "" }, "require": { @@ -328,7 +319,7 @@ "filesystem", "iterator" ], - "time": "2017-11-27T13:52:08+00:00" + "time": "2016-10-03T07:40:28+00:00" }, { "name": "phpunit/php-text-template", @@ -422,16 +413,16 @@ }, { "name": "phpunit/php-token-stream", - "version": "1.4.12", + "version": "1.4.11", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "1ce90ba27c42e4e44e6d8458241466380b51fa16" + "reference": "e03f8f67534427a787e21a385a67ec3ca6978ea7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/1ce90ba27c42e4e44e6d8458241466380b51fa16", - "reference": "1ce90ba27c42e4e44e6d8458241466380b51fa16", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/e03f8f67534427a787e21a385a67ec3ca6978ea7", + "reference": "e03f8f67534427a787e21a385a67ec3ca6978ea7", "shasum": "" }, "require": { @@ -467,20 +458,20 @@ "keywords": [ "tokenizer" ], - "time": "2017-12-04T08:55:13+00:00" + "time": "2017-02-27T10:12:30+00:00" }, { "name": "phpunit/phpunit", - "version": "4.8.36", + "version": "4.8.35", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "46023de9a91eec7dfb06cc56cb4e260017298517" + "reference": "791b1a67c25af50e230f841ee7a9c6eba507dc87" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/46023de9a91eec7dfb06cc56cb4e260017298517", - "reference": "46023de9a91eec7dfb06cc56cb4e260017298517", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/791b1a67c25af50e230f841ee7a9c6eba507dc87", + "reference": "791b1a67c25af50e230f841ee7a9c6eba507dc87", "shasum": "" }, "require": { @@ -539,7 +530,7 @@ "testing", "xunit" ], - "time": "2017-06-21T08:07:12+00:00" + "time": "2017-02-06T05:18:07+00:00" }, { "name": "phpunit/phpunit-mock-objects", @@ -663,23 +654,23 @@ }, { "name": "sebastian/diff", - "version": "1.4.3", + "version": "1.4.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4" + "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7f066a26a962dbe58ddea9f72a4e82874a3975a4", - "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/13edfd8706462032c2f52b4b862974dd46b71c9e", + "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0" + "php": ">=5.3.3" }, "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + "phpunit/phpunit": "~4.8" }, "type": "library", "extra": { @@ -711,7 +702,7 @@ "keywords": [ "diff" ], - "time": "2017-05-22T07:24:03+00:00" + "time": "2015-12-08T07:14:41+00:00" }, { "name": "sebastian/environment", @@ -971,16 +962,16 @@ }, { "name": "symfony/yaml", - "version": "v2.8.39", + "version": "v2.8.0", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "d20bd2bdee063863e426297af41eda45ccad6f7e" + "reference": "f79824187de95064a2f5038904c4d7f0227fedb5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/d20bd2bdee063863e426297af41eda45ccad6f7e", - "reference": "d20bd2bdee063863e426297af41eda45ccad6f7e", + "url": "https://api.github.com/repos/symfony/yaml/zipball/f79824187de95064a2f5038904c4d7f0227fedb5", + "reference": "f79824187de95064a2f5038904c4d7f0227fedb5", "shasum": "" }, "require": { @@ -1016,7 +1007,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2018-04-08T07:53:13+00:00" + "time": "2015-11-30T12:35:10+00:00" } ], "aliases": [], @@ -1025,13 +1016,10 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": ">=5.4", + "php": ">=5.4.11", "ext-soap": "*", "ext-dom": "*", "ext-xsl": "*" }, - "platform-dev": [], - "platform-overrides": { - "php": "5.4" - } + "platform-dev": [] } diff --git a/docs/list-of-supported-messages.rst b/docs/list-of-supported-messages.rst index 5af3b9347..e8b574935 100644 --- a/docs/list-of-supported-messages.rst +++ b/docs/list-of-supported-messages.rst @@ -64,7 +64,13 @@ This is the list of messages that are at least partially supported at this time: - DocRefund_ProcessRefund - DocRefund_IgnoreRefund - Service_IntegratedPricing +<<<<<<< HEAD - Service_IntegratedCatalogue +- Service_StandaloneCatalogue +======= +- Hotel_MultiSingleAvailability +- Hotel_Sell +>>>>>>> hotel - Offer_CreateOffer - Offer_VerifyOffer - Offer_ConfirmAirOffer @@ -103,7 +109,7 @@ These messages will be implemented at some point in the future. *Pull requests a - Media_GetMedia - Service_PriceServiceViaCatalogue - Service_PriceIntegratedMode -- Service_StandaloneCatalogue +<<<<<<< HEAD - Service_StandalonePricing - Hotel_MultiSingleAvailability (see `issue 70 `_) - Hotel_DescriptiveInfo (see `issue 70 `_) @@ -111,6 +117,12 @@ These messages will be implemented at some point in the future. *Pull requests a - Hotel_Sell (see `issue 70 `_) - Hotel_CompleteReservationDetails (see `issue 70 `_) - Hotel_Terms (see `issue 70 `_) +======= +- Hotel_DescriptiveInfo +- Hotel_EnhancedPricing +- Hotel_CompleteReservationDetails +- Hotel_Terms +>>>>>>> hotel - Car_Availability - Car_RateInformationFromAvailability - Car_Sell diff --git a/docs/samples.rst b/docs/samples.rst index 4d91257b2..7a65b6862 100644 --- a/docs/samples.rst +++ b/docs/samples.rst @@ -3156,6 +3156,7 @@ Assign an account code to a passenger: ]) ); +<<<<<<< HEAD Form of Payment: .. code-block:: php @@ -3222,6 +3223,70 @@ All the examples for ``Service_IntegratedPricing`` (see above) should also work ] ]) ); + +--------------------------- +Service_StandaloneCatalogue +--------------------------- + +.. code-block:: php + + use Amadeus\Client\RequestOptions\ServiceStandaloneCatalogueOptions; + use Amadeus\Client\RequestOptions\Service\StandaloneCatalogue\Passenger as servicePassenger; + use Amadeus\Client\RequestOptions\Service\StandaloneCatalogue\Segment as serviceSegment; + use Amadeus\Client\RequestOptions\Service\StandaloneCatalogue\PricingOptions; + use Amadeus\Client\RequestOptions\Fare\PricePnr\FareBasis; + + $standaloneCatalogueResponse = $client->serviceStandaloneCatalogue( + new ServiceStandaloneCatalogueOptions([ + 'passengers' => [ + new servicePassenger([ + 'tattoos' => [1, 2], + 'type' => Passenger::TYPE_ADULT + ]) + ], + 'segments' => [ + new serviceSegment([ + 'departureDate' => \DateTime::createFromFormat('Y-m-d H:i:s', '2018-07-31 12:55:00'), + 'arrivalDate' => \DateTime::createFromFormat('Y-m-d H:i:s', '2018-07-31 15:10:00'), + 'from' => 'CAI', + 'to' => 'TUN', + 'marketingCompany' => 'TU', + 'operatingCompany' => 'TU', + 'flightNumber' => '814', + 'bookingClass' => 'L', + 'flightIndicator' => 'L', + 'segmentTattoo' => 1 + ]) + ], + 'pricingOptions' => new ServiceIntegratedPricingOptions([ + 'pricingsFareBasis' => [ + new FareBasis([ + 'fareBasisCode' => 'LOXOW', + ]) + ], + 'references' => [ + new PaxSegRef([ + 'reference' => 1, + 'type' => 'S' + ]), + new PaxSegRef([ + 'reference' => 1, + 'type' => 'P' + ]) + ] + ]) + ]) +); +======= +***** +Hotel +***** +---------- +Hotel_Sell +---------- + +*coming soon* +>>>>>>> hotel *** FOP diff --git a/src/Amadeus/Client.php b/src/Amadeus/Client.php index df7d758cd..9d853e3de 100644 --- a/src/Amadeus/Client.php +++ b/src/Amadeus/Client.php @@ -65,7 +65,7 @@ class Client extends Base * * @var string */ - const RECEIVED_FROM_IDENTIFIER = "amabnl-amadeus-ws-client"; + const RECEIVED_FROM_IDENTIFIER = ""; /** * @var string @@ -264,7 +264,8 @@ public function pnrRetrieve(RequestOptions\PnrRetrieveOptions $options, $message public function pnrSplit( RequestOptions\PnrSplitOptions $options, $messageOptions = [] - ) { + ) + { $msgName = 'PNR_Split'; return $this->callMessage($msgName, $options, $messageOptions); @@ -583,7 +584,8 @@ public function offerConfirmCar(RequestOptions\OfferConfirmCarOptions $options, public function fareMasterPricerTravelBoardSearch( RequestOptions\FareMasterPricerTbSearch $options, $messageOptions = [] - ) { + ) + { $msgName = 'Fare_MasterPricerTravelBoardSearch'; return $this->callMessage($msgName, $options, $messageOptions); @@ -602,7 +604,8 @@ public function fareMasterPricerTravelBoardSearch( public function fareMasterPricerCalendar( RequestOptions\FareMasterPricerCalendarOptions $options, $messageOptions = [] - ) { + ) + { $msgName = 'Fare_MasterPricerCalendar'; return $this->callMessage($msgName, $options, $messageOptions); @@ -621,7 +624,8 @@ public function fareMasterPricerCalendar( public function farePricePnrWithBookingClass( RequestOptions\FarePricePnrWithBookingClassOptions $options, $messageOptions = [] - ) { + ) + { $msgName = 'Fare_PricePNRWithBookingClass'; return $this->callMessage($msgName, $options, $messageOptions); @@ -640,7 +644,8 @@ public function farePricePnrWithBookingClass( public function farePricePnrWithLowerFares( RequestOptions\FarePricePnrWithLowerFaresOptions $options, $messageOptions = [] - ) { + ) + { $msgName = 'Fare_PricePNRWithLowerFares'; return $this->callMessage($msgName, $options, $messageOptions); @@ -659,7 +664,8 @@ public function farePricePnrWithLowerFares( public function farePricePnrWithLowestFare( RequestOptions\FarePricePnrWithLowestFareOptions $options, $messageOptions = [] - ) { + ) + { $msgName = 'Fare_PricePNRWithLowestFare'; return $this->callMessage($msgName, $options, $messageOptions); @@ -678,7 +684,8 @@ public function farePricePnrWithLowestFare( public function fareInformativePricingWithoutPnr( RequestOptions\FareInformativePricingWithoutPnrOptions $options, $messageOptions = [] - ) { + ) + { $msgName = 'Fare_InformativePricingWithoutPNR'; return $this->callMessage($msgName, $options, $messageOptions); @@ -697,7 +704,8 @@ public function fareInformativePricingWithoutPnr( public function fareInformativeBestPricingWithoutPnr( RequestOptions\FareInformativeBestPricingWithoutPnrOptions $options, $messageOptions = [] - ) { + ) + { $msgName = 'Fare_InformativeBestPricingWithoutPNR'; return $this->callMessage($msgName, $options, $messageOptions); @@ -767,7 +775,8 @@ public function fareConvertCurrency(RequestOptions\FareConvertCurrencyOptions $o public function airMultiAvailability( RequestOptions\AirMultiAvailabilityOptions $options, $messageOptions = [] - ) { + ) + { $msgName = 'Air_MultiAvailability'; return $this->callMessage($msgName, $options, $messageOptions); @@ -786,7 +795,8 @@ public function airMultiAvailability( public function airSellFromRecommendation( RequestOptions\AirSellFromRecommendationOptions $options, $messageOptions = [] - ) { + ) + { $msgName = 'Air_SellFromRecommendation'; return $this->callMessage($msgName, $options, $messageOptions); @@ -873,7 +883,8 @@ public function commandCryptic(RequestOptions\CommandCrypticOptions $options, $m public function miniRuleGetFromPricingRec( RequestOptions\MiniRuleGetFromPricingRecOptions $options, $messageOptions = [] - ) { + ) + { $msgName = 'MiniRule_GetFromPricingRec'; return $this->callMessage($msgName, $options, $messageOptions); @@ -892,7 +903,8 @@ public function miniRuleGetFromPricingRec( public function miniRuleGetFromPricing( RequestOptions\MiniRuleGetFromPricingOptions $options, $messageOptions = [] - ) { + ) + { $msgName = 'MiniRule_GetFromPricing'; return $this->callMessage($msgName, $options, $messageOptions); @@ -911,7 +923,8 @@ public function miniRuleGetFromPricing( public function miniRuleGetFromETicket( RequestOptions\MiniRuleGetFromETicketOptions $options, $messageOptions = [] - ) { + ) + { $msgName = 'MiniRule_GetFromETicket'; return $this->callMessage($msgName, $options, $messageOptions); @@ -965,7 +978,8 @@ public function pointOfRefSearch(RequestOptions\PointOfRefSearchOptions $options public function ticketCreateTSTFromPricing( RequestOptions\TicketCreateTstFromPricingOptions $options, $messageOptions = [] - ) { + ) + { $msgName = 'Ticket_CreateTSTFromPricing'; return $this->callMessage($msgName, $options, $messageOptions); @@ -984,7 +998,8 @@ public function ticketCreateTSTFromPricing( public function ticketCreateTSMFromPricing( RequestOptions\TicketCreateTsmFromPricingOptions $options, $messageOptions = [] - ) { + ) + { $msgName = 'Ticket_CreateTSMFromPricing'; return $this->callMessage($msgName, $options, $messageOptions); @@ -1003,7 +1018,8 @@ public function ticketCreateTSMFromPricing( public function ticketCreateTSMFareElement( RequestOptions\TicketCreateTsmFareElOptions $options, $messageOptions = [] - ) { + ) + { $msgName = 'Ticket_CreateTSMFareElement'; return $this->callMessage($msgName, $options, $messageOptions); @@ -1022,7 +1038,8 @@ public function ticketCreateTSMFareElement( public function ticketCreateTASF( RequestOptions\TicketCreateTasfOptions $options, $messageOptions = [] - ) { + ) + { $msgName = 'Ticket_CreateTASF'; return $this->callMessage($msgName, $options, $messageOptions); @@ -1109,7 +1126,8 @@ public function ticketDisplayTSMP(RequestOptions\TicketDisplayTsmpOptions $optio public function ticketRetrieveListOfTSM( RequestOptions\TicketRetrieveListOfTSMOptions $options, $messageOptions = [] - ) { + ) + { $msgName = 'Ticket_RetrieveListOfTSM'; return $this->callMessage($msgName, $options, $messageOptions); @@ -1128,7 +1146,8 @@ public function ticketRetrieveListOfTSM( public function ticketDisplayTSMFareElement( RequestOptions\TicketDisplayTsmFareElOptions $options, $messageOptions = [] - ) { + ) + { $msgName = 'Ticket_DisplayTSMFareElement'; return $this->callMessage($msgName, $options, $messageOptions); @@ -1147,7 +1166,8 @@ public function ticketDisplayTSMFareElement( public function ticketCheckEligibility( RequestOptions\TicketCheckEligibilityOptions $options, $messageOptions = [] - ) { + ) + { $msgName = 'Ticket_CheckEligibility'; return $this->callMessage($msgName, $options, $messageOptions); @@ -1166,7 +1186,8 @@ public function ticketCheckEligibility( public function ticketAtcShopperMasterPricerTravelBoardSearch( RequestOptions\TicketAtcShopperMpTbSearchOptions $options, $messageOptions = [] - ) { + ) + { $msgName = 'Ticket_ATCShopperMasterPricerTravelBoardSearch'; return $this->callMessage($msgName, $options, $messageOptions); @@ -1185,7 +1206,8 @@ public function ticketAtcShopperMasterPricerTravelBoardSearch( public function ticketRepricePnrWithBookingClass( RequestOptions\TicketRepricePnrWithBookingClassOptions $options, $messageOptions = [] - ) { + ) + { $msgName = 'Ticket_RepricePNRWithBookingClass'; return $this->callMessage($msgName, $options, $messageOptions); @@ -1204,7 +1226,8 @@ public function ticketRepricePnrWithBookingClass( public function ticketCancelDocument( RequestOptions\TicketCancelDocumentOptions $options, $messageOptions = [] - ) { + ) + { $msgName = 'Ticket_CancelDocument'; return $this->callMessage($msgName, $options, $messageOptions); @@ -1223,7 +1246,8 @@ public function ticketCancelDocument( public function ticketReissueConfirmedPricing( RequestOptions\TicketReissueConfirmedPricingOptions $options, $messageOptions = [] - ) { + ) + { $msgName = 'Ticket_ReissueConfirmedPricing'; return $this->callMessage($msgName, $options, $messageOptions); @@ -1276,7 +1300,8 @@ public function ticketProcessETicket(RequestOptions\TicketProcessETicketOptions public function docIssuanceIssueTicket( RequestOptions\DocIssuanceIssueTicketOptions $options, $messageOptions = [] - ) { + ) + { $msgName = 'DocIssuance_IssueTicket'; return $this->callMessage($msgName, $options, $messageOptions); @@ -1295,7 +1320,8 @@ public function docIssuanceIssueTicket( public function docIssuanceIssueMiscellaneousDocuments( RequestOptions\DocIssuanceIssueMiscDocOptions $options, $messageOptions = [] - ) { + ) + { $msgName = 'DocIssuance_IssueMiscellaneousDocuments'; return $this->callMessage($msgName, $options, $messageOptions); @@ -1314,7 +1340,8 @@ public function docIssuanceIssueMiscellaneousDocuments( public function docIssuanceIssueCombined( RequestOptions\DocIssuanceIssueCombinedOptions $options, $messageOptions = [] - ) { + ) + { $msgName = 'DocIssuance_IssueCombined'; return $this->callMessage($msgName, $options, $messageOptions); @@ -1333,7 +1360,8 @@ public function docIssuanceIssueCombined( public function docRefundInitRefund( RequestOptions\DocRefundInitRefundOptions $options, $messageOptions = [] - ) { + ) + { $msgName = 'DocRefund_InitRefund'; return $this->callMessage($msgName, $options, $messageOptions); @@ -1352,7 +1380,8 @@ public function docRefundInitRefund( public function docRefundIgnoreRefund( RequestOptions\DocRefundIgnoreRefundOptions $options, $messageOptions = [] - ) { + ) + { $msgName = 'DocRefund_IgnoreRefund'; return $this->callMessage($msgName, $options, $messageOptions); @@ -1371,7 +1400,8 @@ public function docRefundIgnoreRefund( public function docRefundUpdateRefund( RequestOptions\DocRefundUpdateRefundOptions $options, $messageOptions = [] - ) { + ) + { $msgName = 'DocRefund_UpdateRefund'; return $this->callMessage($msgName, $options, $messageOptions); @@ -1390,7 +1420,8 @@ public function docRefundUpdateRefund( public function docRefundProcessRefund( RequestOptions\DocRefundProcessRefundOptions $options, $messageOptions = [] - ) { + ) + { $msgName = 'DocRefund_ProcessRefund'; return $this->callMessage($msgName, $options, $messageOptions); @@ -1409,7 +1440,8 @@ public function docRefundProcessRefund( public function ticketInitRefund( RequestOptions\TicketInitRefundOptions $options, $messageOptions = [] - ) { + ) + { $msgName = 'Ticket_InitRefund'; return $this->callMessage($msgName, $options, $messageOptions); @@ -1428,7 +1460,8 @@ public function ticketInitRefund( public function ticketIgnoreRefund( RequestOptions\TicketIgnoreRefundOptions $options, $messageOptions = [] - ) { + ) + { $msgName = 'Ticket_IgnoreRefund'; return $this->callMessage($msgName, $options, $messageOptions); @@ -1447,7 +1480,8 @@ public function ticketIgnoreRefund( public function ticketProcessRefund( RequestOptions\TicketProcessRefundOptions $options, $messageOptions = [] - ) { + ) + { $msgName = 'Ticket_ProcessRefund'; return $this->callMessage($msgName, $options, $messageOptions); @@ -1488,6 +1522,68 @@ public function fopValidateFOP(RequestOptions\FopValidateFopOptions $options, $m return $this->callMessage($msgName, $options, $messageOptions); } + /** + * Hotel_MultiSingleAvailability + * + * @param RequestOptions\HotelMultiSingleAvailOptions $options + * @param array $messageOptions (OPTIONAL) + * @return Result + */ + public function hotelMultiSingleAvailability( + RequestOptions\HotelMultiSingleAvailOptions $options, + $messageOptions = [] + ) { + $msgName = 'Hotel_MultiSingleAvailability'; + + return $this->callMessage($msgName, $options, $messageOptions); + } + + /** + * Hotel_Sell + * + * @param RequestOptions\HotelSellOptions $options + * @param array $messageOptions (OPTIONAL) + * @return Result + */ + public function hotelSell(RequestOptions\HotelSellOptions $options, $messageOptions = []) + { + $msgName = 'Hotel_Sell'; + + return $this->callMessage($msgName, $options, $messageOptions); + } + + /** + * Hotel_DescriptiveInfo + * + * @param RequestOptions\HotelDescriptiveInfoOptions $options + * @param array $messageOptions (OPTIONAL) + * @return Result + */ + public function hotelDescriptionInfo( + RequestOptions\HotelDescriptiveInfoOptions $options, + $messageOptions = [] + ) { + $msgName = 'Hotel_DescriptiveInfo'; + + return $this->callMessage($msgName, $options, $messageOptions); + } + + /** + * Hotel_EnhancedPricing + * + * @param RequestOptions\HotelEnhancedPricingOptions $options + * @param array $messageOptions (OPTIONAL) + * @return Result + */ + public function hotelEnhancedPricing( + RequestOptions\HotelEnhancedPricingOptions $options, + $messageOptions = [] + ) { + $msgName = 'Hotel_EnhancedPricing'; + + return $this->callMessage($msgName, $options, $messageOptions); + } + /** * PriceXplorer_ExtremeSearch * @@ -1501,7 +1597,8 @@ public function fopValidateFOP(RequestOptions\FopValidateFopOptions $options, $m public function priceXplorerExtremeSearch( RequestOptions\PriceXplorerExtremeSearchOptions $options, $messageOptions = [] - ) { + ) + { $msgName = 'PriceXplorer_ExtremeSearch'; return $this->callMessage($msgName, $options, $messageOptions); @@ -1520,7 +1617,8 @@ public function priceXplorerExtremeSearch( public function salesReportsDisplayQueryReport( RequestOptions\SalesReportsDisplayQueryReportOptions $options, $messageOptions = [] - ) { + ) + { $msgName = 'SalesReports_DisplayQueryReport'; return $this->callMessage($msgName, $options, $messageOptions); @@ -1539,7 +1637,8 @@ public function salesReportsDisplayQueryReport( public function serviceIntegratedPricing( RequestOptions\ServiceIntegratedPricingOptions $options, $messageOptions = [] - ) { + ) + { $msgName = 'Service_IntegratedPricing'; return $this->callMessage($msgName, $options, $messageOptions); @@ -1558,12 +1657,31 @@ public function serviceIntegratedPricing( public function serviceIntegratedCatalogue( RequestOptions\ServiceIntegratedCatalogueOptions $options, $messageOptions = [] - ) { + ) + { $msgName = 'Service_IntegratedCatalogue'; return $this->callMessage($msgName, $options, $messageOptions); } + /** + * Service_StandaloneCatalogue + * + * @param RequestOptions\ServiceStandaloneCatalogueOptions $options + * @param array $messageOptions + * (OPTIONAL) + * @return Result + * @throws Client\InvalidMessageException + * @throws Client\RequestCreator\MessageVersionUnsupportedException + * @throws Exception + */ + public function serviceStandaloneCatalogue(RequestOptions\ServiceStandaloneCatalogueOptions $options, $messageOptions = []) + { + $msgName = 'Service_StandaloneCatalogue'; + + return $this->callMessage($msgName, $options, $messageOptions); + } + /** * Call a message with the given parameters * @@ -1635,4 +1753,198 @@ protected function makeMessageOptions(array $incoming, $endSession = false) return $options; } + + /** + * Fare_PriceUpsellWithoutPnr + * + * @param RequestOptions\FareInformativeBestPricingWithoutPnrOptions $options + * @param array $messageOptions (OPTIONAL) + * @return Result + * @throws Client\InvalidMessageException + * @throws Client\RequestCreator\MessageVersionUnsupportedException + * @throws Exception + */ + public function farePriceUpsellWithoutPnr( + RequestOptions\FarePriceUpsellWithoutPNROptions $options, + $messageOptions = [] + ) + { + $msgName = 'Fare_PriceUpsellWithoutPNR'; + + return $this->callMessage($msgName, $options, $messageOptions); + } + + /** + * Profile_ReadProfile + * + * @param RequestOptions\ProfileReadProfileOptions $options + * @param array $messageOptions (OPTIONAL) + * @return Result + * @throws Client\InvalidMessageException + * @throws Client\RequestCreator\MessageVersionUnsupportedException + * @throws Exception + */ + public function profileReadProfile( + RequestOptions\ProfileReadProfileOptions $options, + $messageOptions = [] + ) + { + $msgName = 'Profile_ReadProfile'; + + return $this->callMessage($msgName, $options, $messageOptions); + } + + /** + * Profile_CreateProfile + * + * @param RequestOptions\ProfileReadProfileOptions $options + * @param array $messageOptions (OPTIONAL) + * @return Result + * @throws Client\InvalidMessageException + * @throws Client\RequestCreator\MessageVersionUnsupportedException + * @throws Exception + */ + public function profileCreateProfile( + RequestOptions\ProfileCreateProfileOptions $options, + $messageOptions = [] + ) + { + $msgName = 'Profile_CreateProfile'; + + return $this->callMessage($msgName, $options, $messageOptions); + } + + /** + * Profile_CreateProfile + * + * @param RequestOptions\ProfileReadProfileOptions $options + * @param array $messageOptions (OPTIONAL) + * @return Result + * @throws Client\InvalidMessageException + * @throws Client\RequestCreator\MessageVersionUnsupportedException + * @throws Exception + */ + public function profileDeleteProfile( + RequestOptions\ProfileDeleteProfileOptions $options, + $messageOptions = [] + ) + { + $msgName = 'Profile_DeleteProfile'; + + return $this->callMessage($msgName, $options, $messageOptions); + } + + /** + * Profile_UpdateProfile + * + * @param RequestOptions\ProfileUpdateProfileOptions $options + * @param array $messageOptions (OPTIONAL) + * @return Result + * @throws Client\InvalidMessageException + * @throws Client\RequestCreator\MessageVersionUnsupportedException + * @throws Exception + */ + public function profileUpdateProfile( + RequestOptions\ProfileUpdateProfileOptions $options, + $messageOptions = [] + ) + { + $msgName = 'Profile_UpdateProfile'; + + return $this->callMessage($msgName, $options, $messageOptions); + } + + /** + * PNR_CreateTSM + * + * @param RequestOptions\PnrCreateTsmOptions $options + * @param array $messageOptions (OPTIONAL) + * @return Result + * @throws Client\InvalidMessageException + * @throws Client\RequestCreator\MessageVersionUnsupportedException + * @throws Exception + */ + public function createTasf( + RequestOptions\PnrCreateTsmOptions $options, + $messageOptions = [] + ) + { + $msgName = 'PNR_CreateTSM'; + + return $this->callMessage($msgName, $options, $messageOptions); + } + + /** + * Service_BookPriceProduct + * + * @param RequestOptions\ServiceBookPriceProductOptions $options + * @param array $messageOptions (OPTIONAL) + * @return Result + * @throws Client\InvalidMessageException + * @throws Client\RequestCreator\MessageVersionUnsupportedException + * @throws Exception + */ + public function serviceBookPriceProduct( + RequestOptions\ServiceBookPriceProductOptions $options, + $messageOptions = [] + ) + { + $msgName = 'Service_BookPriceProduct'; + return $this->callMessage($msgName, $options, $messageOptions); + } + + /** + * PNR_DeleteTSM + * + * @param RequestOptions\PnrDeleteTsmOptions $options + * @param array $messageOptions (OPTIONAL) + * @return Result + * @throws Client\InvalidMessageException + * @throws Client\RequestCreator\MessageVersionUnsupportedException + * @throws Exception + */ + public function deleteTsm( + RequestOptions\PnrDeleteTsmOptions $options, + $messageOptions = [] + ) + { + $msgName = 'PNR_DeleteTSM'; + return $this->callMessage($msgName, $options, $messageOptions); + } + + /** + * Fare_GetFareFamilyDescription + * + * @param RequestOptions\PnrDeleteTsmOptions $options + * @param array $messageOptions (OPTIONAL) + * @return Result + * @throws Client\InvalidMessageException + * @throws Client\RequestCreator\MessageVersionUnsupportedException + * @throws Exception + */ + public function FareGetFareFamilyDescription( + RequestOptions\FareGetFareFamilyDescriptionOptions $options, + $messageOptions = [] + ) + { + $msgName = 'Fare_GetFareFamilyDescription'; + return $this->callMessage($msgName, $options, $messageOptions); + } + + /** + * Fare_GetFareFamilyDescription + * + * @param RequestOptions\PAYGetVirtualCreditCardOptions $options + * @param array $messageOptions (OPTIONAL) + * @return Result + * @throws Client\InvalidMessageException + * @throws Client\RequestCreator\MessageVersionUnsupportedException + * @throws Exception + */ + public function PayGetVirtualCreditCard(RequestOptions\PAYGetVirtualCreditCardOptions $options, + $messageOptions = []) + { + $msgName = 'PAY_GetVirtualCreditCard'; + return $this->callMessage($msgName, $options, $messageOptions); + } } diff --git a/src/Amadeus/Client/RequestCreator/Base.php b/src/Amadeus/Client/RequestCreator/Base.php index a04d3d6e4..0f2eefbca 100644 --- a/src/Amadeus/Client/RequestCreator/Base.php +++ b/src/Amadeus/Client/RequestCreator/Base.php @@ -85,10 +85,10 @@ public function __construct(RequestCreatorParams $params) */ public function createRequest($messageName, RequestOptionsInterface $params) { + $this->checkMessageIsInWsdl($messageName); $builder = $this->findBuilderForMessage($messageName); - if ($builder instanceof ConvertInterface) { return $builder->convert($params, $this->getActiveVersionFor($messageName)); } else { @@ -150,16 +150,16 @@ protected function findBuilderForMessage($messageName) ) { $builder = $this->messageBuilders[$messageName]; } else { + $section = substr($messageName, 0, strpos($messageName, '_')); $message = substr($messageName, strpos($messageName, '_') + 1); $builderClass = __NAMESPACE__.'\\Converter\\'.$section.'\\'.$message."Conv"; - + //print_r($builderClass); if (class_exists($builderClass)) { /** @var ConvertInterface $builder */ $builder = new $builderClass(); $builder->setParams($this->params); - $this->messageBuilders[$messageName] = $builder; } } diff --git a/src/Amadeus/Client/RequestCreator/Converter/Fare/GetFareFamilyDescriptionConv.php b/src/Amadeus/Client/RequestCreator/Converter/Fare/GetFareFamilyDescriptionConv.php new file mode 100644 index 000000000..7a7cf2577 --- /dev/null +++ b/src/Amadeus/Client/RequestCreator/Converter/Fare/GetFareFamilyDescriptionConv.php @@ -0,0 +1,22 @@ + + */ +class PriceUpsellWithoutPNRConv extends BaseConverter +{ + /** + * @param FareInformativeBestPricingWithoutPnrOptions $requestOptions + * @param int|string $version + * @return Struct\Fare\InformativePriceUpsellWithoutPNR15|Struct\Fare\InformativePriceUpsellWithoutPNR16 + */ + public function convert($requestOptions, $version) + { + if (floatval($version) < floatval(16)) { + return new Struct\Fare\InformativePriceUpsellWithoutPNR15($requestOptions); + } else { + return new Struct\Fare\InformativePriceUpsellWithoutPNR16($requestOptions); + } + } +} diff --git a/src/Amadeus/Client/RequestCreator/Converter/Hotel/DescriptiveInfoConv.php b/src/Amadeus/Client/RequestCreator/Converter/Hotel/DescriptiveInfoConv.php new file mode 100644 index 000000000..45ee621a9 --- /dev/null +++ b/src/Amadeus/Client/RequestCreator/Converter/Hotel/DescriptiveInfoConv.php @@ -0,0 +1,20 @@ + + */ +class MultiSingleAvailabilityConv extends BaseConverter +{ + /** + * @param HotelMultiSingleAvailOptions $requestOptions + * @param int|string $version + * @return Struct\Hotel\MultiSingleAvailability + */ + public function convert($requestOptions, $version) + { + return new Struct\Hotel\MultiSingleAvailability($requestOptions); + } +} diff --git a/src/Amadeus/Client/RequestCreator/Converter/Hotel/SellConv.php b/src/Amadeus/Client/RequestCreator/Converter/Hotel/SellConv.php new file mode 100644 index 000000000..c55e9300e --- /dev/null +++ b/src/Amadeus/Client/RequestCreator/Converter/Hotel/SellConv.php @@ -0,0 +1,46 @@ + + */ +class SellConv extends BaseConverter +{ + /** + * @param HotelSellOptions $requestOptions + * @param int|string $version + * @return Struct\Hotel\Sell + */ + public function convert($requestOptions, $version) + { + return new Struct\Hotel\Sell($requestOptions); + } +} diff --git a/src/Amadeus/Client/RequestCreator/Converter/PAY/GetVirtualCreditCardConv.php b/src/Amadeus/Client/RequestCreator/Converter/PAY/GetVirtualCreditCardConv.php new file mode 100644 index 000000000..075df6cbb --- /dev/null +++ b/src/Amadeus/Client/RequestCreator/Converter/PAY/GetVirtualCreditCardConv.php @@ -0,0 +1,19 @@ + + */ +class StandaloneCatalogueConv extends BaseConverter +{ + /** + * @param ServiceIntegratedCatalogueOptions $requestOptions + * @param int|string $version + * @return Struct\Service\StandaloneCatalogue + */ + public function convert($requestOptions, $version) + { + return new Struct\Service\StandaloneCatalogue($requestOptions); + } +} diff --git a/src/Amadeus/Client/RequestOptions/DocIssuanceIssueCombinedOptions.php b/src/Amadeus/Client/RequestOptions/DocIssuanceIssueCombinedOptions.php index 0df59cf8e..dd828754a 100644 --- a/src/Amadeus/Client/RequestOptions/DocIssuanceIssueCombinedOptions.php +++ b/src/Amadeus/Client/RequestOptions/DocIssuanceIssueCombinedOptions.php @@ -38,4 +38,12 @@ class DocIssuanceIssueCombinedOptions extends DocIssuanceIssueTicketOptions * @var int[] */ public $tsmTattoos = []; + + public $emds=[]; + + public $svcs=[]; + + public $cup=[]; + + public $segs=[]; } diff --git a/src/Amadeus/Client/RequestOptions/DocIssuanceIssueMiscDocOptions.php b/src/Amadeus/Client/RequestOptions/DocIssuanceIssueMiscDocOptions.php index f8983a1e2..f8aacd99f 100644 --- a/src/Amadeus/Client/RequestOptions/DocIssuanceIssueMiscDocOptions.php +++ b/src/Amadeus/Client/RequestOptions/DocIssuanceIssueMiscDocOptions.php @@ -32,34 +32,36 @@ */ class DocIssuanceIssueMiscDocOptions extends Base { - const PAX_TYPE_ADULT = 'A'; - const PAX_TYPE_INFANT = 'IN'; - - const OPTION_TEMPLATE_DISPLAY = 'TMD'; - const OPTION_TEMPLATE_OVERRIDE = 'TMO'; + public $selection; + public $optionGroup; +// const PAX_TYPE_ADULT = 'A'; +// const PAX_TYPE_INFANT = 'IN'; +// +// const OPTION_TEMPLATE_DISPLAY = 'TMD'; +// const OPTION_TEMPLATE_OVERRIDE = 'TMO'; const OPTION_EMD_ISSUANCE = 'ED'; - const OPTION_RETRIEVE_PNR = 'RT'; - const OPTION_BASIC_INVOICE = 'INV'; - const OPTION_BASIC_JOINT_INVOICE_ALL_PAX = 'IVJ'; - const OPTION_EXTENDED_INVOICE = 'INE'; - const OPTION_EXTENDED_INVOICE_ALL_PAX = 'INJ'; - const OPTION_CONCEALED_CREDIT_CARD = 'CCC'; - const OPTION_CREDIT_CARD_OVERRIDE = 'CCO'; - const OPTION_DOCUMENT_RECEIPT = 'TRP'; - const OPTION_ELECTRONIC_TICKETING_TCH = 'TKP'; - const OPTION_GROUP_ISSUANCE = 'GRP'; - const OPTION_PRINT_EXTENDED_ITINERARY = 'IEP'; - const OPTION_ITINERARY_RECEIPT = 'ITR'; - const OPTION_HOTEL_TERMS = 'HT'; - const OPTION_INHIBIT_CCCF_COUPON_PRINT = 'ICP'; - const OPTION_NO_CREDIT = 'NCC'; - const OPTION_OVERRIDE_NON_EXCHANGEABLE_IND = 'ONX'; - const OPTION_OVERRIDE_NAME_CHECK = 'ONC'; - const OPTION_PAPER_OVERRIDE = 'PT'; - const OPTION_FORCE_PASSENGER_RECEIPT = 'CR'; - const OPTION_PAYMENT_ON_DEMAND = 'POD'; - const OPTION_PRE_ISSUE_VALIDATION = 'TKT'; - const OPTION_PRESENT_CREDIT_CARD = 'PCC'; +// const OPTION_RETRIEVE_PNR = 'RT'; +// const OPTION_BASIC_INVOICE = 'INV'; +// const OPTION_BASIC_JOINT_INVOICE_ALL_PAX = 'IVJ'; +// const OPTION_EXTENDED_INVOICE = 'INE'; +// const OPTION_EXTENDED_INVOICE_ALL_PAX = 'INJ'; +// const OPTION_CONCEALED_CREDIT_CARD = 'CCC'; +// const OPTION_CREDIT_CARD_OVERRIDE = 'CCO'; +// const OPTION_DOCUMENT_RECEIPT = 'TRP'; +// const OPTION_ELECTRONIC_TICKETING_TCH = 'TKP'; +// const OPTION_GROUP_ISSUANCE = 'GRP'; +// const OPTION_PRINT_EXTENDED_ITINERARY = 'IEP'; +// const OPTION_ITINERARY_RECEIPT = 'ITR'; +// const OPTION_HOTEL_TERMS = 'HT'; +// const OPTION_INHIBIT_CCCF_COUPON_PRINT = 'ICP'; +// const OPTION_NO_CREDIT = 'NCC'; +// const OPTION_OVERRIDE_NON_EXCHANGEABLE_IND = 'ONX'; +// const OPTION_OVERRIDE_NAME_CHECK = 'ONC'; +// const OPTION_PAPER_OVERRIDE = 'PT'; +// const OPTION_FORCE_PASSENGER_RECEIPT = 'CR'; +// const OPTION_PAYMENT_ON_DEMAND = 'POD'; +// const OPTION_PRE_ISSUE_VALIDATION = 'TKT'; +// const OPTION_PRESENT_CREDIT_CARD = 'PCC'; /** * The Ticket Issuance options to be triggered @@ -104,62 +106,69 @@ class DocIssuanceIssueMiscDocOptions extends Base * @var string[] */ public $options = []; - - /** - * The list of TSM numbers to be ticketed - * - * @var int[] - */ - public $tsmNumbers = []; - - /** - * The list of TSM tattoos to be ticketed - * - * @var int[] - */ - public $tsmTattoos = []; - - /** - * Line Number Selection - * - * @var int[] - */ - public $lineNumbers = []; - - /** - * Passenger numbers to be ticketed - * - * @var int[] - */ - public $passengerNumbers = []; - - /** - * Tattoos of passengers to be ticketed - * - * @var int[] - */ - public $passengerTattoos = []; - - /** - * PAX Passenger Type Selection - * - * self::PAX_TYPE_* - * - * @var string - */ - public $passengerType; - - /** - * Stock Reference - * - * @var string - */ - public $stockReference; - - /** - * Compound Options - * - * @var CompoundOption[] - */ - public $compoundOptions = []; +// +// /** +// * The list of TSM numbers to be ticketed +// * +// * @var int[] +// */ +// public $tsmNumbers = []; +// +// /** +// * The list of TSM tattoos to be ticketed +// * +// * @var int[] +// */ +// public $tsmTattoos = []; +// +// /** +// * Line Number Selection +// * +// * @var int[] +// */ +// public $lineNumbers = []; +// +// /** +// * Passenger numbers to be ticketed +// * +// * @var int[] +// */ +// public $passengerNumbers = []; +// +// /** +// * Tattoos of passengers to be ticketed +// * +// * @var int[] +// */ +// public $passengerTattoos = []; +// +// /** +// * PAX Passenger Type Selection +// * +// * self::PAX_TYPE_* +// * +// * @var string +// */ +// public $passengerType; +// +// /** +// * Stock Reference +// * +// * @var string +// */ +// public $stockReference; +// +// /** +// * Compound Options +// * +// * @var CompoundOption[] +// */ +// public $compoundOptions = []; +// +// /** +// * The list of Emd tattoos to be ticketed +// * +// * @var int[] +// */ +// public $emdTattoos = []; } diff --git a/src/Amadeus/Client/RequestOptions/Fare/InformativePricing/Segment.php b/src/Amadeus/Client/RequestOptions/Fare/InformativePricing/Segment.php index fdf8b0143..69961d5e7 100644 --- a/src/Amadeus/Client/RequestOptions/Fare/InformativePricing/Segment.php +++ b/src/Amadeus/Client/RequestOptions/Fare/InformativePricing/Segment.php @@ -129,4 +129,5 @@ class Segment extends LoadParamsFromArray * @var array */ public $inventory = []; + } diff --git a/src/Amadeus/Client/RequestOptions/Fare/MPItinerary.php b/src/Amadeus/Client/RequestOptions/Fare/MPItinerary.php index 945591995..79a51d977 100644 --- a/src/Amadeus/Client/RequestOptions/Fare/MPItinerary.php +++ b/src/Amadeus/Client/RequestOptions/Fare/MPItinerary.php @@ -160,4 +160,8 @@ class MPItinerary extends LoadParamsFromArray * @var string */ public $cabinOption; + + public $flightInfoPNR; + public $requestedSegmentAction; + } diff --git a/src/Amadeus/Client/RequestOptions/Fare/MPPassenger.php b/src/Amadeus/Client/RequestOptions/Fare/MPPassenger.php index e6e50fac6..2c77fd3fc 100644 --- a/src/Amadeus/Client/RequestOptions/Fare/MPPassenger.php +++ b/src/Amadeus/Client/RequestOptions/Fare/MPPassenger.php @@ -45,9 +45,16 @@ class MPPassenger extends LoadParamsFromArray /** * What type of passengers? self::TYPE_* * - * @var string + * @var Array */ - public $type; + public $type=[]; + + /** + * If it's resident search* + * + * @var bool + */ + public $isresident; /** * How many passengers of this type ? diff --git a/src/Amadeus/Client/RequestOptions/FareGetFareFamilyDescriptionOptions.php b/src/Amadeus/Client/RequestOptions/FareGetFareFamilyDescriptionOptions.php new file mode 100644 index 000000000..622e1d625 --- /dev/null +++ b/src/Amadeus/Client/RequestOptions/FareGetFareFamilyDescriptionOptions.php @@ -0,0 +1,24 @@ + $propValue) { + if (property_exists($this, $propName)) { + $this->$propName = $propValue; + } + } + } +} \ No newline at end of file diff --git a/src/Amadeus/Client/RequestOptions/FareInformativePricingWithoutPnrOptions.php b/src/Amadeus/Client/RequestOptions/FareInformativePricingWithoutPnrOptions.php index 5f9d81025..8cdb03fc5 100644 --- a/src/Amadeus/Client/RequestOptions/FareInformativePricingWithoutPnrOptions.php +++ b/src/Amadeus/Client/RequestOptions/FareInformativePricingWithoutPnrOptions.php @@ -46,4 +46,9 @@ class FareInformativePricingWithoutPnrOptions extends Base * @var Fare\InformativePricing\PricingOptions */ public $pricingOptions; + + /** + * @var Fare\InformativePricing\PricingOptions[] + */ + public $pricingOptionsArray = []; } diff --git a/src/Amadeus/Client/RequestOptions/FarePricePnrWithBookingClassOptions.php b/src/Amadeus/Client/RequestOptions/FarePricePnrWithBookingClassOptions.php index 549717c68..1154939a2 100644 --- a/src/Amadeus/Client/RequestOptions/FarePricePnrWithBookingClassOptions.php +++ b/src/Amadeus/Client/RequestOptions/FarePricePnrWithBookingClassOptions.php @@ -271,4 +271,6 @@ class FarePricePnrWithBookingClassOptions extends Base * @var PaxSegRef[] */ public $references = []; + + public $priceOptions = []; } diff --git a/src/Amadeus/Client/RequestOptions/FarePriceUpsellWithoutPNROptions.php b/src/Amadeus/Client/RequestOptions/FarePriceUpsellWithoutPNROptions.php new file mode 100644 index 000000000..d65acfbdc --- /dev/null +++ b/src/Amadeus/Client/RequestOptions/FarePriceUpsellWithoutPNROptions.php @@ -0,0 +1,33 @@ + + */ +class FarePriceUpsellWithoutPNROptions extends FareInformativePricingWithoutPnrOptions +{ +} diff --git a/src/Amadeus/Client/RequestOptions/Fop/MopInfo.php b/src/Amadeus/Client/RequestOptions/Fop/MopInfo.php index 164fc9d0e..2976cecdd 100644 --- a/src/Amadeus/Client/RequestOptions/Fop/MopInfo.php +++ b/src/Amadeus/Client/RequestOptions/Fop/MopInfo.php @@ -35,7 +35,7 @@ class MopInfo extends LoadParamsFromArray const STATUS_NEW = "N"; const STATUS_OLD = "O"; - const ENCODING_MUTUAL = "ZZZ"; + const ENCODING_MUTUAL = "1"; const FOPTYPE_AUTHORIZATION_ONLY = "AO"; const FOPTYPE_FC_ELEMENT = "FC"; diff --git a/src/Amadeus/Client/RequestOptions/Hotel/MultiSingleAvail/Criteria.php b/src/Amadeus/Client/RequestOptions/Hotel/MultiSingleAvail/Criteria.php new file mode 100644 index 000000000..4da5eaa1e --- /dev/null +++ b/src/Amadeus/Client/RequestOptions/Hotel/MultiSingleAvail/Criteria.php @@ -0,0 +1,77 @@ + + */ +class Criteria extends LoadParamsFromArray +{ + const ALT_AVAIL_NEVER = "Never"; + + /** + * @var bool + */ + public $exactMatch; + + /** + * @var HotelReference[] + */ + public $hotelReferences = []; + + /** + * @var \DateTime + */ + public $stayStart; + + /** + * @var \DateTime + */ + public $stayEnd; + + /** + * @var Rates[] + */ + public $rates = []; + + /** + * @var Room[] + */ + public $rooms = []; + + /** + * self::ALT_AVAIL_* + * + * @var string + */ + public $alternateAvailability; + + public $Radius; + + public $Position; +} diff --git a/src/Amadeus/Client/RequestOptions/Hotel/MultiSingleAvail/Guest.php b/src/Amadeus/Client/RequestOptions/Hotel/MultiSingleAvail/Guest.php new file mode 100644 index 000000000..fd79a7567 --- /dev/null +++ b/src/Amadeus/Client/RequestOptions/Hotel/MultiSingleAvail/Guest.php @@ -0,0 +1,71 @@ + + */ +class Guest extends LoadParamsFromArray +{ + const OCCUPANT_OVER_21 = 1; + const OCCUPANT_OVER_65 = 2; + const OCCUPANT_UNDER_2 = 3; + const OCCUPANT_UNDER_12 = 4; + const OCCUPANT_UNDER_17 = 5; + const OCCUPANT_UNDER_21 = 6; + const OCCUPANT_INFANT = 7; + const OCCUPANT_CHILD = 8; + const OCCUPANT_TEENAGER = 9; + const OCCUPANT_ADULT = 10; + const OCCUPANT_SENIOR = 11; + const OCCUPANT_ADDITIONAL_WITH_ADULT = 12; + const OCCUPANT_ADDITIONAL_WITHOUT_ADULT = 13; + const OCCUPANT_FREE_CHILD = 14; + const OCCUPANT_FREE_ADULT = 15; + const OCCUPANT_YOUNG_DRIVER = 16; + const OCCUPANT_YOUNGER_DRIVER = 17; + const OCCUPANT_UNDER_10 = 18; + + /** + * Age Qualifying code + * + * self::OCCUPANT_* + * + * @var string + */ + public $occupantCode; + + /** + * How many guests? + * + * @var int + */ + public $amount; + + public $Age; +} diff --git a/src/Amadeus/Client/RequestOptions/Hotel/MultiSingleAvail/HotelReference.php b/src/Amadeus/Client/RequestOptions/Hotel/MultiSingleAvail/HotelReference.php new file mode 100644 index 000000000..709921772 --- /dev/null +++ b/src/Amadeus/Client/RequestOptions/Hotel/MultiSingleAvail/HotelReference.php @@ -0,0 +1,59 @@ + + */ +class HotelReference extends LoadParamsFromArray +{ + /** + * @var string + */ + public $chainCode; + + /** + * @var string + */ + public $cityCode; + + /** + * @var string + */ + public $name; + + /** + * @var string + */ + public $hotelCode; + + /** + * @var string + */ + public $codeContext; +} diff --git a/src/Amadeus/Client/RequestOptions/Hotel/MultiSingleAvail/Rates.php b/src/Amadeus/Client/RequestOptions/Hotel/MultiSingleAvail/Rates.php new file mode 100644 index 000000000..a5ff09dc4 --- /dev/null +++ b/src/Amadeus/Client/RequestOptions/Hotel/MultiSingleAvail/Rates.php @@ -0,0 +1,67 @@ + + */ +class Rates extends LoadParamsFromArray +{ + const TIMEUNIT_YEAR = "Year"; + const TIMEUNIT_MONTH = "Month"; + const TIMEUNIT_WEEK = "Week"; + const TIMEUNIT_DAY = "Day"; + const TIMEUNIT_HOUR = "Hour"; + const TIMEUNIT_SECOND = "Second"; + const TIMEUNIT_FULL_DURATION = "FullDuration"; + const TIMEUNIT_MINUTE = "Minute"; + + /** + * @var double + */ + public $min; + + /** + * @var double + */ + public $max; + + /** + * self::TIMEUNIT_* + * + * @var string + */ + public $timeUnit; + + /** + * 3-character ISO currency code + * + * @var string + */ + public $currency; +} diff --git a/src/Amadeus/Client/RequestOptions/Hotel/MultiSingleAvail/Room.php b/src/Amadeus/Client/RequestOptions/Hotel/MultiSingleAvail/Room.php new file mode 100644 index 000000000..105cdb643 --- /dev/null +++ b/src/Amadeus/Client/RequestOptions/Hotel/MultiSingleAvail/Room.php @@ -0,0 +1,60 @@ + + */ +class Room extends LoadParamsFromArray +{ + /** + * Your unique ID for this room request + * + * @var int + */ + public $id; + + /** + * How many rooms? + * + * @var int + */ + public $amount; + + /** + * All guests share the same room? + * + * @var bool + */ + public $guestsIsPerRoom = true; + + /** + * @var Guest[] + */ + public $guests = []; +} diff --git a/src/Amadeus/Client/RequestOptions/Hotel/MultiSingleAvail/Segment.php b/src/Amadeus/Client/RequestOptions/Hotel/MultiSingleAvail/Segment.php new file mode 100644 index 000000000..9600f83bd --- /dev/null +++ b/src/Amadeus/Client/RequestOptions/Hotel/MultiSingleAvail/Segment.php @@ -0,0 +1,62 @@ + + */ +class Segment extends LoadParamsFromArray +{ + const SOURCE_LEISURE = "Leisure"; + const SOURCE_DISTRIBUTION = "Distribution"; + const SOURCE_MULTI_SOURCE = "MultiSource"; + + /** + * self::SOURCE_* + * + * @var string + */ + public $infoSource; + + /** + * @var bool + */ + public $bestOnly; + + /** + * @var bool + */ + public $availableOnly; + + /** + * @var Criteria[] + */ + public $criteria = []; + + public $MoreDataEchoToken; +} diff --git a/src/Amadeus/Client/RequestOptions/Hotel/Sell/Booker.php b/src/Amadeus/Client/RequestOptions/Hotel/Sell/Booker.php new file mode 100644 index 000000000..384108e31 --- /dev/null +++ b/src/Amadeus/Client/RequestOptions/Hotel/Sell/Booker.php @@ -0,0 +1,63 @@ + + */ +class Booker extends LoadParamsFromArray +{ + /** + * Number of travellers + * + * @var int + */ + public $travellerCount = 1; + + /** + * @var string + */ + public $firstName; + + /** + * @var string + */ + public $lastName; + + /** + * @var string + */ + public $title; + + /** + * Gender - 'M' or 'F' + * + * @var string + */ + public $gender; +} diff --git a/src/Amadeus/Client/RequestOptions/Hotel/Sell/BookingCompany.php b/src/Amadeus/Client/RequestOptions/Hotel/Sell/BookingCompany.php new file mode 100644 index 000000000..61d54564a --- /dev/null +++ b/src/Amadeus/Client/RequestOptions/Hotel/Sell/BookingCompany.php @@ -0,0 +1,53 @@ + + */ +class BookingCompany extends LoadParamsFromArray +{ + const TYPE_BRAND = "BRA"; + const TYPE_CORPORATION_NAME = "CORP"; + const TYPE_SUB_BRAND = "SBR"; + const TYPE_SUB_SUB_BRAND = "SSB"; + + /** + * self::TYPE_* + * + * @var string + */ + public $type; + + /** + * The name of the booking company + * + * @var string + */ + public $name; +} diff --git a/src/Amadeus/Client/RequestOptions/HotelDescriptiveInfoOptions.php b/src/Amadeus/Client/RequestOptions/HotelDescriptiveInfoOptions.php new file mode 100644 index 000000000..d01c63735 --- /dev/null +++ b/src/Amadeus/Client/RequestOptions/HotelDescriptiveInfoOptions.php @@ -0,0 +1,19 @@ + + */ +class HotelMultiSingleAvailOptions extends Base +{ + const SORT_NONE = "N"; + const SORT_CHEAPEST_FIRST = "RA"; + const SORT_CHEAPEST_LAST = "RD"; + const SORT_PROPERTY_CODE_ALPHABETIC = "CA"; + const SORT_PROPERTY_CODE_REVERSE = "CD"; + const SORT_PROPERTY_NAME_ALPHABETIC = "PA"; + const SORT_PROPERTY_NAME_REVERSE = "PD"; + + const CACHE_LIVE = "Live"; + const CACHE_ONLY = "LessRecent"; + const CACHE_OR_AGGREGATOR = "VeryRecent"; + + /** + * Hotel segments availability requested + * + * @var Hotel\MultiSingleAvail\Segment[] + */ + public $segments = []; + + /** + * Return only rates that are available within the range of the minimum and maximum amount specified + * + * @var bool + */ + public $rateRangeOnly = true; + + /** + * Summary information in the response? + * + * @var bool + */ + public $summaryOnly = true; + + /** + * Should response contain room rate details? + * + * @var bool + */ + public $rateDetails = true; + + /** + * 2-character currency code + * + * @var string + */ + public $requestedCurrency; + + /** + * 2-character language code + * + * @var string + */ + public $languageCode; + + /** + * Include ONLY those rates that are available in the date range specified? + * + * @var bool + */ + public $availableRatesOnly; + + /** + * @var string + */ + public $version = "4.000"; + + /** + * Show only those rates that are an exact match to the requested criteria? + * + * @var bool + */ + public $exactMatchOnly; + + /** + * Sort order of the returned property information + * + * self::SORT_* + * + * @var string + */ + public $sortOrder; + + /** + * How many results? + * + * @var int + */ + public $maxResponses; + + /** + * What caching level to be used + * + * self::CACHE_* + * + * @var string + */ + public $searchCacheLevel; + + public $xmlns; +} diff --git a/src/Amadeus/Client/RequestOptions/HotelSellOptions.php b/src/Amadeus/Client/RequestOptions/HotelSellOptions.php new file mode 100644 index 000000000..40d19e035 --- /dev/null +++ b/src/Amadeus/Client/RequestOptions/HotelSellOptions.php @@ -0,0 +1,64 @@ + + */ +class HotelSellOptions extends Base +{ + const DELIVER_ERETAIL = "AERE"; + const DELIVER_ETRAVEL_MANAGEMENT = "AETM"; + const DELIVER_COMMAND_PAGE = "COMM"; + const DELIVER_SELL2_SELL_CONNECT = "SECO"; + const DELIVER_SELLING_PLATFORM_CLASSIC = "SELL"; + const DELIVER_NON_SPECIFIC_PRODUCT_FROM_SEL = "SEP"; + const DELIVER_WEBSERVICES = "WEBS"; + + /** + * Booking system identifier + * + * self::DELIVER_* + * + * @var string + */ + public $deliveringSystem; + + /** + * @var BookingCompany[] + */ + public $bookingCompany = []; + + /** + * @var Booker + */ + public $booker; + + public $roomStayData = []; +} diff --git a/src/Amadeus/Client/RequestOptions/PAYGetVirtualCreditCardOptions.php b/src/Amadeus/Client/RequestOptions/PAYGetVirtualCreditCardOptions.php new file mode 100644 index 000000000..2dac64965 --- /dev/null +++ b/src/Amadeus/Client/RequestOptions/PAYGetVirtualCreditCardOptions.php @@ -0,0 +1,16 @@ + $propValue) { + if (property_exists($this, $propName)) { + $this->$propName = $propValue; + } + } + } +} \ No newline at end of file diff --git a/src/Amadeus/Client/RequestOptions/PnrDeleteTsmOptions.php b/src/Amadeus/Client/RequestOptions/PnrDeleteTsmOptions.php new file mode 100644 index 000000000..38656518b --- /dev/null +++ b/src/Amadeus/Client/RequestOptions/PnrDeleteTsmOptions.php @@ -0,0 +1,25 @@ + $propValue) { + if (property_exists($this, $propName)) { + $this->$propName = $propValue; + } + } + } +} \ No newline at end of file diff --git a/src/Amadeus/Client/RequestOptions/ProfileCreateProfileOptions.php b/src/Amadeus/Client/RequestOptions/ProfileCreateProfileOptions.php new file mode 100644 index 000000000..1ca5ea486 --- /dev/null +++ b/src/Amadeus/Client/RequestOptions/ProfileCreateProfileOptions.php @@ -0,0 +1,33 @@ + $propValue) { + if (property_exists($this, $propName)) { + $this->$propName = $propValue; + } + } + } +} \ No newline at end of file diff --git a/src/Amadeus/Client/RequestOptions/ProfileDeleteProfileOptions.php b/src/Amadeus/Client/RequestOptions/ProfileDeleteProfileOptions.php new file mode 100644 index 000000000..9403dcd83 --- /dev/null +++ b/src/Amadeus/Client/RequestOptions/ProfileDeleteProfileOptions.php @@ -0,0 +1,31 @@ + $propValue) { + if (property_exists($this, $propName)) { + $this->$propName = $propValue; + } + } + } +} \ No newline at end of file diff --git a/src/Amadeus/Client/RequestOptions/ProfileReadProfileOptions.php b/src/Amadeus/Client/RequestOptions/ProfileReadProfileOptions.php new file mode 100644 index 000000000..e0c66598c --- /dev/null +++ b/src/Amadeus/Client/RequestOptions/ProfileReadProfileOptions.php @@ -0,0 +1,31 @@ + $propValue) { + if (property_exists($this, $propName)) { + $this->$propName = $propValue; + } + } + } +} \ No newline at end of file diff --git a/src/Amadeus/Client/RequestOptions/ProfileUpdateProfileOptions.php b/src/Amadeus/Client/RequestOptions/ProfileUpdateProfileOptions.php new file mode 100644 index 000000000..4a946a01b --- /dev/null +++ b/src/Amadeus/Client/RequestOptions/ProfileUpdateProfileOptions.php @@ -0,0 +1,31 @@ + $propValue) { + if (property_exists($this, $propName)) { + $this->$propName = $propValue; + } + } + } +} \ No newline at end of file diff --git a/src/Amadeus/Client/RequestOptions/Service/StandaloneCatalogue/Passenger.php b/src/Amadeus/Client/RequestOptions/Service/StandaloneCatalogue/Passenger.php new file mode 100755 index 000000000..cec6e55a8 --- /dev/null +++ b/src/Amadeus/Client/RequestOptions/Service/StandaloneCatalogue/Passenger.php @@ -0,0 +1,59 @@ + + */ +class Passenger extends LoadParamsFromArray +{ + const TYPE_ADULT = "ADT"; + + const TYPE_CHILD = "CH"; + + const TYPE_INFANT = "INF"; + + const TYPE_INFANT_WITH_SEAT = "INS"; + + /** + * What type of passengers? + * + * @see self::TYPE_* + * @var string + */ + public $type; + + /** + * Specifies the passenger index + * + * If you have 3 passengers of this type, you need to provide 3 unique passenger index. + * + * @var int + */ + public $reference; +} diff --git a/src/Amadeus/Client/RequestOptions/ServiceBookPriceProductOptions.php b/src/Amadeus/Client/RequestOptions/ServiceBookPriceProductOptions.php new file mode 100644 index 000000000..f568de909 --- /dev/null +++ b/src/Amadeus/Client/RequestOptions/ServiceBookPriceProductOptions.php @@ -0,0 +1,27 @@ + $propValue) { + if (property_exists($this, $propName)) { + $this->$propName = $propValue; + } + } + } +} \ No newline at end of file diff --git a/src/Amadeus/Client/RequestOptions/ServiceIntegratedPricingOptions.php b/src/Amadeus/Client/RequestOptions/ServiceIntegratedPricingOptions.php old mode 100644 new mode 100755 index 97a4eb290..a1f1bebf6 --- a/src/Amadeus/Client/RequestOptions/ServiceIntegratedPricingOptions.php +++ b/src/Amadeus/Client/RequestOptions/ServiceIntegratedPricingOptions.php @@ -93,6 +93,13 @@ class ServiceIntegratedPricingOptions extends Base */ public $overrideOptions = []; + /** + * Provide a fare basis to price with + * + * @var pricingsFareBasis[] + */ + public $pricingsFareBasis = []; + /** * self::AWARDPRICING_* * @@ -166,4 +173,6 @@ class ServiceIntegratedPricingOptions extends Base * @var PaxSegRef[] */ public $references = []; + + public $overrideOptionsWithCriteria=[]; } diff --git a/src/Amadeus/Client/RequestOptions/ServiceStandaloneCatalogueOptions.php b/src/Amadeus/Client/RequestOptions/ServiceStandaloneCatalogueOptions.php new file mode 100755 index 000000000..ebc6b3822 --- /dev/null +++ b/src/Amadeus/Client/RequestOptions/ServiceStandaloneCatalogueOptions.php @@ -0,0 +1,37 @@ + + */ +class ServiceStandaloneCatalogueOptions extends Base +{ + public $passengers = []; + + public $segments = []; + + public $pricingOptions; +} diff --git a/src/Amadeus/Client/RequestOptions/TicketProcessEDocOptions.php b/src/Amadeus/Client/RequestOptions/TicketProcessEDocOptions.php index 9c69f029a..8561471c4 100644 --- a/src/Amadeus/Client/RequestOptions/TicketProcessEDocOptions.php +++ b/src/Amadeus/Client/RequestOptions/TicketProcessEDocOptions.php @@ -53,7 +53,7 @@ class TicketProcessEDocOptions extends Base * * @var string */ - public $ticketNumber; + public $ticketNumber=[]; /** diff --git a/src/Amadeus/Client/ResponseHandler/Base.php b/src/Amadeus/Client/ResponseHandler/Base.php index 0071fa515..276024ef2 100644 --- a/src/Amadeus/Client/ResponseHandler/Base.php +++ b/src/Amadeus/Client/ResponseHandler/Base.php @@ -62,7 +62,6 @@ public function analyzeResponse($sendResult, $messageName) } $handler = $this->findHandlerForMessage($messageName); - if ($handler instanceof MessageResponseHandler) { return $handler->analyze($sendResult); } else { diff --git a/src/Amadeus/Client/ResponseHandler/Hotel/HandlerMultiSingleAvailability.php b/src/Amadeus/Client/ResponseHandler/Hotel/HandlerMultiSingleAvailability.php new file mode 100644 index 000000000..358e65711 --- /dev/null +++ b/src/Amadeus/Client/ResponseHandler/Hotel/HandlerMultiSingleAvailability.php @@ -0,0 +1,54 @@ + + */ +class HandlerMultiSingleAvailability extends StandardResponseHandler +{ + const Q_ERR_CODE = "/m:OTA_HotelAvailRS/m:Errors/m:Error/@Code"; + const Q_ERR_SRC = "/m:OTA_HotelAvailRS/m:Errors/m:Error/@Status"; + const Q_ERR_MSG = "/m:OTA_HotelAvailRS/m:Errors/m:Error/@ShortText"; + + /** + * @param SendResult $response + * @return Result + */ + public function analyze(SendResult $response) + { + return $this->analyzeWithErrorCodeMsgQuerySource( + $response, + self::Q_ERR_CODE, + self::Q_ERR_MSG, + self::Q_ERR_SRC + ); + } +} diff --git a/src/Amadeus/Client/ResponseHandler/Hotel/HandlerSell.php b/src/Amadeus/Client/ResponseHandler/Hotel/HandlerSell.php new file mode 100644 index 000000000..f13c31447 --- /dev/null +++ b/src/Amadeus/Client/ResponseHandler/Hotel/HandlerSell.php @@ -0,0 +1,48 @@ + + */ +class HandlerSell extends StandardResponseHandler +{ + const Q_ERR_CODE = "/m:OTA_HotelAvailRS/m:Errors/m:Error/@Code"; + const Q_ERR_SRC = "/m:OTA_HotelAvailRS/m:Errors/m:Error/@Status"; + const Q_ERR_MSG = "/m:OTA_HotelAvailRS/m:Errors/m:Error/@ShortText"; + /** + * @param SendResult $response + * @return Result + */ + public function analyze(SendResult $response) + { + return $this->analyzeSimpleResponseErrorCodeAndMessage($response); + } +} diff --git a/src/Amadeus/Client/ResponseHandler/StandardResponseHandler.php b/src/Amadeus/Client/ResponseHandler/StandardResponseHandler.php index 799850817..cf2d9ffaa 100644 --- a/src/Amadeus/Client/ResponseHandler/StandardResponseHandler.php +++ b/src/Amadeus/Client/ResponseHandler/StandardResponseHandler.php @@ -322,4 +322,45 @@ function ($item) { ) ); } + + protected function analyzeWithErrorCodeMsgQuerySource(SendResult $response, $qErr, $qMsg, $qSrc) + { + $analyzeResponse = new Result($response); + + $domXpath = $this->makeDomXpath($response->responseXml); + $errorCodeNodeList = $domXpath->query($qErr); + // print_r(); + $errorMsgNodeList = $domXpath->query($qMsg); + + if ($errorCodeNodeList->length > 0 || $errorMsgNodeList->length > 0) { + $analyzeResponse->status = $analyzeResponse->status; + + $errorCode = ($errorCodeNodeList->length > 0) ? $errorCodeNodeList->item(0)->nodeValue : null; + + $analyzeResponse->messages[] = new Result\NotOk( + $errorCode, + $this->makeMessageFromMessagesNodeList($errorMsgNodeList)); + } + if ($errorCodeNodeList->length > 0) { + $analyzeResponse->status = Result::STATUS_ERROR; + + $srcNodeList = $domXpath->query($qSrc); + $source = null; + + if ($srcNodeList->length > 0) { + $source = $srcNodeList->item(0); + } + + $analyzeResponse->messages[] = new Result\NotOk( + $errorCodeNodeList->item(0)->nodeValue, + $this->makeMessageFromMessagesNodeList( + $domXpath->query($qMsg) + ), + null, + $source + ); + } + + return $analyzeResponse; + } } diff --git a/src/Amadeus/Client/Result/NotOk.php b/src/Amadeus/Client/Result/NotOk.php index 9002d3464..c62dce9d3 100644 --- a/src/Amadeus/Client/Result/NotOk.php +++ b/src/Amadeus/Client/Result/NotOk.php @@ -31,31 +31,46 @@ class NotOk { /** + * Error/warning code + * * @var mixed */ public $code; /** + * Message + * * @var string */ public $text; /** + * Error/warning level + * * @var string */ public $level; + /** + * Source of error/warning + * + * @var string + */ + public $source; + /** * NotOk constructor. * * @param string|int|null $code * @param string|null $text * @param string|null $level + * @param string|null $source */ - public function __construct($code = null, $text = null, $level = null) + public function __construct($code = null, $text = null, $level = null, $source = null) { $this->code = $code; $this->text = $text; $this->level = $level; + $this->source = $source; } } diff --git a/src/Amadeus/Client/Session/Handler/Base.php b/src/Amadeus/Client/Session/Handler/Base.php index e897ac7b5..30f6ef6ba 100644 --- a/src/Amadeus/Client/Session/Handler/Base.php +++ b/src/Amadeus/Client/Session/Handler/Base.php @@ -25,6 +25,7 @@ use Amadeus\Client; use Amadeus\Client\Struct\BaseWsMessage; use Amadeus\Client\Params\SessionHandlerParams; +use Amadeus\Client\Session\MsgClassmap\Loader; use Psr\Log\LoggerAwareInterface; use Psr\Log\LoggerAwareTrait; use Psr\Log\LoggerInterface; @@ -75,6 +76,13 @@ abstract class Base implements HandlerInterface, LoggerAwareInterface 'securityToken' => null ]; + /** + * Specific classmap additions to be loaded when certain messages are active. + * + * @var array + */ + protected $messageClassmap = []; + /** * Status variable to know if the session is currently logged in * @@ -315,12 +323,14 @@ public function getOriginatorOffice() * * Result is an associative array: keys are message names, values are versions. * + * @todo messageClassMap per WSDL separately! * @return array */ public function getMessagesAndVersions() { if (empty($this->messagesAndVersions)) { $this->messagesAndVersions = WsdlAnalyser::loadMessagesAndVersions($this->params->wsdl); + $this->messageClassmap = Loader::loadMessagesSpecificClasses($this->messagesAndVersions); } return $this->messagesAndVersions; @@ -376,7 +386,9 @@ protected function getSoapClient($msgName) $wsdlId = $this->getWsdlIdFor($msgName); if (!empty($msgName)) { + if (!isset($this->soapClients[$wsdlId]) || !($this->soapClients[$wsdlId] instanceof \SoapClient)) { + $this->soapClients[$wsdlId] = $this->initSoapClient($wsdlId); } @@ -394,8 +406,9 @@ protected function getSoapClient($msgName) */ protected function initSoapClient($wsdlId) { + //print_r($wsdlId); $wsdlPath = WsdlAnalyser::$wsdlIds[$wsdlId]; - + //print_r($wsdlPath); $client = new Client\SoapClient( $wsdlPath, $this->makeSoapClientOptions(), diff --git a/src/Amadeus/Client/Session/Handler/SoapHeader4.php b/src/Amadeus/Client/Session/Handler/SoapHeader4.php index 2891b413f..b2fd8af74 100644 --- a/src/Amadeus/Client/Session/Handler/SoapHeader4.php +++ b/src/Amadeus/Client/Session/Handler/SoapHeader4.php @@ -146,6 +146,7 @@ protected function prepareForNextMessage($messageName, $messageOptions) $headers = $this->createSoapHeaders($this->sessionData, $this->params, $messageName, $messageOptions); $this->getSoapClient($messageName)->__setSoapHeaders(null); + $this->getSoapClient($messageName)->__setSoapHeaders($headers); } @@ -206,7 +207,7 @@ protected function getSessionDataFromHeader($responseMsg) $newSessionData['sessionId'] = $responseDomXpath->evaluate($querySessionId); $newSessionData['sequenceNumber'] = $responseDomXpath->evaluate($querySequenceNumber); if (!empty($newSessionData['sequenceNumber'])) { - $newSessionData['sequenceNumber'] = (int) $newSessionData['sequenceNumber']; + $newSessionData['sequenceNumber'] = (int)$newSessionData['sequenceNumber']; } $newSessionData['securityToken'] = $responseDomXpath->evaluate($querySecurityToken); } @@ -408,15 +409,15 @@ protected function getActionFromWsdl($wsdlFilePath, $messageName) */ protected function generateGuid() { - mt_srand((double) microtime() * 10000); + mt_srand((double)microtime() * 10000); $charId = strtoupper(md5(uniqid(rand(), true))); $hyphen = chr(45); // "-" - $uuid = substr($charId, 0, 8).$hyphen - .substr($charId, 8, 4).$hyphen - .substr($charId, 12, 4).$hyphen - .substr($charId, 16, 4).$hyphen - .substr($charId, 20, 12); + $uuid = substr($charId, 0, 8) . $hyphen + . substr($charId, 8, 4) . $hyphen + . substr($charId, 12, 4) . $hyphen + . substr($charId, 16, 4) . $hyphen + . substr($charId, 20, 12); return $uuid; } @@ -454,7 +455,7 @@ protected function generateUniqueNonce($nonceBase, $creationString) true ), 0, - 16 + 20 ); } @@ -501,7 +502,11 @@ protected function createDateTimeStringForAuth($creationDateTime, $micro) protected function makeSoapClientOptions() { $options = $this->soapClientOptions; - $options['classmap'] = array_merge(Classmap::$soapheader4map, Classmap::$map); + $options['classmap'] = array_merge( + Classmap::$soapheader4map, + Classmap::$map, + $this->messageClassmap + ); if (!empty($this->params->soapClientOptions)) { $options = array_merge($options, $this->params->soapClientOptions); diff --git a/src/Amadeus/Client/Session/MsgClassmap/Hotel/LoaderMultiSingleAvailability.php b/src/Amadeus/Client/Session/MsgClassmap/Hotel/LoaderMultiSingleAvailability.php new file mode 100644 index 000000000..3dd8aa9f5 --- /dev/null +++ b/src/Amadeus/Client/Session/MsgClassmap/Hotel/LoaderMultiSingleAvailability.php @@ -0,0 +1,61 @@ + + */ +class LoaderMultiSingleAvailability implements LoadInterface +{ + /** + * @param float|string $version + * @return array + */ + public static function loadClassMapForMessage($version) + { + return [ + 'ota_2003_05:OTA_HotelAvailRQ' => 'Amadeus\Client\Struct\Hotel\MultiSingleAvailability', + 'ota_2003_05:AvailRequestSegments' => 'Amadeus\Client\Struct\Hotel\MultiSingleAvailability\AvailRequestSegments', + 'ota_2003_05:AvailRequestSegmentsType' => 'Amadeus\Client\Struct\Hotel\MultiSingleAvailability\AvailRequestSegmentsType', + 'ota_2003_05:AvailRequestSegment' => 'Amadeus\Client\Struct\Hotel\MultiSingleAvailability\AvailRequestSegment', + 'ota_2003_05:Criterion' => 'Amadeus\Client\Struct\Hotel\MultiSingleAvailability\Criterion', + 'ota_2003_05:HotelSearchCriterionType' => 'Amadeus\Client\Struct\Hotel\MultiSingleAvailability\HotelSearchCriterionType', + 'ota_2003_05:ItemSearchCriterionType' => 'Amadeus\Client\Struct\Hotel\MultiSingleAvailability\ItemSearchCriterionType', + 'ota_2003_05:GuestCount' => 'Amadeus\Client\Struct\Hotel\MultiSingleAvailability\GuestCount', + 'ota_2003_05:GuestCounts' => 'Amadeus\Client\Struct\Hotel\MultiSingleAvailability\GuestCounts', + 'ota_2003_05:HotelRef' => 'Amadeus\Client\Struct\Hotel\MultiSingleAvailability\HotelRef', + 'ota_2003_05:HotelSearchCriteria' => 'Amadeus\Client\Struct\Hotel\MultiSingleAvailability\HotelSearchCriteria', + 'ota_2003_05:HotelSearchCriteriaType' => 'Amadeus\Client\Struct\Hotel\MultiSingleAvailability\HotelSearchCriteriaType', + 'ota_2003_05:POS_Type' => 'Amadeus\Client\Struct\Hotel\MultiSingleAvailability\PosType', + 'ota_2003_05:RateRange' => 'Amadeus\Client\Struct\Hotel\MultiSingleAvailability\RateRange', + 'ota_2003_05:RoomStayCandidate' => 'Amadeus\Client\Struct\Hotel\MultiSingleAvailability\RoomStayCandidate', + 'ota_2003_05:RoomStayCandidates' => 'Amadeus\Client\Struct\Hotel\MultiSingleAvailability\RoomStayCandidates', + 'ota_2003_05:StayDateRange' => 'Amadeus\Client\Struct\Hotel\MultiSingleAvailability\StayDateRange' + ]; + } +} diff --git a/src/Amadeus/Client/Session/MsgClassmap/LoadInterface.php b/src/Amadeus/Client/Session/MsgClassmap/LoadInterface.php new file mode 100644 index 000000000..31bc2ecf2 --- /dev/null +++ b/src/Amadeus/Client/Session/MsgClassmap/LoadInterface.php @@ -0,0 +1,40 @@ + + */ +interface LoadInterface +{ + /** + * Loads extra class map entries for a given message and version + * + * @param string|float $version + * @return array + */ + public static function loadClassMapForMessage($version); +} diff --git a/src/Amadeus/Client/Session/MsgClassmap/Loader.php b/src/Amadeus/Client/Session/MsgClassmap/Loader.php new file mode 100644 index 000000000..b3f5a32e1 --- /dev/null +++ b/src/Amadeus/Client/Session/MsgClassmap/Loader.php @@ -0,0 +1,120 @@ + + */ +class Loader +{ + /** + * List of messages that need extra classmaps. + * + * @var array + */ + protected static $extraClassMapNeeded = [ + 'Hotel_MultiSingleAvailability' + ]; + + + /** + * Load extra ClassMaps needed for the messages and versions in the WSAP + * + * messagesAndVersions array: + * [ + * 'PNR_Retrieve' => [ + * 'version' => '14.2', + * 'wsdl' => 'a88a2bde' + * ], + * 'Security_Authenticate' => [ + * 'version' => '6.1', + * 'wsdl' => 'a88a2bde' + * ] + * + * @param array $messagesAndVersions + * @return array + */ + public static function loadMessagesSpecificClasses($messagesAndVersions) + { + $msgSpecificClassMap = []; + + foreach ($messagesAndVersions as $message => $messageInfo) { + $msgSpecificClassMap = array_merge( + $msgSpecificClassMap, + self::loadClassMapForMessage($message, $messageInfo["version"]) + ); + } + + return $msgSpecificClassMap; + } + + /** + * Load Message-specific classmap + * + * @param string $message + * @param string|float $version + * @return array + */ + protected static function loadClassMapForMessage($message, $version) + { + $classMap = []; + + if (in_array($message, self::$extraClassMapNeeded)) { + $classMapLoader = self::makeClassMapLoader($message); + + if ($classMapLoader instanceof LoadInterface) { + $classMap = $classMapLoader::loadClassMapForMessage($version); + } + } + + return $classMap; + } + + /** + * @param string $message + * @return LoadInterface|null + */ + protected static function makeClassMapLoader($message) + { + $loader = null; + + $section = substr($message, 0, strpos($message, '_')); + $message = substr($message, strpos($message, '_') + 1); + + $loaderClass = __NAMESPACE__.'\\'.$section.'\\Loader'.$message; + + if (class_exists($loaderClass)) { + /** @var LoadInterface $handler */ + $loader = new $loaderClass(); + } + + return $loader; + } +} diff --git a/src/Amadeus/Client/SoapClient.php b/src/Amadeus/Client/SoapClient.php index 7528c62e7..300a4cdb1 100644 --- a/src/Amadeus/Client/SoapClient.php +++ b/src/Amadeus/Client/SoapClient.php @@ -40,6 +40,7 @@ class SoapClient extends \SoapClient implements Log\LoggerAwareInterface { use Log\LoggerAwareTrait; + const REMOVE_EMPTY_XSLT_LOCATION = 'SoapClient/removeempty.xslt'; /** @@ -78,7 +79,7 @@ public function __doRequest($request, $location, $action, $version, $oneWay = nu } $newRequest = $this->transformIncomingRequest($request); - + //print_r($newRequest); return parent::__doRequest($newRequest, $location, $action, $version, $oneWay); } @@ -91,9 +92,9 @@ protected function transformIncomingRequest($request) { $newRequest = null; - $xsltFile = dirname(__FILE__).DIRECTORY_SEPARATOR.self::REMOVE_EMPTY_XSLT_LOCATION; + $xsltFile = dirname(__FILE__) . DIRECTORY_SEPARATOR . self::REMOVE_EMPTY_XSLT_LOCATION; if (!is_readable($xsltFile)) { - throw new Exception('XSLT file "'.$xsltFile.'" is not readable!'); + throw new Exception('XSLT file "' . $xsltFile . '" is not readable!'); } $dom = new \DOMDocument('1.0', 'UTF-8'); @@ -109,20 +110,29 @@ protected function transformIncomingRequest($request) //On transform error: usually when modifying the XSLT transformation incorrectly... $this->logger->log( Log\LogLevel::ERROR, - __METHOD__."__doRequest(): XSLTProcessor::transformToXml " + __METHOD__ . "__doRequest(): XSLTProcessor::transformToXml " . "returned FALSE: could not perform transformation!!" ); $newRequest = $request; } else { $newDom = new \DOMDocument('1.0', 'UTF-8'); $newDom->preserveWhiteSpace = false; + //$transform = self::transformstring($transform); $newDom->loadXML($transform); - $newRequest = $newDom->saveXML(); } - unset($processor, $xslt, $dom, $transform); - + //print_r($newRequest); return $newRequest; } + + private function transformstring($transform) + { + $retVal = $transform; + $retVal = str_replace("ns1:", "", $transform); + //$retVal = str_replace("http://webservices.amadeus.com/Hotel_DescriptiveInfo_7.1", "http://webservices.amadeus.com/OTA_HotelDescriptiveInfoRQ_07.1_1A2007A", $retVal); + //$retVal = str_replace("https://nodeD1.test.webservices.amadeus.com/1ASIWLERLERU", "https://pilotd.test.webservices.amadeus.com/1ASIWLERLERU", $retVal); + //$retVal = str_replace("", "", $retVal); + return $retVal; + } } diff --git a/src/Amadeus/Client/Struct/Air/MultiAvailability/CabinOption.php b/src/Amadeus/Client/Struct/Air/MultiAvailability/CabinOption.php index 9ea106e6f..3d56d536e 100644 --- a/src/Amadeus/Client/Struct/Air/MultiAvailability/CabinOption.php +++ b/src/Amadeus/Client/Struct/Air/MultiAvailability/CabinOption.php @@ -32,6 +32,9 @@ class CabinOption */ public function __construct($cabinCode) { - $this->cabinDesignation = new CabinDesignation($cabinCode); + if ($cabinCode != '702') + $this->cabinDesignation = new CabinDesignation($cabinCode); + else + $this->orderClassesByCabin = $cabinCode; } } diff --git a/src/Amadeus/Client/Struct/DocIssuance/IssueCombined.php b/src/Amadeus/Client/Struct/DocIssuance/IssueCombined.php index cc8a743ea..9c556fc06 100644 --- a/src/Amadeus/Client/Struct/DocIssuance/IssueCombined.php +++ b/src/Amadeus/Client/Struct/DocIssuance/IssueCombined.php @@ -48,5 +48,37 @@ public function __construct(DocIssuanceIssueCombinedOptions $options) ) ); } + foreach ($options->emds as $emd) { + $this->addSelectionItem( + new ReferenceDetails( + $emd, + ReferenceDetails::TYPE_TSM + ) + ); + } + foreach ($options->svcs as $svc) { + $this->addSelectionItem( + new ReferenceDetails( + $svc, + ReferenceDetails::TYPE_LINE_NUMBER + ) + ); + } + foreach ($options->cup as $cup) { + $this->addSelectionItem( + new ReferenceDetails( + $cup, + ReferenceDetails::TYPE_COUPON_NUMBER + ) + ); + } + foreach ($options->segs as $seg) { + $this->addSelectionItem( + new ReferenceDetails( + $seg, + ReferenceDetails::TYPE_SEGMENT_TATTOO + ) + ); + } } } diff --git a/src/Amadeus/Client/Struct/DocIssuance/IssueMiscellaneousDocuments.php b/src/Amadeus/Client/Struct/DocIssuance/IssueMiscellaneousDocuments.php index 8704a193e..efbf7eb23 100644 --- a/src/Amadeus/Client/Struct/DocIssuance/IssueMiscellaneousDocuments.php +++ b/src/Amadeus/Client/Struct/DocIssuance/IssueMiscellaneousDocuments.php @@ -23,33 +23,40 @@ namespace Amadeus\Client\Struct\DocIssuance; use Amadeus\Client\RequestOptions\DocIssuanceIssueMiscDocOptions; - +use Amadeus\Client\Struct\BaseWsMessage; /** * DocIssuance_IssueMiscellaneousDocuments request structure * * @package Amadeus\Client\Struct\DocIssuance * @author Dieter Devlieghere */ -class IssueMiscellaneousDocuments extends DocIssuanceBaseMsg +class IssueMiscellaneousDocuments extends BaseWsMessage { /** * IssueMiscellaneousDocuments constructor. * * @param DocIssuanceIssueMiscDocOptions $options */ + public $selection; + public $optionGroup; + public $options = []; public function __construct(DocIssuanceIssueMiscDocOptions $options) { - $this->addSelectionItems($options->tsmNumbers, ReferenceDetails::TYPE_TSM); - $this->addSelectionItems($options->tsmTattoos, ReferenceDetails::TYPE_TSM_TATTOO); - $this->addSelectionItems($options->lineNumbers, ReferenceDetails::TYPE_LINE_NUMBER); - - $this->loadOptions($options->options, $options->compoundOptions); - - $this->loadReferences($options); - - $this->loadPassType($options->passengerType); - - $this->loadStockReference($options->stockReference); +// $this->addSelectionItems($options->tsmNumbers, ReferenceDetails::TYPE_TSM); +// $this->addSelectionItems($options->tsmTattoos, ReferenceDetails::TYPE_TSM_TATTOO); +// $this->addSelectionItems($options->lineNumbers, ReferenceDetails::TYPE_LINE_NUMBER); +// $this->addSelectionItems($options->emdTattoos, ReferenceDetails::TYPE_TSM); +// +// $this->loadOptions($options->options, $options->compoundOptions); +// +// $this->loadReferences($options); +// +// $this->loadPassType($options->passengerType); +// +// $this->loadStockReference($options->stockReference); + $this->selection = $options->selection; + $this->optionGroup = $options->optionGroup; + $this->options = $options->options; } /** diff --git a/src/Amadeus/Client/Struct/Fare/BaseMasterPricerMessage.php b/src/Amadeus/Client/Struct/Fare/BaseMasterPricerMessage.php index 6eafc863f..e6e0d7f32 100644 --- a/src/Amadeus/Client/Struct/Fare/BaseMasterPricerMessage.php +++ b/src/Amadeus/Client/Struct/Fare/BaseMasterPricerMessage.php @@ -63,12 +63,29 @@ class BaseMasterPricerMessage extends BaseWsMessage */ protected function loadPassenger($passenger, &$counter, &$infantCounter) { - $isInfant = ($passenger->type === 'INF'); - + if (!is_array($passenger->type)) { + switch ($passenger->type) { + case 'ITF': + case 'LIF': + case 'FNF': + case 'INF': + $isInfant = true; + break; + default: + $isInfant = false; + break; + } + //$isInfant = ($passenger->type === 'INF'); + } else { + for ($i = 0; $i < count($passenger->type); $i++) { + $isInfant = ($passenger->type[$i] === 'INF' || $passenger->type[$i] === 'LIF' || $passenger->type[$i] === 'FNF'|| $passenger->type[$i] === 'ITF'); + } + } $paxRef = new MasterPricer\PaxReference( $isInfant ? $infantCounter : $counter, $isInfant, - $passenger->type + $passenger->type, + $passenger->isresident ); if ($isInfant) { diff --git a/src/Amadeus/Client/Struct/Fare/GetFareFamilyDescriptionOptions.php b/src/Amadeus/Client/Struct/Fare/GetFareFamilyDescriptionOptions.php new file mode 100644 index 000000000..9b118a972 --- /dev/null +++ b/src/Amadeus/Client/Struct/Fare/GetFareFamilyDescriptionOptions.php @@ -0,0 +1,23 @@ +standaloneDescriptionRequest = $options->standaloneDescriptionRequest; + } + } +} \ No newline at end of file diff --git a/src/Amadeus/Client/Struct/Fare/InformativePriceUpsellWithoutPNR15.php b/src/Amadeus/Client/Struct/Fare/InformativePriceUpsellWithoutPNR15.php new file mode 100644 index 000000000..b3f96c75e --- /dev/null +++ b/src/Amadeus/Client/Struct/Fare/InformativePriceUpsellWithoutPNR15.php @@ -0,0 +1,49 @@ + + */ +class InformativePriceUpsellWithoutPNR15 extends BaseWsMessage +{ + /** + * InformativePriceUpsellWithoutPNR15 constructor. + * + * @param FarePriceUpsellWithoutPNROptions|null $options + * @throws MessageVersionUnsupportedException + */ + public function __construct(FarePriceUpsellWithoutPNROptions $options = null) + { + throw new MessageVersionUnsupportedException( + 'Fare_PriceUpsellWithoutPNR versions < 16 are not yet implemented' + ); + } +} diff --git a/src/Amadeus/Client/Struct/Fare/InformativePriceUpsellWithoutPNR16.php b/src/Amadeus/Client/Struct/Fare/InformativePriceUpsellWithoutPNR16.php new file mode 100644 index 000000000..73f4dc658 --- /dev/null +++ b/src/Amadeus/Client/Struct/Fare/InformativePriceUpsellWithoutPNR16.php @@ -0,0 +1,44 @@ + + */ +class InformativePriceUpsellWithoutPNR16 extends InformativePricingWithoutPNR13 +{ + /** + * InformativePriceUpsellWithoutPNR16 constructor. + * + * @param FarePriceUpsellWithoutPNROptions|null $options + */ + public function __construct(FarePriceUpsellWithoutPNROptions $options = null) + { + parent::__construct($options); + } +} diff --git a/src/Amadeus/Client/Struct/Fare/InformativePricing13/PassengersGroup.php b/src/Amadeus/Client/Struct/Fare/InformativePricing13/PassengersGroup.php index 480e082a8..0ab7ff652 100644 --- a/src/Amadeus/Client/Struct/Fare/InformativePricing13/PassengersGroup.php +++ b/src/Amadeus/Client/Struct/Fare/InformativePricing13/PassengersGroup.php @@ -62,8 +62,10 @@ public function __construct($passenger, $group) $this->travellersID = new TravellersId(); - foreach ($passenger->tattoos as $tattoo) { - $this->travellersID->travellerDetails[] = new TravellerDetails($tattoo); + if (is_array($passenger->tattoos) || is_object($passenger->tattoos)) { + foreach ($passenger->tattoos as $tattoo) { + $this->travellersID->travellerDetails[] = new TravellerDetails($tattoo); + } } if (!empty($passenger->type)) { diff --git a/src/Amadeus/Client/Struct/Fare/InformativePricingWithoutPNR13.php b/src/Amadeus/Client/Struct/Fare/InformativePricingWithoutPNR13.php index 775214335..73f62e398 100644 --- a/src/Amadeus/Client/Struct/Fare/InformativePricingWithoutPNR13.php +++ b/src/Amadeus/Client/Struct/Fare/InformativePricingWithoutPNR13.php @@ -22,11 +22,11 @@ namespace Amadeus\Client\Struct\Fare; -use Amadeus\Client\RequestOptions\Fare\InformativePricing\PricingOptions; -use Amadeus\Client\Struct\BaseWsMessage; use Amadeus\Client\RequestOptions\Fare\InformativePricing\Passenger; +use Amadeus\Client\RequestOptions\Fare\InformativePricing\PricingOptions; use Amadeus\Client\RequestOptions\Fare\InformativePricing\Segment; use Amadeus\Client\RequestOptions\FareInformativePricingWithoutPnrOptions; +use Amadeus\Client\Struct\BaseWsMessage; use Amadeus\Client\Struct\Fare\InformativePricing13\OriginatorGroup; use Amadeus\Client\Struct\Fare\InformativePricing13\PassengersGroup; use Amadeus\Client\Struct\Fare\InformativePricing13\SegmentGroup; @@ -73,6 +73,12 @@ public function __construct($options) $this->loadSegments($options->segments); $this->loadPricingOptions($options->pricingOptions); + + if (isset($options->pricingOptionsArray)) { + foreach ($options->pricingOptionsArray as $option) { + $this->loadPricingOptions($option); + } + } } } @@ -107,6 +113,10 @@ protected function loadPricingOptions($pricingOptions) if (!($pricingOptions instanceof PricingOptions)) { $pricingOptions = new PricingOptions(); } - $this->pricingOptionGroup = PricePNRWithBookingClass13::loadPricingOptionsFromRequestOptions($pricingOptions); + $priceOpt = PricePNRWithBookingClass13::loadPricingOptionsFromRequestOptions($pricingOptions); + + foreach ($priceOpt as $opt) { + $this->pricingOptionGroup[] = $opt; + } } } diff --git a/src/Amadeus/Client/Struct/Fare/MasterPricer/PaxReference.php b/src/Amadeus/Client/Struct/Fare/MasterPricer/PaxReference.php index decd6c24e..3472fe2b9 100644 --- a/src/Amadeus/Client/Struct/Fare/MasterPricer/PaxReference.php +++ b/src/Amadeus/Client/Struct/Fare/MasterPricer/PaxReference.php @@ -48,9 +48,20 @@ class PaxReference * @param boolean $isInfant (OPTIONAL) * @param string|null $passengerType (OPTIONAL) */ - public function __construct($mainTravellerRef, $isInfant = false, $passengerType = null) + public function __construct($mainTravellerRef, $isInfant = false, $passengerType = null, $isresident = false) { $this->traveller[] = new Traveller($mainTravellerRef, $isInfant); - $this->ptc[] = $passengerType; + if ($isresident) { + $this->ptc[] = 'STR'; + $this->ptc[1] = $passengerType; + } else { + if (!is_array($passengerType)) + $this->ptc[] = $passengerType; + else { + for ($i = 0; $i < count($passengerType); $i++) { + $this->ptc[$i] = $passengerType[$i]; + } + } + } } } diff --git a/src/Amadeus/Client/Struct/Fare/MasterPricerTravelBoardSearch.php b/src/Amadeus/Client/Struct/Fare/MasterPricerTravelBoardSearch.php index d982b2b5a..720cc34ee 100644 --- a/src/Amadeus/Client/Struct/Fare/MasterPricerTravelBoardSearch.php +++ b/src/Amadeus/Client/Struct/Fare/MasterPricerTravelBoardSearch.php @@ -209,6 +209,12 @@ protected function loadItinerary($opt, &$counter) $tmpItinerary = new MasterPricer\Itinerary($segmentRef); + if (!empty($opt->flightInfoPNR)) { + $tmpItinerary->flightInfoPNR = $opt->flightInfoPNR; + } + if (!empty($opt->requestedSegmentAction)) { + $tmpItinerary->requestedSegmentAction = $opt->requestedSegmentAction; + } $tmpItinerary->departureLocalization = new MasterPricer\DepartureLocalization( $opt->departureLocation ); diff --git a/src/Amadeus/Client/Struct/Fare/PricePNRWithBookingClass13.php b/src/Amadeus/Client/Struct/Fare/PricePNRWithBookingClass13.php index aa5812414..4fa631c1b 100644 --- a/src/Amadeus/Client/Struct/Fare/PricePNRWithBookingClass13.php +++ b/src/Amadeus/Client/Struct/Fare/PricePNRWithBookingClass13.php @@ -176,6 +176,16 @@ public static function loadPricingOptionsFromRequestOptions($options) self::makeOverrideOptionsWithCriteria($options->overrideOptionsWithCriteria, $priceOptions) ); + /* + $priceOptions = self::mergeOptions( + $priceOptions, + self::loadPaxDiscount($options->paxDiscountCodes, $options->paxDiscountCodeRefs) + ); +*/ + if (!empty($options->priceOptions)) + for ($i = 0; $i < count($options->priceOptions); $i++) + $priceOptions[] = $options->priceOptions[$i]; + // All options processed, no options found: if (empty($priceOptions)) { $priceOptions[] = new PricingOptionGroup(PricingOptionKey::OPTION_NO_OPTION); @@ -209,11 +219,15 @@ protected static function makeOverrideOptions($overrideOptions, $priceOptions) */ protected static function makeOverrideOptionsWithCriteria($overrideOptionsWithCriteria, $priceOptions) { - $opt = []; + $opt = []; foreach ($overrideOptionsWithCriteria as $overrideOptionWithCriteria) { + if (!self::hasPricingGroup($overrideOptionWithCriteria["key"], $priceOptions)) { - $opt[] = new PricingOptionGroup($overrideOptionWithCriteria["key"], $overrideOptionWithCriteria["optionDetail"]); + $opt[] = new PricingOptionGroup($overrideOptionWithCriteria["key"], $overrideOptionWithCriteria["optionDetail"], + isset($overrideOptionWithCriteria["attributeDescription"]) ? $overrideOptionWithCriteria["attributeDescription"] : null, + isset($overrideOptionWithCriteria["references"]) ? $overrideOptionWithCriteria["references"] : null); + } } @@ -272,7 +286,7 @@ protected static function makePricingOptionFareBasisOverride($pricingsFareBasis) //Support for legacy fareBasisPrimaryCode to be removed when breaking BC: $po->optionDetail = new OptionDetail( - $pricingFareBasis->fareBasisPrimaryCode.$pricingFareBasis->fareBasisCode + $pricingFareBasis->fareBasisPrimaryCode . $pricingFareBasis->fareBasisCode ); //Support for legacy segmentReference to be removed when breaking BC: diff --git a/src/Amadeus/Client/Struct/Fare/PricePnr13/CriteriaDetails.php b/src/Amadeus/Client/Struct/Fare/PricePnr13/CriteriaDetails.php index f71f8fd50..3c5bffbe4 100644 --- a/src/Amadeus/Client/Struct/Fare/PricePnr13/CriteriaDetails.php +++ b/src/Amadeus/Client/Struct/Fare/PricePnr13/CriteriaDetails.php @@ -40,13 +40,24 @@ class CriteriaDetails */ public $attributeDescription; + /** + * Passenger, Segment or TST references to partially price the PNR + * + * @var PaxSegRef[] + */ + public $paxSegTstReference = []; + /** * CriteriaDetails constructor. * * @param string $type */ - public function __construct($type) + public function __construct($type, $description = null, $references = null) { $this->attributeType = $type; + if (isset($description)) + $this->attributeDescription = $description; + if (isset($references)) + $this->paxSegTstReference = $references; } } diff --git a/src/Amadeus/Client/Struct/Fare/PricePnr13/OptionDetail.php b/src/Amadeus/Client/Struct/Fare/PricePnr13/OptionDetail.php index 39d4d9698..1cc8ba809 100644 --- a/src/Amadeus/Client/Struct/Fare/PricePnr13/OptionDetail.php +++ b/src/Amadeus/Client/Struct/Fare/PricePnr13/OptionDetail.php @@ -40,13 +40,13 @@ class OptionDetail * * @param string|array|null $options */ - public function __construct($options = null) + public function __construct($options = null, $attributeDescription = null, $references = null) { if (is_string($options)) { - $this->criteriaDetails[] = new CriteriaDetails($options); + $this->criteriaDetails[] = new CriteriaDetails($options, $attributeDescription, $references); } elseif (is_array($options)) { foreach ($options as $option) { - $this->criteriaDetails[] = new CriteriaDetails($option); + $this->criteriaDetails[] = new CriteriaDetails($options, $attributeDescription, $references); } } } diff --git a/src/Amadeus/Client/Struct/Fare/PricePnr13/PricingOptionGroup.php b/src/Amadeus/Client/Struct/Fare/PricePnr13/PricingOptionGroup.php index 89afdc2e2..6149ebd67 100644 --- a/src/Amadeus/Client/Struct/Fare/PricePnr13/PricingOptionGroup.php +++ b/src/Amadeus/Client/Struct/Fare/PricePnr13/PricingOptionGroup.php @@ -89,18 +89,29 @@ class PricingOptionGroup * @var PaxSegTstReference */ public $paxSegTstReference; + /** + * @var $attributeDescription + */ + public $attributeDescription; + + + public $references = []; /** * PricingOptionGroup constructor. * * @param string $key * @param string $optionDetail + * @param string $attributeDescription */ - public function __construct($key, $optionDetail=null) + public function __construct($key, $optionDetail = null, $attributeDescription = null, $references = null) { $this->pricingOptionKey = new PricingOptionKey($key); + if(isset($references)){ + $this->paxSegTstReference = new PaxSegTstReference($references); + } if (isset($optionDetail)) { - $this->optionDetail = new OptionDetail($optionDetail); + $this->optionDetail = new OptionDetail($optionDetail, $attributeDescription, $references); } } } diff --git a/src/Amadeus/Client/Struct/Fare/PricePnr13/PricingOptionKey.php b/src/Amadeus/Client/Struct/Fare/PricePnr13/PricingOptionKey.php index 411460f2b..56cf75ba3 100644 --- a/src/Amadeus/Client/Struct/Fare/PricePnr13/PricingOptionKey.php +++ b/src/Amadeus/Client/Struct/Fare/PricePnr13/PricingOptionKey.php @@ -56,6 +56,7 @@ class PricingOptionKey const OPTION_RETURN_ALL = "RLI"; const OPTION_PTC_ONLY = "PTC"; const OPTION_FORM_OF_PAYMENT = "FOP"; + const OPTION_CABIN = "CAB"; /** * AC Add Country taxes @@ -63,6 +64,7 @@ class PricingOptionKey * AWD AWarD * BK Booking class override * BND Bound Input + * CAB Cabin Options * CC Controlling Carrier Override * CMP Companions * CON Connection diff --git a/src/Amadeus/Client/Struct/Hotel/HotelDescriptiveInfo.php b/src/Amadeus/Client/Struct/Hotel/HotelDescriptiveInfo.php new file mode 100644 index 000000000..e33e44177 --- /dev/null +++ b/src/Amadeus/Client/Struct/Hotel/HotelDescriptiveInfo.php @@ -0,0 +1,30 @@ +HotelDescriptiveInfos = $options->HotelDescriptiveInfos; + $this->EchoToken = $options->EchoToken; + $this->Version = $options->Version; + $this->PrimaryLangID = $options->PrimaryLangID; + $this->xmlns = $options->xmlns; + } +} \ No newline at end of file diff --git a/src/Amadeus/Client/Struct/Hotel/HotelEnhancedPricing.php b/src/Amadeus/Client/Struct/Hotel/HotelEnhancedPricing.php new file mode 100644 index 000000000..656014499 --- /dev/null +++ b/src/Amadeus/Client/Struct/Hotel/HotelEnhancedPricing.php @@ -0,0 +1,37 @@ +xsi = $options->xsi; + $this->EchoToken = $options->EchoToken; +// $this->SummaryOnly = $options->SummaryOnly; +// $this->AvailRatesOnly = $options->AvailRatesOnly; + $this->PrimaryLangID = $options->PrimaryLangID; +// $this->RateRangeOnly = $options->RateRangeOnly; +// $this->RequestedCurrency = $options->RequestedCurrency; + $this->Version = $options->Version; + $this->AvailRequestSegments = $options->AvailRequestSegments; + } +} \ No newline at end of file diff --git a/src/Amadeus/Client/Struct/Hotel/MultiSingleAvailability.php b/src/Amadeus/Client/Struct/Hotel/MultiSingleAvailability.php new file mode 100644 index 000000000..e4f4a8024 --- /dev/null +++ b/src/Amadeus/Client/Struct/Hotel/MultiSingleAvailability.php @@ -0,0 +1,158 @@ + + */ +class MultiSingleAvailability extends BaseWsMessage +{ + /** + * @var string + */ + public $EchoToken = 'MultiSingle'; + + /** + * @var string + */ + public $Version; + + /** + * @var bool + */ + public $SummaryOnly = true; + + /** + * @var bool + */ + public $RateRangeOnly = true; + + /** + * @var bool + */ + public $RateDetailsInd = true; + + /** + * @var bool + */ + public $ExactMatchOnly; + + /** + * @var bool + */ + public $AvailRatesOnly; + + /** + * @var bool + */ + public $OnRequestInd; + + /** + * @var string + */ + public $PrimaryLangID; + + /** + * @var string + */ + public $RequestedCurrency; + + + /** + * @var MultiSingleAvailability\AvailRequestSegments + */ + public $AvailRequestSegments; + + /** + * @var MultiSingleAvailability\PosType + */ + public $POS; + + /** + * @var string + */ + public $SortOrder; + + /** + * @var int + */ + public $MaxResponses; + + /** + * @var string + */ + public $SearchCacheLevel; + + public $xmlns; + + /** + * MultiSingleAvailability constructor. + * + * @param HotelMultiSingleAvailOptions $options + */ + public function __construct(HotelMultiSingleAvailOptions $options) + { + $this->loadAttributes($options); + $this->loadSegments($options->segments); + } + + /** + * @param HotelMultiSingleAvailOptions $options + */ + protected function loadAttributes($options) + { + $this->Version = $options->version; + $this->AvailRatesOnly = $options->availableRatesOnly; + $this->ExactMatchOnly = $options->exactMatchOnly; + $this->PrimaryLangID = $options->languageCode; + $this->RateDetailsInd = $options->rateDetails; + $this->RateRangeOnly = $options->rateRangeOnly; + $this->RequestedCurrency = $options->requestedCurrency; + $this->SummaryOnly = $options->summaryOnly; + $this->SortOrder = $options->sortOrder; + $this->MaxResponses = $options->maxResponses; + $this->SearchCacheLevel = $options->searchCacheLevel; + $this->xmlns = $options->xmlns; + } + + /** + * @param MultiSingleAvail\Segment[] $segments + */ + protected function loadSegments($segments) + { + $this->AvailRequestSegments = new AvailRequestSegments(); + + foreach ($segments as $segment) { + $this->AvailRequestSegments->AvailRequestSegment[] = new AvailRequestSegment($segment); + } + } +} diff --git a/src/Amadeus/Client/Struct/Hotel/MultiSingleAvailability/AcceptedPayments.php b/src/Amadeus/Client/Struct/Hotel/MultiSingleAvailability/AcceptedPayments.php new file mode 100644 index 000000000..fc1ae05df --- /dev/null +++ b/src/Amadeus/Client/Struct/Hotel/MultiSingleAvailability/AcceptedPayments.php @@ -0,0 +1,33 @@ + + */ +class AcceptedPayments +{ +} diff --git a/src/Amadeus/Client/Struct/Hotel/MultiSingleAvailability/AvailRequestSegment.php b/src/Amadeus/Client/Struct/Hotel/MultiSingleAvailability/AvailRequestSegment.php new file mode 100644 index 000000000..6686142d6 --- /dev/null +++ b/src/Amadeus/Client/Struct/Hotel/MultiSingleAvailability/AvailRequestSegment.php @@ -0,0 +1,65 @@ + + */ +class AvailRequestSegment +{ + /** + * @var HotelSearchCriteria + */ + public $HotelSearchCriteria; + + /** + * @var string + */ + public $InfoSource; + + public $MoreDataEchoToken; + + + /** + * AvailRequestSegment constructor. + * + * @param Segment|null $segment + */ + public function __construct($segment = null) + { + if ($segment instanceof Segment) { + $this->InfoSource = $segment->infoSource; + + $this->HotelSearchCriteria = new HotelSearchCriteria( + $segment->criteria, + $segment->bestOnly, + $segment->availableOnly + ); + } + } +} diff --git a/src/Amadeus/Client/Struct/Hotel/MultiSingleAvailability/AvailRequestSegments.php b/src/Amadeus/Client/Struct/Hotel/MultiSingleAvailability/AvailRequestSegments.php new file mode 100644 index 000000000..d6893a603 --- /dev/null +++ b/src/Amadeus/Client/Struct/Hotel/MultiSingleAvailability/AvailRequestSegments.php @@ -0,0 +1,33 @@ + + */ +class AvailRequestSegments extends AvailRequestSegmentsType +{ +} diff --git a/src/Amadeus/Client/Struct/Hotel/MultiSingleAvailability/AvailRequestSegmentsType.php b/src/Amadeus/Client/Struct/Hotel/MultiSingleAvailability/AvailRequestSegmentsType.php new file mode 100644 index 000000000..687f7a2d0 --- /dev/null +++ b/src/Amadeus/Client/Struct/Hotel/MultiSingleAvailability/AvailRequestSegmentsType.php @@ -0,0 +1,42 @@ + + */ +class AvailRequestSegmentsType +{ + /** + * @var AvailRequestSegment[] + */ + public $AvailRequestSegment = []; + + /** + * @var int + */ + public $MaximumWaitTime; +} diff --git a/src/Amadeus/Client/Struct/Hotel/MultiSingleAvailability/Award.php b/src/Amadeus/Client/Struct/Hotel/MultiSingleAvailability/Award.php new file mode 100644 index 000000000..2c6d2df56 --- /dev/null +++ b/src/Amadeus/Client/Struct/Hotel/MultiSingleAvailability/Award.php @@ -0,0 +1,33 @@ + + */ +class Award +{ +} diff --git a/src/Amadeus/Client/Struct/Hotel/MultiSingleAvailability/Criterion.php b/src/Amadeus/Client/Struct/Hotel/MultiSingleAvailability/Criterion.php new file mode 100644 index 000000000..fcba427f9 --- /dev/null +++ b/src/Amadeus/Client/Struct/Hotel/MultiSingleAvailability/Criterion.php @@ -0,0 +1,77 @@ + + */ +class Criterion extends HotelSearchCriterionType +{ + /*** + * @var string + */ + public $AlternateAvailability; + + public $AddressSearchScope; + + public $InfoSource; + + public $MoreDataEchoToken; + + /** + * Criterion constructor. + * + * @param Criteria $criterion + */ + public function __construct(Criteria $criterion) + { + $this->ExactMatch = $criterion->exactMatch; + $this->Radius = $criterion->Radius; + if(isset($criterion->Position)) + $this->Position=$criterion->Position; + foreach ($criterion->hotelReferences as $hotelReference) { + $this->HotelRef[] = new HotelRef($hotelReference); + } + if (isset($criterion->stayStart)) + $this->StayDateRange = new StayDateRange($criterion->stayStart, $criterion->stayEnd); + + foreach ($criterion->rates as $rate) { + $this->RateRange[] = new RateRange($rate); + } + + if (!empty($criterion->rooms)) { + $this->RoomStayCandidates = new RoomStayCandidates(); + + foreach ($criterion->rooms as $room) { + $this->RoomStayCandidates->RoomStayCandidate[] = new RoomStayCandidate($room); + } + } + + $this->AlternateAvailability = $criterion->alternateAvailability; + } +} diff --git a/src/Amadeus/Client/Struct/Hotel/MultiSingleAvailability/GuestCount.php b/src/Amadeus/Client/Struct/Hotel/MultiSingleAvailability/GuestCount.php new file mode 100644 index 000000000..cd7cd4b35 --- /dev/null +++ b/src/Amadeus/Client/Struct/Hotel/MultiSingleAvailability/GuestCount.php @@ -0,0 +1,56 @@ + + */ +class GuestCount +{ + public $AgeQualifyingCode; + + public $Age; + + public $Count; + + public $AgeBucket; + + public $ResGuestRPH; + + /** + * GuestCount constructor. + * + * @param Guest $guest + */ + public function __construct(Guest $guest) + { + $this->AgeQualifyingCode = $guest->occupantCode; + $this->Count = $guest->amount; + $this->Age = $guest->Age; + } +} diff --git a/src/Amadeus/Client/Struct/Hotel/MultiSingleAvailability/GuestCounts.php b/src/Amadeus/Client/Struct/Hotel/MultiSingleAvailability/GuestCounts.php new file mode 100644 index 000000000..14e23eed8 --- /dev/null +++ b/src/Amadeus/Client/Struct/Hotel/MultiSingleAvailability/GuestCounts.php @@ -0,0 +1,59 @@ + + */ +class GuestCounts +{ + /** + * @var bool + */ + public $IsPerRoom; + + /** + * @var GuestCount[] + */ + public $GuestCount = []; + + /** + * GuestCounts constructor. + * + * @param bool $isPerRoom + * @param Guest[] $guests + */ + public function __construct($isPerRoom, $guests) + { + $this->IsPerRoom = $isPerRoom; + + foreach ($guests as $guest) { + $this->GuestCount[] = new GuestCount($guest); + } + } +} diff --git a/src/Amadeus/Client/Struct/Hotel/MultiSingleAvailability/HotelAmenity.php b/src/Amadeus/Client/Struct/Hotel/MultiSingleAvailability/HotelAmenity.php new file mode 100644 index 000000000..43a8ba21f --- /dev/null +++ b/src/Amadeus/Client/Struct/Hotel/MultiSingleAvailability/HotelAmenity.php @@ -0,0 +1,33 @@ + + */ +class HotelAmenity +{ +} diff --git a/src/Amadeus/Client/Struct/Hotel/MultiSingleAvailability/HotelFeature.php b/src/Amadeus/Client/Struct/Hotel/MultiSingleAvailability/HotelFeature.php new file mode 100644 index 000000000..fd5f45b5f --- /dev/null +++ b/src/Amadeus/Client/Struct/Hotel/MultiSingleAvailability/HotelFeature.php @@ -0,0 +1,33 @@ + + */ +class HotelFeature +{ +} diff --git a/src/Amadeus/Client/Struct/Hotel/MultiSingleAvailability/HotelMeetingFacility.php b/src/Amadeus/Client/Struct/Hotel/MultiSingleAvailability/HotelMeetingFacility.php new file mode 100644 index 000000000..b8a91af4a --- /dev/null +++ b/src/Amadeus/Client/Struct/Hotel/MultiSingleAvailability/HotelMeetingFacility.php @@ -0,0 +1,33 @@ + + */ +class HotelMeetingFacility +{ +} diff --git a/src/Amadeus/Client/Struct/Hotel/MultiSingleAvailability/HotelRef.php b/src/Amadeus/Client/Struct/Hotel/MultiSingleAvailability/HotelRef.php new file mode 100644 index 000000000..390a1b339 --- /dev/null +++ b/src/Amadeus/Client/Struct/Hotel/MultiSingleAvailability/HotelRef.php @@ -0,0 +1,103 @@ + + */ +class HotelRef +{ + /** + * @var string + */ + public $ChainCode; + + /** + * @var string + */ + public $BrandCode; + + /** + * @var string + */ + public $HotelCode; + + /** + * @var string + */ + public $HotelCityCode; + + /** + * @var string + */ + public $HotelName; + + /** + * @var string + */ + public $HotelCodeContext; + + /** + * @var string + */ + public $ChainName; + + /** + * @var string + */ + public $BrandName; + + /** + * @var string + */ + public $SegmentCategoryCode; + + /** + * @var string + */ + public $LocationCategoryCode; + + /** + * @var string + */ + public $ExtendedCitySearchIndicator; + + /** + * HotelRef constructor. + * + * @param HotelReference $ref + */ + public function __construct(HotelReference $ref) + { + $this->ChainCode = $ref->chainCode; + $this->HotelCityCode = $ref->cityCode; + $this->HotelCodeContext = $ref->codeContext; + $this->HotelCode = $ref->hotelCode; + $this->HotelName = $ref->name; + } +} diff --git a/src/Amadeus/Client/Struct/Hotel/MultiSingleAvailability/HotelSearchCriteria.php b/src/Amadeus/Client/Struct/Hotel/MultiSingleAvailability/HotelSearchCriteria.php new file mode 100644 index 000000000..a92b689a4 --- /dev/null +++ b/src/Amadeus/Client/Struct/Hotel/MultiSingleAvailability/HotelSearchCriteria.php @@ -0,0 +1,33 @@ + + */ +class HotelSearchCriteria extends HotelSearchCriteriaType +{ +} diff --git a/src/Amadeus/Client/Struct/Hotel/MultiSingleAvailability/HotelSearchCriteriaType.php b/src/Amadeus/Client/Struct/Hotel/MultiSingleAvailability/HotelSearchCriteriaType.php new file mode 100644 index 000000000..fb0d836ff --- /dev/null +++ b/src/Amadeus/Client/Struct/Hotel/MultiSingleAvailability/HotelSearchCriteriaType.php @@ -0,0 +1,68 @@ + + */ +class HotelSearchCriteriaType +{ + /** + * @var Criterion[] + */ + public $Criterion = []; + + /** + * @var bool + */ + public $BestOnlyIndicator; + + /** + * @var bool + */ + public $AvailableOnlyIndicator; + + public $TotalAfterTaxOnlyInd; + + /** + * HotelSearchCriteriaType constructor. + * + * @param Criteria[] $criteria + * @param bool $bestOnly + * @param bool $availableOnly + */ + public function __construct($criteria, $bestOnly, $availableOnly) + { + $this->BestOnlyIndicator = $bestOnly; + $this->AvailableOnlyIndicator = $availableOnly; + + foreach ($criteria as $criterion) { + $this->Criterion[] = new Criterion($criterion); + } + } +} diff --git a/src/Amadeus/Client/Struct/Hotel/MultiSingleAvailability/HotelSearchCriterionType.php b/src/Amadeus/Client/Struct/Hotel/MultiSingleAvailability/HotelSearchCriterionType.php new file mode 100644 index 000000000..a6309e36a --- /dev/null +++ b/src/Amadeus/Client/Struct/Hotel/MultiSingleAvailability/HotelSearchCriterionType.php @@ -0,0 +1,153 @@ + + */ +class HotelSearchCriterionType +{ + /** + * @var HotelAmenity[] + */ + public $HotelAmenity = []; + + /** + * @var RoomAmenity[] + */ + public $RoomAmenity = []; + + /** + * @var HotelFeature[] + */ + public $HotelFeature = []; + + /** + * @var Award[] + */ + public $Award = []; + + /** + * @var Recreation[] + */ + public $Recreation = []; + + /** + * @var Service[] + */ + public $Service = []; + + /** + * @var Transportation[] + */ + public $Transportation = []; + + /** + * @var StayDateRange + */ + public $StayDateRange; + + /** + * @var RateRange[] + */ + public $RateRange = []; + + /** + * @var RatePlanCandidates + */ + public $RatePlanCandidates; + + /** + * @var Profiles + */ + public $Profiles; + + /** + * @var RoomStayCandidates + */ + public $RoomStayCandidates; + + /** + * @var AcceptedPayments + */ + public $AcceptedPayments; + + /** + * @var Media[] + */ + public $Media = []; + + /** + * @var HotelMeetingFacility[] + */ + public $HotelMeetingFacility = []; + + /** + * @var MealPlan + */ + public $MealPlan; + + /** + * @var RebatePrograms + */ + public $RebatePrograms; + + /** + * @var UserGeneratedContent + */ + public $UserGeneratedContent; + + /** + * @var bool + */ + public $ExactMatch; + + public $ImportanceType; + + public $Ranking; + + public $Position; + + public $Address; + + public $Telephone; + + public $RefPoint = []; + + public $CodeRef; + + + /** + * @var HotelRef[] + */ + public $HotelRef = []; + + public $Radius; + + public $MapArea; + + public $AdditionalContents; +} diff --git a/src/Amadeus/Client/Struct/Hotel/MultiSingleAvailability/ItemSearchCriterionType.php b/src/Amadeus/Client/Struct/Hotel/MultiSingleAvailability/ItemSearchCriterionType.php new file mode 100644 index 000000000..dd0ac2a4f --- /dev/null +++ b/src/Amadeus/Client/Struct/Hotel/MultiSingleAvailability/ItemSearchCriterionType.php @@ -0,0 +1,64 @@ + + */ +class ItemSearchCriterionType +{ + /** + * @var bool + */ + public $ExactMatch; + + public $ImportanceType; + + public $Ranking; + + public $Position; + + public $Address; + + public $Telephone; + + public $RefPoint = []; + + public $CodeRef; + + /** + * @var HotelRef[] + */ + public $HotelRef = []; + + public $Radius; + + public $MapArea; + + public $AdditionalContents; + + +} diff --git a/src/Amadeus/Client/Struct/Hotel/MultiSingleAvailability/MealPlan.php b/src/Amadeus/Client/Struct/Hotel/MultiSingleAvailability/MealPlan.php new file mode 100644 index 000000000..5570d0074 --- /dev/null +++ b/src/Amadeus/Client/Struct/Hotel/MultiSingleAvailability/MealPlan.php @@ -0,0 +1,33 @@ + + */ +class MealPlan +{ +} diff --git a/src/Amadeus/Client/Struct/Hotel/MultiSingleAvailability/Media.php b/src/Amadeus/Client/Struct/Hotel/MultiSingleAvailability/Media.php new file mode 100644 index 000000000..36afca234 --- /dev/null +++ b/src/Amadeus/Client/Struct/Hotel/MultiSingleAvailability/Media.php @@ -0,0 +1,33 @@ + + */ +class Media +{ +} diff --git a/src/Amadeus/Client/Struct/Hotel/MultiSingleAvailability/PosType.php b/src/Amadeus/Client/Struct/Hotel/MultiSingleAvailability/PosType.php new file mode 100644 index 000000000..c1aada7ab --- /dev/null +++ b/src/Amadeus/Client/Struct/Hotel/MultiSingleAvailability/PosType.php @@ -0,0 +1,37 @@ + + */ +class PosType +{ + /** + * @var mixed[] + */ + public $Source = []; +} diff --git a/src/Amadeus/Client/Struct/Hotel/MultiSingleAvailability/Profiles.php b/src/Amadeus/Client/Struct/Hotel/MultiSingleAvailability/Profiles.php new file mode 100644 index 000000000..a5dd5f890 --- /dev/null +++ b/src/Amadeus/Client/Struct/Hotel/MultiSingleAvailability/Profiles.php @@ -0,0 +1,33 @@ + + */ +class Profiles +{ +} diff --git a/src/Amadeus/Client/Struct/Hotel/MultiSingleAvailability/RatePlanCandidates.php b/src/Amadeus/Client/Struct/Hotel/MultiSingleAvailability/RatePlanCandidates.php new file mode 100644 index 000000000..6b6384fab --- /dev/null +++ b/src/Amadeus/Client/Struct/Hotel/MultiSingleAvailability/RatePlanCandidates.php @@ -0,0 +1,33 @@ + + */ +class RatePlanCandidates +{ +} diff --git a/src/Amadeus/Client/Struct/Hotel/MultiSingleAvailability/RateRange.php b/src/Amadeus/Client/Struct/Hotel/MultiSingleAvailability/RateRange.php new file mode 100644 index 000000000..ee623c561 --- /dev/null +++ b/src/Amadeus/Client/Struct/Hotel/MultiSingleAvailability/RateRange.php @@ -0,0 +1,88 @@ + + */ +class RateRange +{ + const TIMEUNIT_YEAR = "Year"; + const TIMEUNIT_MONTH = "Month"; + const TIMEUNIT_WEEK = "Week"; + const TIMEUNIT_DAY = "Day"; + const TIMEUNIT_HOUR = "Hour"; + const TIMEUNIT_SECOND = "Second"; + const TIMEUNIT_FULL_DURATION = "FullDuration"; + const TIMEUNIT_MINUTE = "Minute"; + + /** + * @var double|string + */ + public $MinRate; + + /** + * @var double|string + */ + public $MaxRate; + + /** + * @var double|string + */ + public $FixedRate; + + /** + * self::TIMEUNIT_* + * + * @var string + */ + public $RateTimeUnit; + + /** + * @var string + */ + public $CurrencyCode; + + /** + * @var int + */ + public $DecimalPlaces; + + /** + * RateRange constructor. + * + * @param Rates $rates + */ + public function __construct(Rates $rates) + { + $this->MinRate = $rates->min; + $this->MaxRate = $rates->max; + $this->CurrencyCode = $rates->currency; + $this->RateTimeUnit = $rates->timeUnit; + } +} diff --git a/src/Amadeus/Client/Struct/Hotel/MultiSingleAvailability/RebatePrograms.php b/src/Amadeus/Client/Struct/Hotel/MultiSingleAvailability/RebatePrograms.php new file mode 100644 index 000000000..b382b21b0 --- /dev/null +++ b/src/Amadeus/Client/Struct/Hotel/MultiSingleAvailability/RebatePrograms.php @@ -0,0 +1,33 @@ + + */ +class RebatePrograms +{ +} diff --git a/src/Amadeus/Client/Struct/Hotel/MultiSingleAvailability/Recreation.php b/src/Amadeus/Client/Struct/Hotel/MultiSingleAvailability/Recreation.php new file mode 100644 index 000000000..449bcd587 --- /dev/null +++ b/src/Amadeus/Client/Struct/Hotel/MultiSingleAvailability/Recreation.php @@ -0,0 +1,33 @@ + + */ +class Recreation +{ +} diff --git a/src/Amadeus/Client/Struct/Hotel/MultiSingleAvailability/RoomAmenity.php b/src/Amadeus/Client/Struct/Hotel/MultiSingleAvailability/RoomAmenity.php new file mode 100644 index 000000000..64d8e0ea7 --- /dev/null +++ b/src/Amadeus/Client/Struct/Hotel/MultiSingleAvailability/RoomAmenity.php @@ -0,0 +1,33 @@ + + */ +class RoomAmenity +{ +} diff --git a/src/Amadeus/Client/Struct/Hotel/MultiSingleAvailability/RoomStayCandidate.php b/src/Amadeus/Client/Struct/Hotel/MultiSingleAvailability/RoomStayCandidate.php new file mode 100644 index 000000000..530b11669 --- /dev/null +++ b/src/Amadeus/Client/Struct/Hotel/MultiSingleAvailability/RoomStayCandidate.php @@ -0,0 +1,62 @@ + + */ +class RoomStayCandidate +{ + /** + * @var int + */ + public $RoomID; + + /** + * @var int + */ + public $Quantity; + + /** + * @var GuestCounts + */ + public $GuestCounts; + + /** + * RoomStayCandidate constructor. + * + * @param Room $room + */ + public function __construct(Room $room) + { + $this->RoomID = $room->id; + $this->Quantity = $room->amount; + + $this->GuestCounts = new GuestCounts($room->guestsIsPerRoom, $room->guests); + } +} diff --git a/src/Amadeus/Client/Struct/Hotel/MultiSingleAvailability/RoomStayCandidates.php b/src/Amadeus/Client/Struct/Hotel/MultiSingleAvailability/RoomStayCandidates.php new file mode 100644 index 000000000..765f54972 --- /dev/null +++ b/src/Amadeus/Client/Struct/Hotel/MultiSingleAvailability/RoomStayCandidates.php @@ -0,0 +1,37 @@ + + */ +class RoomStayCandidates +{ + /** + * @var RoomStayCandidate[] + */ + public $RoomStayCandidate = []; +} diff --git a/src/Amadeus/Client/Struct/Hotel/MultiSingleAvailability/Service.php b/src/Amadeus/Client/Struct/Hotel/MultiSingleAvailability/Service.php new file mode 100644 index 000000000..c50cbc483 --- /dev/null +++ b/src/Amadeus/Client/Struct/Hotel/MultiSingleAvailability/Service.php @@ -0,0 +1,33 @@ + + */ +class Service +{ +} diff --git a/src/Amadeus/Client/Struct/Hotel/MultiSingleAvailability/StayDateRange.php b/src/Amadeus/Client/Struct/Hotel/MultiSingleAvailability/StayDateRange.php new file mode 100644 index 000000000..298540a38 --- /dev/null +++ b/src/Amadeus/Client/Struct/Hotel/MultiSingleAvailability/StayDateRange.php @@ -0,0 +1,82 @@ + + */ +class StayDateRange extends WsMessageUtility +{ + /** + * yyyy-mm-dd + * + * @var string + */ + public $Start; + + /** + * @var string + */ + public $Duration; + + /** + * yyyy-mm-dd + * + * @var string + */ + public $End; + + /** + * StayDateRange constructor. + * + * @param \DateTime $start + * @param \DateTime $end + */ + public function __construct($start, $end) + { + $this->Start = $this->makeDateString($start); + $this->End = $this->makeDateString($end); + } + + /** + * yyyy-mm-dd + * + * @param \DateTime|null $date + * @return string + */ + protected function makeDateString($date) + { + $dateStr = '0000-00-00'; + + if ($date instanceof \DateTime) { + $dateStr = $date->format('Y-m-d'); + } + + return $dateStr; + } +} diff --git a/src/Amadeus/Client/Struct/Hotel/MultiSingleAvailability/Transportation.php b/src/Amadeus/Client/Struct/Hotel/MultiSingleAvailability/Transportation.php new file mode 100644 index 000000000..de7a12348 --- /dev/null +++ b/src/Amadeus/Client/Struct/Hotel/MultiSingleAvailability/Transportation.php @@ -0,0 +1,33 @@ + + */ +class Transportation +{ +} diff --git a/src/Amadeus/Client/Struct/Hotel/MultiSingleAvailability/UserGeneratedContent.php b/src/Amadeus/Client/Struct/Hotel/MultiSingleAvailability/UserGeneratedContent.php new file mode 100644 index 000000000..63769501b --- /dev/null +++ b/src/Amadeus/Client/Struct/Hotel/MultiSingleAvailability/UserGeneratedContent.php @@ -0,0 +1,33 @@ + + */ +class UserGeneratedContent +{ +} diff --git a/src/Amadeus/Client/Struct/Hotel/Sell.php b/src/Amadeus/Client/Struct/Hotel/Sell.php new file mode 100644 index 000000000..db130bbb6 --- /dev/null +++ b/src/Amadeus/Client/Struct/Hotel/Sell.php @@ -0,0 +1,100 @@ + + */ +class Sell extends BaseWsMessage +{ + /** + * @var SystemIdentifier + */ + public $systemIdentifier; + + /** + * @var BookingCompany[] + */ + public $bookingCompany = []; + + /** + * @var ReservationInfo + */ + public $reservationInfo; + + /** + * @var ExtraIndentification + */ + public $extraIndentification; + + /** + * @var GroupIndicator + */ + public $groupIndicator; + + /** + * @var TravelAgentRef[] + */ + public $travelAgentRef = []; + + /** + * @var BookingPayerDetails + */ + public $bookingPayerDetails; + + /** + * @var RoomStayData[] + */ + public $roomStayData = []; + + /** + * @var ArrivalFlightDetailsGrp + */ + public $arrivalFlightDetailsGrp; + + /** + * Hotel_Sell constructor. + * + * @param HotelSellOptions $options + */ + public function __construct(HotelSellOptions $options) + { + //TODO + $this->roomStayData = $options->roomStayData; + } +} diff --git a/src/Amadeus/Client/Struct/Hotel/Sell/AddressDetails.php b/src/Amadeus/Client/Struct/Hotel/Sell/AddressDetails.php new file mode 100644 index 000000000..65aaf31a3 --- /dev/null +++ b/src/Amadeus/Client/Struct/Hotel/Sell/AddressDetails.php @@ -0,0 +1,62 @@ + + */ +class AddressDetails +{ + /** + * @var string + */ + public $format; + + /** + * @var string + */ + public $line1; + + /** + * @var string + */ + public $line2; + + /** + * @var string + */ + public $line3; + + /** + * @var string + */ + public $line4; + + /** + * @var string + */ + public $line5; +} diff --git a/src/Amadeus/Client/Struct/Hotel/Sell/ArrivalFlightDetailsData.php b/src/Amadeus/Client/Struct/Hotel/Sell/ArrivalFlightDetailsData.php new file mode 100644 index 000000000..d1208a0b1 --- /dev/null +++ b/src/Amadeus/Client/Struct/Hotel/Sell/ArrivalFlightDetailsData.php @@ -0,0 +1,34 @@ + + */ +class ArrivalFlightDetailsData +{ + //TODO +} diff --git a/src/Amadeus/Client/Struct/Hotel/Sell/ArrivalFlightDetailsGrp.php b/src/Amadeus/Client/Struct/Hotel/Sell/ArrivalFlightDetailsGrp.php new file mode 100644 index 000000000..056c521e2 --- /dev/null +++ b/src/Amadeus/Client/Struct/Hotel/Sell/ArrivalFlightDetailsGrp.php @@ -0,0 +1,42 @@ + + */ +class ArrivalFlightDetailsGrp +{ + /** + * @var ArrivalFlightDetailsTag + */ + public $arrivalFlightDetailsTag; + + /** + * @var ArrivalFlightDetailsData + */ + public $arrivalFlightDetailsData; +} diff --git a/src/Amadeus/Client/Struct/Hotel/Sell/ArrivalFlightDetailsTag.php b/src/Amadeus/Client/Struct/Hotel/Sell/ArrivalFlightDetailsTag.php new file mode 100644 index 000000000..241565ccf --- /dev/null +++ b/src/Amadeus/Client/Struct/Hotel/Sell/ArrivalFlightDetailsTag.php @@ -0,0 +1,34 @@ + + */ +class ArrivalFlightDetailsTag +{ + //TODO +} diff --git a/src/Amadeus/Client/Struct/Hotel/Sell/AttributeDetails.php b/src/Amadeus/Client/Struct/Hotel/Sell/AttributeDetails.php new file mode 100644 index 000000000..82803ad31 --- /dev/null +++ b/src/Amadeus/Client/Struct/Hotel/Sell/AttributeDetails.php @@ -0,0 +1,54 @@ + + */ +class AttributeDetails +{ + const TYPE_BRAND = "BRA"; + const TYPE_CORPORATION_NAME = "CORP"; + const TYPE_SUB_BRAND = "SBR"; + const TYPE_SUB_SUB_BRAND = "SSB"; + + /** + * self::TYPE_* + * + * @var string + */ + public $attributeType; + + /** + * AttributeDetails constructor. + * + * @param string $attributeType + */ + public function __construct($attributeType) + { + $this->attributeType = $attributeType; + } +} diff --git a/src/Amadeus/Client/Struct/Hotel/Sell/BookerAddress.php b/src/Amadeus/Client/Struct/Hotel/Sell/BookerAddress.php new file mode 100644 index 000000000..75e248775 --- /dev/null +++ b/src/Amadeus/Client/Struct/Hotel/Sell/BookerAddress.php @@ -0,0 +1,62 @@ + + */ +class BookerAddress +{ + /** + * @var AddressDetails + */ + public $addressDetails; + + /** + * @var string + */ + public $city; + + /** + * @var string + */ + public $zipCode; + + /** + * @var string + */ + public $countryCode; + + /** + * @var LocationDetails + */ + public $regionDetails; + + /** + * @var LocationDetails + */ + public $locationDetails; +} diff --git a/src/Amadeus/Client/Struct/Hotel/Sell/BookerName.php b/src/Amadeus/Client/Struct/Hotel/Sell/BookerName.php new file mode 100644 index 000000000..fedb7b90e --- /dev/null +++ b/src/Amadeus/Client/Struct/Hotel/Sell/BookerName.php @@ -0,0 +1,42 @@ + + */ +class BookerName +{ + /** + * @var TravellerNameInfo + */ + public $travellerNameInfo; + + /** + * @var OtherPaxNamesDetails + */ + public $otherPaxNamesDetails; +} diff --git a/src/Amadeus/Client/Struct/Hotel/Sell/BookingCompany.php b/src/Amadeus/Client/Struct/Hotel/Sell/BookingCompany.php new file mode 100644 index 000000000..c26e5e7d5 --- /dev/null +++ b/src/Amadeus/Client/Struct/Hotel/Sell/BookingCompany.php @@ -0,0 +1,59 @@ + + */ +class BookingCompany +{ + /** + * @var CompanyQualifier + */ + public $companyQualifier; + + /** + * @var CompanyName + */ + public $companyName; + + /** + * BookingCompany constructor. + * + * @param string|null $company Company name + * @param string|null $type AttributeDetails::TYPE_* + */ + public function __construct($company = null, $type = null) + { + if (!is_null($company)) { + $this->companyName = new CompanyName($company); + } + + if (!is_null($type)) { + $this->companyQualifier = new CompanyQualifier($type); + } + } +} diff --git a/src/Amadeus/Client/Struct/Hotel/Sell/BookingPayer.php b/src/Amadeus/Client/Struct/Hotel/Sell/BookingPayer.php new file mode 100644 index 000000000..dcfe07244 --- /dev/null +++ b/src/Amadeus/Client/Struct/Hotel/Sell/BookingPayer.php @@ -0,0 +1,37 @@ + + */ +class BookingPayer +{ + /** + * @var PassengerReference + */ + public $passengerReference; +} diff --git a/src/Amadeus/Client/Struct/Hotel/Sell/BookingPayerDetails.php b/src/Amadeus/Client/Struct/Hotel/Sell/BookingPayerDetails.php new file mode 100644 index 000000000..842b203d7 --- /dev/null +++ b/src/Amadeus/Client/Struct/Hotel/Sell/BookingPayerDetails.php @@ -0,0 +1,62 @@ + + */ +class BookingPayerDetails +{ + /** + * @var BookerName + */ + public $bookerName; + + /** + * @var BookingPayer + */ + public $bookingPayer; + + /** + * @var GuestContactInfo + */ + public $guestContactInfo; + + /** + * @var OccupantPreferences + */ + public $occupantPreferences; + + /** + * @var OccupantPersonalInformation + */ + public $occupantPersonalInformation; + + /** + * @var BookerAddress + */ + public $bookerAddress; +} diff --git a/src/Amadeus/Client/Struct/Hotel/Sell/CompanyName.php b/src/Amadeus/Client/Struct/Hotel/Sell/CompanyName.php new file mode 100644 index 000000000..74da89d17 --- /dev/null +++ b/src/Amadeus/Client/Struct/Hotel/Sell/CompanyName.php @@ -0,0 +1,47 @@ + + */ +class CompanyName +{ + /** + * @var string + */ + public $companyName; + + /** + * CompanyName constructor. + * + * @param string $companyName + */ + public function __construct($companyName) + { + $this->companyName = $companyName; + } +} diff --git a/src/Amadeus/Client/Struct/Hotel/Sell/CompanyQualifier.php b/src/Amadeus/Client/Struct/Hotel/Sell/CompanyQualifier.php new file mode 100644 index 000000000..d75f9b7af --- /dev/null +++ b/src/Amadeus/Client/Struct/Hotel/Sell/CompanyQualifier.php @@ -0,0 +1,47 @@ + + */ +class CompanyQualifier +{ + /** + * @var AttributeDetails[] + */ + public $attributeDetails = []; + + /** + * CompanyQualifier constructor. + * + * @param string $companyQualifier AttributeDetails::TYPE_* + */ + public function __construct($companyQualifier) + { + $this->attributeDetails[] = new AttributeDetails($companyQualifier); + } +} diff --git a/src/Amadeus/Client/Struct/Hotel/Sell/DeliveringSystem.php b/src/Amadeus/Client/Struct/Hotel/Sell/DeliveringSystem.php new file mode 100644 index 000000000..3b65f33e9 --- /dev/null +++ b/src/Amadeus/Client/Struct/Hotel/Sell/DeliveringSystem.php @@ -0,0 +1,57 @@ + + */ +class DeliveringSystem +{ + const COMPANY_ERETAIL = "AERE"; + const COMPANY_ETRAVEL_MANAGEMENT = "AETM"; + const COMPANY_COMMAND_PAGE = "COMM"; + const COMPANY_SELL2_SELL_CONNECT = "SECO"; + const COMPANY_SELLING_PLATFORM_CLASSIC = "SELL"; + const COMPANY_NON_SPECIFIC_PRODUCT_FROM_SEL = "SEP"; + const COMPANY_WEBSERVICES = "WEBS"; + + /** + * self::COMPANY_* + * + * @var string + */ + public $companyId; + + /** + * DeliveringSystem constructor. + * + * @param string $companyId + */ + public function __construct($companyId = self::COMPANY_WEBSERVICES) + { + $this->companyId = $companyId; + } +} diff --git a/src/Amadeus/Client/Struct/Hotel/Sell/DocumentIdentification.php b/src/Amadeus/Client/Struct/Hotel/Sell/DocumentIdentification.php new file mode 100644 index 000000000..781587e12 --- /dev/null +++ b/src/Amadeus/Client/Struct/Hotel/Sell/DocumentIdentification.php @@ -0,0 +1,67 @@ + + */ +class DocumentIdentification +{ + const TYPE_CEDULA_ARGENTINIAN_ID = "CED"; + /** + * NUMBER FOR BRAZILIANS AND RESIDENT ALIENS WHO PAY TAXES IN BRAZIL + */ + const TYPE_CADASTRO_DE_PESSOAS_FISICAS = "CPF"; + const TYPE_LOCAL_ID_DOCUMENT = "ID"; + const TYPE_NATIONAL_ID_CARD = "NI"; + const TYPE_OTHER_ID_DOCUMENT = "OTH"; + const TYPE_PASSPORT = "PT"; + const TYPE_VISA = "VI"; + + /** + * self::TYPE_* + * + * @var string + */ + public $type; + + /** + * @var string + */ + public $number; + + /** + * DocumentIdentification constructor. + * + * @param string $number + * @param string $type + */ + public function __construct($number, $type) + { + $this->type = $type; + $this->number = $number; + } +} diff --git a/src/Amadeus/Client/Struct/Hotel/Sell/ExtraIndentification.php b/src/Amadeus/Client/Struct/Hotel/Sell/ExtraIndentification.php new file mode 100644 index 000000000..2b0db8440 --- /dev/null +++ b/src/Amadeus/Client/Struct/Hotel/Sell/ExtraIndentification.php @@ -0,0 +1,37 @@ + + */ +class ExtraIndentification +{ + /** + * @var ReferenceDetails[] + */ + public $referenceDetails = []; +} diff --git a/src/Amadeus/Client/Struct/Hotel/Sell/GroupIndicator.php b/src/Amadeus/Client/Struct/Hotel/Sell/GroupIndicator.php new file mode 100644 index 000000000..2b9dc4e2e --- /dev/null +++ b/src/Amadeus/Client/Struct/Hotel/Sell/GroupIndicator.php @@ -0,0 +1,48 @@ + + */ +class GroupIndicator +{ + /** + * @var StatusDetails[] + */ + public $statusDetails = []; + + /** + * GroupIndicator constructor. + * + * @param string $indicator StatusDetails::INDICATOR_* + * @param int|string $action StatusDetails::ACTION_* + */ + public function __construct($indicator, $action) + { + $this->statusDetails[] = new StatusDetails($indicator, $action); + } +} diff --git a/src/Amadeus/Client/Struct/Hotel/Sell/GuestContactInfo.php b/src/Amadeus/Client/Struct/Hotel/Sell/GuestContactInfo.php new file mode 100644 index 000000000..e968304f9 --- /dev/null +++ b/src/Amadeus/Client/Struct/Hotel/Sell/GuestContactInfo.php @@ -0,0 +1,53 @@ + + */ +class GuestContactInfo +{ + const TYPE_EMAIL = "EML"; + /** + * @var string + */ + public $phoneOrEmailType = self::TYPE_EMAIL; + + /** + * @var string + */ + public $emailAddress; + + /** + * GuestContactInfo constructor. + * + * @param string $emailAddress + */ + public function __construct($emailAddress) + { + $this->emailAddress = $emailAddress; + } +} diff --git a/src/Amadeus/Client/Struct/Hotel/Sell/LocationDetails.php b/src/Amadeus/Client/Struct/Hotel/Sell/LocationDetails.php new file mode 100644 index 000000000..031747e9e --- /dev/null +++ b/src/Amadeus/Client/Struct/Hotel/Sell/LocationDetails.php @@ -0,0 +1,47 @@ + + */ +class LocationDetails +{ + /** + * @var string + */ + public $name; + + /** + * LocationDetails constructor. + * + * @param string $name + */ + public function __construct($name) + { + $this->name = $name; + } +} diff --git a/src/Amadeus/Client/Struct/Hotel/Sell/OccupantPersonalInformation.php b/src/Amadeus/Client/Struct/Hotel/Sell/OccupantPersonalInformation.php new file mode 100644 index 000000000..e43572886 --- /dev/null +++ b/src/Amadeus/Client/Struct/Hotel/Sell/OccupantPersonalInformation.php @@ -0,0 +1,47 @@ + + */ +class OccupantPersonalInformation +{ + const GENDER_FEMALE = "F"; + const GENDER_MALE = "M"; + + /** + * self::GENDER_* + * + * @var string + */ + public $regulatoryGender; + + /** + * @var DocumentIdentification + */ + public $documentIdentification; +} diff --git a/src/Amadeus/Client/Struct/Hotel/Sell/OccupantPreferences.php b/src/Amadeus/Client/Struct/Hotel/Sell/OccupantPreferences.php new file mode 100644 index 000000000..b4f082641 --- /dev/null +++ b/src/Amadeus/Client/Struct/Hotel/Sell/OccupantPreferences.php @@ -0,0 +1,37 @@ + + */ +class OccupantPreferences +{ + /** + * @var UserPreferences + */ + public $userPreferences; +} diff --git a/src/Amadeus/Client/Struct/Hotel/Sell/OtherPaxNamesDetails.php b/src/Amadeus/Client/Struct/Hotel/Sell/OtherPaxNamesDetails.php new file mode 100644 index 000000000..5eaebc26a --- /dev/null +++ b/src/Amadeus/Client/Struct/Hotel/Sell/OtherPaxNamesDetails.php @@ -0,0 +1,61 @@ + + */ +class OtherPaxNamesDetails +{ + /** + * @var string + */ + public $surname; + + /** + * @var string + */ + public $givenName; + + /** + * @var string + */ + public $title; + + /** + * OtherPaxNamesDetails constructor. + * + * @param string $surname + * @param string $givenName + * @param string|null $title + */ + public function __construct($surname, $givenName, $title = null) + { + $this->surname = $surname; + $this->givenName = $givenName; + $this->title = $title; + } +} diff --git a/src/Amadeus/Client/Struct/Hotel/Sell/PassengerReference.php b/src/Amadeus/Client/Struct/Hotel/Sell/PassengerReference.php new file mode 100644 index 000000000..957c93aa0 --- /dev/null +++ b/src/Amadeus/Client/Struct/Hotel/Sell/PassengerReference.php @@ -0,0 +1,59 @@ + + */ +class PassengerReference +{ + const TYPE_BOOKING_PAYER_AND_HOLDER_NON_OCCUPANT = "BHN"; + const TYPE_BOOKING_PAYER_AND_HOLDER_OCCUPANT = "BHO"; + const TYPE_BOOKING_PAYER_NON_OCCUPANT = "BPN"; + const TYPE_BOOKING_PAYER_OCCUPANT = "BPO"; + + /** + * self::TYPE_* + * + * @var string + */ + public $type; + + /** + * @var int + */ + public $value; + + /** + * @param int $tattoo + * @param string $type self::TYPE_* + */ + public function __construct($tattoo, $type) + { + $this->value = $tattoo; + $this->type = $type; + } +} diff --git a/src/Amadeus/Client/Struct/Hotel/Sell/Reference.php b/src/Amadeus/Client/Struct/Hotel/Sell/Reference.php new file mode 100644 index 000000000..6a5a871fe --- /dev/null +++ b/src/Amadeus/Client/Struct/Hotel/Sell/Reference.php @@ -0,0 +1,56 @@ + + */ +class Reference +{ + const TYPE_SEGMENT_TATTOO = "ST"; + + /** + * @var string + */ + public $type = self::TYPE_SEGMENT_TATTOO; + + /** + * @var int + */ + public $value; + + /** + * Reference constructor. + * + * @param int $value + * @param string $type + */ + public function __construct($value, $type = self::TYPE_SEGMENT_TATTOO) + { + $this->type = $type; + $this->value = $value; + } +} diff --git a/src/Amadeus/Client/Struct/Hotel/Sell/ReferenceDetails.php b/src/Amadeus/Client/Struct/Hotel/Sell/ReferenceDetails.php new file mode 100644 index 000000000..871b24069 --- /dev/null +++ b/src/Amadeus/Client/Struct/Hotel/Sell/ReferenceDetails.php @@ -0,0 +1,42 @@ + + */ +class ReferenceDetails +{ + /** + * @var string + */ + public $type; + + /** + * @var string + */ + public $value; +} diff --git a/src/Amadeus/Client/Struct/Hotel/Sell/RoomStayData.php b/src/Amadeus/Client/Struct/Hotel/Sell/RoomStayData.php new file mode 100644 index 000000000..9ddd18ea5 --- /dev/null +++ b/src/Amadeus/Client/Struct/Hotel/Sell/RoomStayData.php @@ -0,0 +1,33 @@ + + */ +class RoomStayData extends \Amadeus\Client\Struct\Offer\ConfirmHotel\RoomStayData +{ +} diff --git a/src/Amadeus/Client/Struct/Hotel/Sell/StatusDetails.php b/src/Amadeus/Client/Struct/Hotel/Sell/StatusDetails.php new file mode 100644 index 000000000..1619c54e1 --- /dev/null +++ b/src/Amadeus/Client/Struct/Hotel/Sell/StatusDetails.php @@ -0,0 +1,64 @@ + + */ +class StatusDetails +{ + const INDICATOR_GROUP_BILLING = "GB"; + const INDICATOR_GROUP_BOOKING = "GR"; + + const ACTION_YES = 1; + const ACTION_NO = 2; + + /** + * self::INDICATOR_* + * + * @var string + */ + public $indicator; + + /** + * self::ACTION_* + * + * @var string|int + */ + public $action; + + /** + * StatusDetails constructor. + * + * @param string $indicator self::INDICATOR_* + * @param int|string $action self::ACTION_* + */ + public function __construct($indicator, $action) + { + $this->indicator = $indicator; + $this->action = $action; + } +} diff --git a/src/Amadeus/Client/Struct/Hotel/Sell/SystemIdentifier.php b/src/Amadeus/Client/Struct/Hotel/Sell/SystemIdentifier.php new file mode 100644 index 000000000..ef6448d74 --- /dev/null +++ b/src/Amadeus/Client/Struct/Hotel/Sell/SystemIdentifier.php @@ -0,0 +1,47 @@ + + */ +class SystemIdentifier +{ + /** + * @var DeliveringSystem + */ + public $deliveringSystem; + + /** + * SystemIdentifier constructor. + * + * @param string $companyId + */ + public function __construct($companyId = DeliveringSystem::COMPANY_WEBSERVICES) + { + $this->deliveringSystem = new DeliveringSystem($companyId); + } +} diff --git a/src/Amadeus/Client/Struct/Hotel/Sell/TravelAgentRef.php b/src/Amadeus/Client/Struct/Hotel/Sell/TravelAgentRef.php new file mode 100644 index 000000000..c75599ea2 --- /dev/null +++ b/src/Amadeus/Client/Struct/Hotel/Sell/TravelAgentRef.php @@ -0,0 +1,60 @@ + + */ +class TravelAgentRef +{ + const REFERENCE_PHONE = "AP"; + const REFERENCE_EMAIL = "APE"; + const REFERENCE_FAX = "APF"; + + /** + * self::REFERENCE_* + * + * @var string + */ + public $status; + + /** + * @var Reference + */ + public $reference; + + /** + * TravelAgentRef constructor. + * + * @param string $status self::REFERENCE_* + * @param int $segmentTattoo + */ + public function __construct($status, $segmentTattoo) + { + $this->status = $status; + $this->reference = new Reference($segmentTattoo); + } +} diff --git a/src/Amadeus/Client/Struct/Hotel/Sell/TravellerNameInfo.php b/src/Amadeus/Client/Struct/Hotel/Sell/TravellerNameInfo.php new file mode 100644 index 000000000..e45c704cc --- /dev/null +++ b/src/Amadeus/Client/Struct/Hotel/Sell/TravellerNameInfo.php @@ -0,0 +1,53 @@ + + */ +class TravellerNameInfo +{ + /** + * @var int + */ + public $quantity; + + /** + * @var int + */ + public $age; + + /** + * TravellerNameInfo constructor. + * + * @param int $quantity + * @param int|null $age + */ + public function __construct($quantity, $age = null) + { + $this->quantity = $quantity; + } +} diff --git a/src/Amadeus/Client/Struct/Hotel/Sell/UserPreferences.php b/src/Amadeus/Client/Struct/Hotel/Sell/UserPreferences.php new file mode 100644 index 000000000..725de4a6b --- /dev/null +++ b/src/Amadeus/Client/Struct/Hotel/Sell/UserPreferences.php @@ -0,0 +1,47 @@ + + */ +class UserPreferences +{ + /** + * @var string + */ + public $codedLanguage; + + /** + * UserPreferences constructor. + * + * @param string $codedLanguage + */ + public function __construct($codedLanguage) + { + $this->codedLanguage = $codedLanguage; + } +} diff --git a/src/Amadeus/Client/Struct/Pay/PAYGetVirtualCreditCard.php b/src/Amadeus/Client/Struct/Pay/PAYGetVirtualCreditCard.php new file mode 100644 index 000000000..70d0f7c6c --- /dev/null +++ b/src/Amadeus/Client/Struct/Pay/PAYGetVirtualCreditCard.php @@ -0,0 +1,24 @@ +transactionContext = $requestOptions->transactionContext; + $this->paymentAndPnrContext = $requestOptions->paymentAndPnrContext; + } + } +} \ No newline at end of file diff --git a/src/Amadeus/Client/Struct/Pnr/AddMultiElements/DataElementsIndiv.php b/src/Amadeus/Client/Struct/Pnr/AddMultiElements/DataElementsIndiv.php index e489a14c2..3061ab278 100644 --- a/src/Amadeus/Client/Struct/Pnr/AddMultiElements/DataElementsIndiv.php +++ b/src/Amadeus/Client/Struct/Pnr/AddMultiElements/DataElementsIndiv.php @@ -190,6 +190,14 @@ protected function loadElement($element, $elementType) $this->formOfPayment->fop->freetext = $element->freeText; } elseif ($element->type === Fop::IDENT_MISC && $element->freeText === "NONREF") { $this->fopExtension[] = new FopExtension(1); + }elseif($element->type === Fop::IDENT_CASH && $element->fopExtension === "INF") { + $this->fopExtension[] = new FopExtension( + 1, + null, + null, + 'INF' + + ); } elseif ($element->type === Fop::IDENT_CHECK) { throw new \RuntimeException("FOP CHECK NOT YET IMPLEMENTED"); } diff --git a/src/Amadeus/Client/Struct/Pnr/AddMultiElements/FopExtension.php b/src/Amadeus/Client/Struct/Pnr/AddMultiElements/FopExtension.php index c823da8a6..6a09bf931 100644 --- a/src/Amadeus/Client/Struct/Pnr/AddMultiElements/FopExtension.php +++ b/src/Amadeus/Client/Struct/Pnr/AddMultiElements/FopExtension.php @@ -60,12 +60,15 @@ class FopExtension extends WsMessageUtility * @param string|null $cvcCode * @param string|null $holderName */ - public function __construct($fopSequenceNumber, $cvcCode = null, $holderName = null) + public function __construct($fopSequenceNumber, $cvcCode = null, $holderName = null, $passengerType = null) { if (is_numeric($fopSequenceNumber)) { - $this->fopSequenceNumber = (int) $fopSequenceNumber; + $this->fopSequenceNumber = (int)$fopSequenceNumber; } + if ($this->checkAnyNotEmpty($passengerType)) { + $this->passengerType=$passengerType; + } if ($this->checkAnyNotEmpty($cvcCode, $holderName)) { $this->newFopsDetails = new NewFopsDetails(); $this->newFopsDetails->cvData = $cvcCode; diff --git a/src/Amadeus/Client/Struct/Pnr/CreateTsm.php b/src/Amadeus/Client/Struct/Pnr/CreateTsm.php new file mode 100644 index 000000000..e73c28cc3 --- /dev/null +++ b/src/Amadeus/Client/Struct/Pnr/CreateTsm.php @@ -0,0 +1,24 @@ +msg = $options->msg; + $this->mcoData = $options->mcoData; + } + } +} \ No newline at end of file diff --git a/src/Amadeus/Client/Struct/Pnr/DeleteTsm.php b/src/Amadeus/Client/Struct/Pnr/DeleteTsm.php new file mode 100644 index 000000000..ed8f26150 --- /dev/null +++ b/src/Amadeus/Client/Struct/Pnr/DeleteTsm.php @@ -0,0 +1,22 @@ +criteriaTattoo = $options->criteriaTattoo; + } + } +} \ No newline at end of file diff --git a/src/Amadeus/Client/Struct/Pnr/NameChange/OtherPaxNamesDetails.php b/src/Amadeus/Client/Struct/Pnr/NameChange/OtherPaxNamesDetails.php index 466598511..93988e188 100644 --- a/src/Amadeus/Client/Struct/Pnr/NameChange/OtherPaxNamesDetails.php +++ b/src/Amadeus/Client/Struct/Pnr/NameChange/OtherPaxNamesDetails.php @@ -22,13 +22,15 @@ namespace Amadeus\Client\Struct\Pnr\NameChange; +use Amadeus\Client\Struct\Hotel\Sell\OtherPaxNamesDetails as HotelSellPND; + /** * OtherPaxNamesDetails * * @package Amadeus\Client\Struct\Pnr\NameChange * @author Dieter Devlieghere */ -class OtherPaxNamesDetails +class OtherPaxNamesDetails extends HotelSellPND { /** * NN1 Romanizable Native Name @@ -46,33 +48,4 @@ class OtherPaxNamesDetails * @var string */ public $referenceName; - - /** - * @var string - */ - public $surname; - - /** - * @var string - */ - public $givenName; - - /** - * @var string - */ - public $title; - - /** - * OtherPaxNamesDetails constructor. - * - * @param string $surname - * @param string $givenName - * @param string|null $title - */ - public function __construct($surname, $givenName, $title = null) - { - $this->surname = $surname; - $this->givenName = $givenName; - $this->title = $title; - } } diff --git a/src/Amadeus/Client/Struct/Pnr/NameChange/TravellerNameInfo.php b/src/Amadeus/Client/Struct/Pnr/NameChange/TravellerNameInfo.php index 94f11360c..fec490dc1 100644 --- a/src/Amadeus/Client/Struct/Pnr/NameChange/TravellerNameInfo.php +++ b/src/Amadeus/Client/Struct/Pnr/NameChange/TravellerNameInfo.php @@ -31,7 +31,7 @@ class TravellerNameInfo { /** - * @var string|string + * @var string|int */ public $quantity; diff --git a/src/Amadeus/Client/Struct/Profile/ProfileCreateProfile.php b/src/Amadeus/Client/Struct/Profile/ProfileCreateProfile.php new file mode 100644 index 000000000..d5ea7853e --- /dev/null +++ b/src/Amadeus/Client/Struct/Profile/ProfileCreateProfile.php @@ -0,0 +1,28 @@ +Version= $options->Version; + $this->UniqueID= $options->UniqueID; + $this->Profile= $options->Profile; + $this->CompanyName= $options->CompanyName; + } + } +} \ No newline at end of file diff --git a/src/Amadeus/Client/Struct/Profile/ProfileDeleteProfile.php b/src/Amadeus/Client/Struct/Profile/ProfileDeleteProfile.php new file mode 100644 index 000000000..4159351fe --- /dev/null +++ b/src/Amadeus/Client/Struct/Profile/ProfileDeleteProfile.php @@ -0,0 +1,26 @@ +Version= $options->Version; + $this->UniqueID= $options->UniqueID; + $this->DeleteRequests= $options->DeleteRequests; + } + } +} \ No newline at end of file diff --git a/src/Amadeus/Client/Struct/Profile/ProfileReadProfile.php b/src/Amadeus/Client/Struct/Profile/ProfileReadProfile.php new file mode 100644 index 000000000..933015673 --- /dev/null +++ b/src/Amadeus/Client/Struct/Profile/ProfileReadProfile.php @@ -0,0 +1,27 @@ +Version= $options->Version; + $this->UniqueID= $options->UniqueID; + $this->ReadRequests= $options->ReadRequests; + } + } +} \ No newline at end of file diff --git a/src/Amadeus/Client/Struct/Profile/ProfileUpdateProfile.php b/src/Amadeus/Client/Struct/Profile/ProfileUpdateProfile.php new file mode 100644 index 000000000..d4b6f3a03 --- /dev/null +++ b/src/Amadeus/Client/Struct/Profile/ProfileUpdateProfile.php @@ -0,0 +1,29 @@ + $propValue) { + if (property_exists($this, $propName)) { + $this->$propName = $propValue; + } + } + } + } +} \ No newline at end of file diff --git a/src/Amadeus/Client/Struct/Service/BookPriceProduct.php b/src/Amadeus/Client/Struct/Service/BookPriceProduct.php new file mode 100644 index 000000000..80b579828 --- /dev/null +++ b/src/Amadeus/Client/Struct/Service/BookPriceProduct.php @@ -0,0 +1,29 @@ +Version = $options->Version; + $this->Recommendation = $options->Recommendation; + //$this->ServiceMiscellaneous = $options->ServiceMiscellaneous; + //$this->Products = $options->Products; + } + } +} \ No newline at end of file diff --git a/src/Amadeus/Client/Struct/Service/IntegratedPricing.php b/src/Amadeus/Client/Struct/Service/IntegratedPricing.php old mode 100644 new mode 100755 index 532b19891..d2c368222 --- a/src/Amadeus/Client/Struct/Service/IntegratedPricing.php +++ b/src/Amadeus/Client/Struct/Service/IntegratedPricing.php @@ -27,6 +27,7 @@ use Amadeus\Client\RequestOptions\Service\FrequentFlyer; use Amadeus\Client\RequestOptions\ServiceIntegratedCatalogueOptions; use Amadeus\Client\RequestOptions\ServiceIntegratedPricingOptions; +use Amadeus\Client\RequestOptions\ServiceStandaloneCatalogueOptions; use Amadeus\Client\Struct\Fare\BasePricingMessage; use Amadeus\Client\Struct\Fare\PricePnr13\CarrierInformation; use Amadeus\Client\Struct\Fare\PricePnr13\Currency; @@ -36,6 +37,7 @@ use Amadeus\Client\Struct\Fare\PricePnr13\LocationInformation; use Amadeus\Client\Struct\Fare\PricePnr13\OptionDetail; use Amadeus\Client\Struct\Fare\PricePnr13\PaxSegTstReference; +use Amadeus\Client\Struct\Fare\PricePnr13\PricingOptionGroup; use Amadeus\Client\Struct\Service\IntegratedPricing\PricingOptionKey; use Amadeus\Client\Struct\Service\IntegratedPricing\PricingOption; @@ -47,11 +49,13 @@ */ class IntegratedPricing extends BasePricingMessage { + /** + * * @var PricingOption[] */ public $pricingOption = []; - + /** * IntegratedPricing constructor. * @@ -68,10 +72,15 @@ public function __construct($options = null) * @param ServiceIntegratedPricingOptions|ServiceIntegratedCatalogueOptions $options * @return PricingOption[] */ - protected function loadPricingOptions($options) + public static function loadPricingOptions($options) { $priceOptions = []; - + + $priceOptions = self::mergeOptions( + $priceOptions, + self::makePricingOptionFareBasisOverride($options->pricingsFareBasis) + ); + $priceOptions = self::mergeOptions( $priceOptions, self::makePricingOptionForValidatingCarrier($options->validatingCarrier) @@ -116,45 +125,76 @@ protected function loadPricingOptions($options) $priceOptions = self::mergeOptions( $priceOptions, - self::makePricingOptionWithOptionDetailAndRefs( - PricingOptionKey::OVERRIDE_TICKET_DESIGNATOR, - $options->ticketDesignator, - [] - ) + self::makePricingOptionWithOptionDetailAndRefs(PricingOptionKey::OVERRIDE_TICKET_DESIGNATOR, $options->ticketDesignator, [])); + + $priceOptions = self::mergeOptions($priceOptions, self::loadPointOverrides($options->pointOfSaleOverride)); + + $priceOptions = self::mergeOptions($priceOptions, self::loadFormOfPaymentOverride($options->formOfPayment)); + + $priceOptions = self::mergeOptions($priceOptions, self::loadFrequentFlyerOverride($options->frequentFlyers)); + + $priceOptions = self::mergeOptions($priceOptions, self::loadReferences($options->references)); + + $priceOptions = self::mergeOptions($priceOptions, self::makeOverrideOptions($options->overrideOptions, $priceOptions) ); $priceOptions = self::mergeOptions( $priceOptions, - self::loadPointOverrides($options->pointOfSaleOverride) + self::makeOverrideOptionsWithCriteria($options->overrideOptionsWithCriteria, $priceOptions) ); + // All options processed, no options found: + if (empty($priceOptions)) { + $priceOptions[] = new PricingOption(PricingOptionKey::OVERRIDE_NO_OPTION); + } - $priceOptions = self::mergeOptions( - $priceOptions, - self::loadFormOfPaymentOverride($options->formOfPayment) - ); + return $priceOptions; + } - $priceOptions = self::mergeOptions( - $priceOptions, - self::loadFrequentFlyerOverride($options->frequentFlyers) - ); + /** + * @param string[] $overrideOptionsWithCriteria + * @param PricingOptionGroup[] $priceOptions + * @return PricingOptionGroup[] + */ + protected static function makeOverrideOptionsWithCriteria($overrideOptionsWithCriteria, $priceOptions) + { - $priceOptions = self::mergeOptions( - $priceOptions, - self::loadReferences($options->references) - ); + $opt = []; + foreach ($overrideOptionsWithCriteria as $overrideOptionWithCriteria) { - $priceOptions = self::mergeOptions( - $priceOptions, - self::makeOverrideOptions($options->overrideOptions, $priceOptions) - ); + if (!self::hasPricingGroup($overrideOptionWithCriteria["key"], $priceOptions)) { + $opt[] = new PricingOptionGroup($overrideOptionWithCriteria["key"], $overrideOptionWithCriteria["optionDetail"], + isset($overrideOptionWithCriteria["attributeDescription"]) ? $overrideOptionWithCriteria["attributeDescription"] : null, + isset($overrideOptionWithCriteria["references"]) ? $overrideOptionWithCriteria["references"] : null); - // All options processed, no options found: - if (empty($priceOptions)) { - $priceOptions[] = new PricingOption(PricingOptionKey::OVERRIDE_NO_OPTION); + } } - return $priceOptions; + return $opt; + } + + /** + * + * @param FareBasis[] $pricingsFareBasis + * @return PricingOptionGroup[] + */ + protected static function makePricingOptionFareBasisOverride($pricingsFareBasis) + { + $opt = []; + if ($pricingsFareBasis !== null) { + foreach ($pricingsFareBasis as $pricingFareBasis) { + $po = new PricingOptionGroup($pricingFareBasis->overrideType); + + $po->optionDetail = new OptionDetail($pricingFareBasis->fareBasisCode); + + $po->paxSegTstReference = new PaxSegTstReference($pricingFareBasis->references); + + $opt[] = $po; + } + } + + return $opt; } + /** * @param string|null $validatingCarrier @@ -200,7 +240,7 @@ protected static function makePricingOptionForCurrencyOverride($currency) * @param PaxSegRef[] $references * @return PricingOption[] */ - protected function makePricingOptionWithOptionDetailAndRefs($overrideCode, $options, $references) + protected static function makePricingOptionWithOptionDetailAndRefs($overrideCode, $options, $references) { $opt = []; diff --git a/src/Amadeus/Client/Struct/Service/IntegratedPricing/PricingOptionKey.php b/src/Amadeus/Client/Struct/Service/IntegratedPricing/PricingOptionKey.php old mode 100644 new mode 100755 diff --git a/src/Amadeus/Client/Struct/Service/StandaloneCatalogue.php b/src/Amadeus/Client/Struct/Service/StandaloneCatalogue.php new file mode 100755 index 000000000..795f17ae6 --- /dev/null +++ b/src/Amadeus/Client/Struct/Service/StandaloneCatalogue.php @@ -0,0 +1,110 @@ +loadPassengers($options->passengers); + + $this->loadflightDetails($options->segments); + + $this->loadPricingOptions($options->pricingOptions); + } + } + + /** + * + * @param Passenger[] $passengers + */ + protected function loadPassengers($passengers) + { + $counter = 1; + foreach ($passengers as $passenger) { + $this->passengerInfoGroup[] = new PassengerInfoGroup($passenger, $counter); + $counter ++; + } + } + + /** + * + * @param Segment[] $segments + */ + protected function loadflightDetails($segments) + { + foreach ($segments as $segment) { + $this->flightInfo[] = new flightInfo($segment); + } + } + + /** + * + * @param PricingOptions|null $pricingOptions + */ + protected function loadPricingOptions($pricingOptions) + { + if (! ($pricingOptions instanceof ServiceIntegratedPricingOptions)) { + $pricingOptions = new ServiceIntegratedPricingOptions(); + } + $this->pricingOption = IntegratedPricing::loadPricingOptions($pricingOptions); + } +} diff --git a/src/Amadeus/Client/Struct/Service/StandaloneCatalogue/FareInfo.php b/src/Amadeus/Client/Struct/Service/StandaloneCatalogue/FareInfo.php new file mode 100755 index 000000000..bf9366042 --- /dev/null +++ b/src/Amadeus/Client/Struct/Service/StandaloneCatalogue/FareInfo.php @@ -0,0 +1,43 @@ + + */ +class FareInfo +{ + + /** + * + * @var string + */ + public $valueQualifier; + + public function __construct($paxType) + { + $this->valueQualifier = $paxType; + } +} diff --git a/src/Amadeus/Client/Struct/Service/StandaloneCatalogue/FlightInfo.php b/src/Amadeus/Client/Struct/Service/StandaloneCatalogue/FlightInfo.php new file mode 100755 index 000000000..075cffd20 --- /dev/null +++ b/src/Amadeus/Client/Struct/Service/StandaloneCatalogue/FlightInfo.php @@ -0,0 +1,86 @@ + + */ +class FlightInfo extends SegmentGroup +{ + /** + * @var flightDetails + */ + public $flightDetails; + + /** + * FlightInfo constructor. + * + * @param FlightInfo $options + */ + public function __construct($options) + { + $this->flightDetails = new SegmentInformation( + $options->segmentTattoo, + $options->departureDate, + $options->from, + $options->to, + $options->marketingCompany, + $options->flightNumber, + $options->bookingClass + ); + + $this->loadOptionalSegmentInformation($options); + + SegmentGroup::loadInventory($options->inventory); + } + + /** + * Load non-required options if available + * + * @param FlightInfo $options + */ + protected function loadOptionalSegmentInformation($options) + { + if (!empty($options->operatingCompany)) { + $this->flightDetails->companyDetails->operatingCompany = $options->operatingCompany; + } + + if ($options->arrivalDate instanceof \DateTime) { + $this->flightDetails->flightDate->setArrivalDate($options->arrivalDate); + } + + if (!empty($options->groupNumber)) { + $this->flightDetails->flightTypeDetails = new FlightTypeDetails($options->groupNumber); + } + + SegmentGroup::loadAdditionalSegmentDetails($options->airplaneCode, $options->nrOfStops); + } +} diff --git a/src/Amadeus/Client/Struct/Service/StandaloneCatalogue/PassengerInfoGroup.php b/src/Amadeus/Client/Struct/Service/StandaloneCatalogue/PassengerInfoGroup.php new file mode 100755 index 000000000..ac5289e9c --- /dev/null +++ b/src/Amadeus/Client/Struct/Service/StandaloneCatalogue/PassengerInfoGroup.php @@ -0,0 +1,62 @@ + + */ +class PassengerInfoGroup +{ + + /** + * + * @var specificTravellerDetails + */ + public $specificTravellerDetails; + + /** + * + * @var fareInfo + */ + public $fareInfo; + + /** + * PassengersGroup constructor. + * + * @param Passenger $passenger + * @param int $referenceNumber + */ + public function __construct($passenger, $referenceNumber) + { + $this->specificTravellerDetails = new SpecificTravellerDetails($referenceNumber); + + if (! empty($passenger->type)) { + $this->fareInfo = new FareInfo($passenger->type); + } + } +} diff --git a/src/Amadeus/Client/Struct/Service/StandaloneCatalogue/SpecificTravellerDetails.php b/src/Amadeus/Client/Struct/Service/StandaloneCatalogue/SpecificTravellerDetails.php new file mode 100755 index 000000000..0cc0cc4b8 --- /dev/null +++ b/src/Amadeus/Client/Struct/Service/StandaloneCatalogue/SpecificTravellerDetails.php @@ -0,0 +1,49 @@ + + */ +class SpecificTravellerDetails +{ + + /** + * + * @var specificTravellerDetails[] + */ + public $travellerDetails; + + /** + * segmentControlDetails constructor. + * + * @param int $referenceNumber + */ + public function __construct($referenceNumber) + { + $this->travellerDetails = new TravellerDetails($referenceNumber); + } +} diff --git a/src/Amadeus/Client/Struct/Service/StandaloneCatalogue/TravellerDetails.php b/src/Amadeus/Client/Struct/Service/StandaloneCatalogue/TravellerDetails.php new file mode 100755 index 000000000..0a65bf107 --- /dev/null +++ b/src/Amadeus/Client/Struct/Service/StandaloneCatalogue/TravellerDetails.php @@ -0,0 +1,48 @@ + + */ +class TravellerDetails +{ + + /** + * + * @var int + */ + public $referenceNumber; + + /** + * TravellerDetails constructor. + * + * @param int $referenceNumber + */ + public function __construct($referenceNumber) + { + $this->referenceNumber = $referenceNumber; + } +} diff --git a/src/Amadeus/Client/Struct/Ticket/ProcessEDoc.php b/src/Amadeus/Client/Struct/Ticket/ProcessEDoc.php index b61e1755c..fddc85dca 100644 --- a/src/Amadeus/Client/Struct/Ticket/ProcessEDoc.php +++ b/src/Amadeus/Client/Struct/Ticket/ProcessEDoc.php @@ -97,7 +97,8 @@ public function __construct(TicketProcessEDocOptions $options) protected function loadOptions($ticketNumber) { if (!empty($ticketNumber)) { - $this->infoGroup[] = new InfoGroup($ticketNumber); + for ($i = 0; $i < count($ticketNumber); $i++) + $this->infoGroup[] = new InfoGroup($ticketNumber[$i]); } } diff --git a/src/Amadeus/Client/Util/MsgBodyExtractor.php b/src/Amadeus/Client/Util/MsgBodyExtractor.php index 59ec1c484..5a5b7c3ff 100644 --- a/src/Amadeus/Client/Util/MsgBodyExtractor.php +++ b/src/Amadeus/Client/Util/MsgBodyExtractor.php @@ -65,6 +65,9 @@ public static function extract($soapResponse) } } + if(empty($messageBody)){ + $messageBody = $soapResponse; + } return $messageBody; } } diff --git a/tests/Amadeus/Client/ResponseHandler/BaseTest.php b/tests/Amadeus/Client/ResponseHandler/BaseTest.php index fa3f1e233..730287e0d 100644 --- a/tests/Amadeus/Client/ResponseHandler/BaseTest.php +++ b/tests/Amadeus/Client/ResponseHandler/BaseTest.php @@ -772,6 +772,26 @@ public function testCanHandleOfferCreateOfferOk() $this->assertEquals(0, count($result->messages)); } + public function testCanHandleHotelMultiSingleAvailabilityErr() + { + $respHandler = new ResponseHandler\Base(); + + $sendResult = new SendResult(); + $sendResult->responseXml = $this->getTestFile('dummyHotelMultiSingleAvailabilityErrorResponse.txt'); + $sendResult->messageVersion = '10.0'; + + $this->markTestIncomplete('Still need a proper example of an error response'); + + $result = $respHandler->analyzeResponse($sendResult, 'Hotel_MultiSingleAvailability'); + + $this->assertEquals(Result::STATUS_ERROR, $result->status); + $this->assertEquals(1, count($result->messages)); + $this->assertNull($result->messages[0]->text); + $this->assertEquals('', $result->messages[0]->level); + $this->assertEquals('367', $result->messages[0]->code); + $this->assertEquals('1A', $result->messages[0]->source); + } + public function testCanHandleSoapFault() { $respHandler = new ResponseHandler\Base(); diff --git a/tests/Amadeus/Client/ResponseHandler/testfiles/dummyHotelMultiSingleAvailabilityErrorResponse.txt b/tests/Amadeus/Client/ResponseHandler/testfiles/dummyHotelMultiSingleAvailabilityErrorResponse.txt new file mode 100644 index 000000000..9a5ac7eb3 --- /dev/null +++ b/tests/Amadeus/Client/ResponseHandler/testfiles/dummyHotelMultiSingleAvailabilityErrorResponse.txt @@ -0,0 +1,5 @@ + + + + + diff --git a/tests/Amadeus/Client/ResponseHandler/testfiles/dummyHotelMultiSingleAvailabilityWarningResponse.txt b/tests/Amadeus/Client/ResponseHandler/testfiles/dummyHotelMultiSingleAvailabilityWarningResponse.txt new file mode 100644 index 000000000..cffd7d256 --- /dev/null +++ b/tests/Amadeus/Client/ResponseHandler/testfiles/dummyHotelMultiSingleAvailabilityWarningResponse.txt @@ -0,0 +1,6 @@ + + + + + + diff --git a/tests/Amadeus/Client/ResponseHandler/testfiles/dummyHotelSellReplyErrorResponse.txt b/tests/Amadeus/Client/ResponseHandler/testfiles/dummyHotelSellReplyErrorResponse.txt new file mode 100644 index 000000000..f6cfe2457 --- /dev/null +++ b/tests/Amadeus/Client/ResponseHandler/testfiles/dummyHotelSellReplyErrorResponse.txt @@ -0,0 +1,31 @@ + + + + 1 + HK + + + + + + + + 00704 + EC + PR + + + + + 3 + HERR + EN + S + 1 + + INVALID DATE RANGE + + + + + diff --git a/tests/Amadeus/Client/Session/MsgClassmap/LoaderTest.php b/tests/Amadeus/Client/Session/MsgClassmap/LoaderTest.php new file mode 100644 index 000000000..e8820b17f --- /dev/null +++ b/tests/Amadeus/Client/Session/MsgClassmap/LoaderTest.php @@ -0,0 +1,50 @@ + + */ +class LoaderTest extends BaseTestCase +{ + public function testCanLoadHotelMultiSingleClassmap() + { + $msgAndVer = [ + 'PNR_Retrieve' => '14.2', + 'Hotel_MultiSingleAvailability' => '10.0' + ]; + + $classmap = Loader::loadMessagesSpecificClasses($msgAndVer); + + $expected = LoaderMultiSingleAvailability::loadClassMapForMessage('10.0'); + + $this->assertEquals($expected, $classmap); + } +} diff --git a/tests/Amadeus/Client/Struct/Fare/InformativePriceUpsellWithoutPNR16Test.php b/tests/Amadeus/Client/Struct/Fare/InformativePriceUpsellWithoutPNR16Test.php new file mode 100644 index 000000000..2d3f98109 --- /dev/null +++ b/tests/Amadeus/Client/Struct/Fare/InformativePriceUpsellWithoutPNR16Test.php @@ -0,0 +1,127 @@ + + */ +class InformativePriceUpsellWithoutPNR16Test extends BaseTestCase +{ + /** + * Here is a complete pricing example of a TRN-FRA trip for 2 passengers, with options below: + * + * - take into account published fares (RP) + * - take into account Unifares (RU) + * - use passenger 1 ADT and passenger 2 CH + * - convert fare into EUR (FCO) + */ + public function test51OperationFullExample() + { + $opt = new FarePriceUpsellWithoutPNROptions([ + 'passengers' => [ + new Passenger([ + 'tattoos' => [1], + 'type' => Passenger::TYPE_ADULT + ]), + new Passenger([ + 'tattoos' => [2], + 'type' => Passenger::TYPE_CHILD + ]) + ], + 'segments' => [ + new Segment([ + 'departureDate' => \DateTime::createFromFormat('Y-m-d H:i:s', '2018-08-17 14:20:00', new \DateTimeZone('UTC')), + 'arrivalDate' => \DateTime::createFromFormat('Y-m-d H:i:s', '2018-08-17 15:35:00', new \DateTimeZone('UTC')), + 'from' => 'TRN', + 'to' => 'FRA', + 'marketingCompany' => 'LH', + 'operatingCompany' => 'EN', + 'flightNumber' => '299', + 'bookingClass' => 'W', + 'segmentTattoo' => 1, + 'groupNumber' => 1 + ]), + ], + 'pricingOptions' => new PricingOptions([ + 'overrideOptions' => [ + PricingOptions::OVERRIDE_RETURN_LOWEST_AVAILABLE, + PricingOptions::OVERRIDE_FARETYPE_PUB, + PricingOptions::OVERRIDE_FARETYPE_UNI + ], + 'currencyOverride' => 'EUR' + ]) + ]); + + $msg = new InformativePriceUpsellWithoutPNR16($opt); + + + $this->assertCount(2, $msg->passengersGroup); + $this->assertEquals('ADT', $msg->passengersGroup[0]->discountPtc->valueQualifier); + $this->assertCount(1, $msg->passengersGroup[0]->travellersID->travellerDetails); + $this->assertEquals(1, $msg->passengersGroup[0]->travellersID->travellerDetails[0]->measurementValue); + $this->assertCount(1, $msg->passengersGroup[0]->segmentRepetitionControl->segmentControlDetails); + $this->assertEquals(1, $msg->passengersGroup[0]->segmentRepetitionControl->segmentControlDetails[0]->numberOfUnits); + $this->assertEquals(1, $msg->passengersGroup[0]->segmentRepetitionControl->segmentControlDetails[0]->quantity); + + $this->assertEquals('CH', $msg->passengersGroup[1]->discountPtc->valueQualifier); + $this->assertCount(1, $msg->passengersGroup[1]->travellersID->travellerDetails); + $this->assertEquals(2, $msg->passengersGroup[1]->travellersID->travellerDetails[0]->measurementValue); + $this->assertCount(1, $msg->passengersGroup[1]->segmentRepetitionControl->segmentControlDetails); + $this->assertEquals(1, $msg->passengersGroup[1]->segmentRepetitionControl->segmentControlDetails[0]->numberOfUnits); + $this->assertEquals(2, $msg->passengersGroup[1]->segmentRepetitionControl->segmentControlDetails[0]->quantity); + + $this->assertCount(1, $msg->segmentGroup); + + $this->assertEquals('170818', $msg->segmentGroup[0]->segmentInformation->flightDate->departureDate); + $this->assertEquals('1420', $msg->segmentGroup[0]->segmentInformation->flightDate->departureTime); + $this->assertEquals('170818', $msg->segmentGroup[0]->segmentInformation->flightDate->arrivalDate); + $this->assertEquals('1535', $msg->segmentGroup[0]->segmentInformation->flightDate->arrivalTime); + $this->assertEquals('TRN', $msg->segmentGroup[0]->segmentInformation->boardPointDetails->trueLocationId); + $this->assertEquals('FRA', $msg->segmentGroup[0]->segmentInformation->offpointDetails->trueLocationId); + $this->assertEquals('LH', $msg->segmentGroup[0]->segmentInformation->companyDetails->marketingCompany); + $this->assertEquals('EN', $msg->segmentGroup[0]->segmentInformation->companyDetails->operatingCompany); + $this->assertEquals('299', $msg->segmentGroup[0]->segmentInformation->flightIdentification->flightNumber); + $this->assertEquals('W', $msg->segmentGroup[0]->segmentInformation->flightIdentification->bookingClass); + $this->assertEquals(1, $msg->segmentGroup[0]->segmentInformation->itemNumber); + $this->assertEquals(1, $msg->segmentGroup[0]->segmentInformation->flightTypeDetails->flightIndicator[0]); + $this->assertNull($msg->segmentGroup[0]->additionnalSegmentDetails); + $this->assertNull($msg->segmentGroup[0]->inventory); + + $this->assertCount(4, $msg->pricingOptionGroup); + $this->assertEquals(PricingOptionKey::OPTION_FARE_CURRENCY_OVERRIDE, $msg->pricingOptionGroup[0]->pricingOptionKey->pricingOptionKey); + $this->assertEquals('EUR', $msg->pricingOptionGroup[0]->currency->firstCurrencyDetails->currencyIsoCode); + } +} + diff --git a/tests/Amadeus/Client/Struct/Hotel/HotelMultiSingleAvailabilityTest.php b/tests/Amadeus/Client/Struct/Hotel/HotelMultiSingleAvailabilityTest.php new file mode 100644 index 000000000..703b3896f --- /dev/null +++ b/tests/Amadeus/Client/Struct/Hotel/HotelMultiSingleAvailabilityTest.php @@ -0,0 +1,102 @@ + + */ +class HotelMultiSingleAvailabilityTest extends BaseTestCase +{ + public function testCanMakeMessage() + { + $opt = new HotelMultiSingleAvailOptions([ + 'segments' => [ + new Segment([ + 'infoSource' => Segment::SOURCE_DISTRIBUTION, + 'criteria' => [ + new Criteria([ + 'exactMatch' => true, + 'stayStart' => \DateTime::createFromFormat('Y-m-d', '2017-12-28'), + 'stayEnd' => \DateTime::createFromFormat('Y-m-d', '2017-12-29'), + 'hotelReferences' => [ + new HotelReference([ + 'chainCode' => 'RT', + 'cityCode' => 'VIE', + 'name' => 'SOFITEL VIENNA' + ]) + ], + 'rates' => [ + new Rates([ + 'min' => 100.0, + 'max' => 400.0, + 'timeUnit' => Rates::TIMEUNIT_DAY + ]) + ], + 'rooms' => [ + new Room([ + 'id' => 1, + 'amount' => 1, + 'guests' => [ + new Guest([ + 'occupantCode' => Guest::OCCUPANT_ADULT, + 'amount' => 1 + ]) + ] + ]) + ] + ]) + ] + ]) + ] + ]); + + $msg = new MultiSingleAvailability($opt); + + $this->assertEquals('MultiSingle', $msg->EchoToken); + $this->assertEquals('4.000', $msg->Version); + $this->assertTrue($msg->SummaryOnly); + $this->assertTrue($msg->RateRangeOnly); + $this->assertTrue($msg->RateDetailsInd); + + $this->assertCount(1, $msg->AvailRequestSegments->AvailRequestSegment); + $this->assertEquals('Distribution', $msg->AvailRequestSegments->AvailRequestSegment[0]->InfoSource); + + $this->assertCount(1, $msg->AvailRequestSegments->AvailRequestSegment[0]->HotelSearchCriteria->Criterion); + $this->assertTrue($msg->AvailRequestSegments->AvailRequestSegment[0]->HotelSearchCriteria->Criterion[0]->ExactMatch); + $this->assertCount(1, $msg->AvailRequestSegments->AvailRequestSegment[0]->HotelSearchCriteria->Criterion[0]->HotelRef); + $this->assertEquals('RT', $msg->AvailRequestSegments->AvailRequestSegment[0]->HotelSearchCriteria->Criterion[0]->HotelRef[0]->ChainCode); + } +} diff --git a/tests/Amadeus/ClientTest.php b/tests/Amadeus/ClientTest.php index eb172a94c..9aa378700 100644 --- a/tests/Amadeus/ClientTest.php +++ b/tests/Amadeus/ClientTest.php @@ -3874,7 +3874,57 @@ public function testCanFarePricePnrWithLowestFare14() $this->assertEquals($messageResult, $response); } +<<<<<<< HEAD public function testCanFarePricePnrWithLowestFareVersion12() +======= + public function testCanSendHotelMultiSingleAvailability() + { + $mockSessionHandler = $this->getMockBuilder('Amadeus\Client\Session\Handler\HandlerInterface')->getMock(); + + $mockedSendResult = new Client\Session\Handler\SendResult(); + $mockedSendResult->responseXml = $this->getTestFile('hotelMultiSingleAvailabilityReply100.txt'); + + $messageResult = new Client\Result($mockedSendResult); + + $expectedMessageResult = new Client\Struct\Hotel\MultiSingleAvailability( + new Client\RequestOptions\HotelMultiSingleAvailOptions([ + + ]) + ); + + $mockSessionHandler + ->expects($this->once()) + ->method('sendMessage') + ->with('Hotel_MultiSingleAvailability', $expectedMessageResult, ['endSession' => false, 'returnXml' => true]) + ->will($this->returnValue($mockedSendResult));; + $mockSessionHandler + ->expects($this->never()) + ->method('getLastResponse'); + $mockSessionHandler + ->expects($this->once()) + ->method('getMessagesAndVersions') + ->will($this->returnValue(['Hotel_MultiSingleAvailability' => "10.0"])); + + $par = new Params(); + $par->sessionHandler = $mockSessionHandler; + $par->requestCreatorParams = new Params\RequestCreatorParams([ + 'receivedFrom' => 'some RF string', + 'originatorOfficeId' => 'BRUXXXXXX' + ]); + + $client = new Client($par); + + + $response = $client->hotelMultiSingleAvailability( + new Client\RequestOptions\HotelMultiSingleAvailOptions([ + ]) + ); + + $this->assertEquals($messageResult, $response); + } + + public function testCanDoSignOutCall() +>>>>>>> hotel { $mockSessionHandler = $this->getMockBuilder('Amadeus\Client\Session\Handler\HandlerInterface')->getMock(); diff --git a/tests/Amadeus/testfiles/hotelMultiSingleAvailabilityReply100.txt b/tests/Amadeus/testfiles/hotelMultiSingleAvailabilityReply100.txt new file mode 100644 index 000000000..f3ac64312 --- /dev/null +++ b/tests/Amadeus/testfiles/hotelMultiSingleAvailabilityReply100.txt @@ -0,0 +1,214 @@ + + + + + + + + + +
+ PRATERSTRASSE 1 + VIENNA + 1020 + +
+ + + + + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Advance Purchase Rate + SUPERIOR ROOM, queen-size bed, view of the Ferr + is wheel + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Smart Rate + SUPERIOR ROOM, queen-size bed, view of the Ferr + is wheel + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Advance Purchase Rate + LUXURY ROOM, one king-size bed, overlooking St. + Stephen's Cathedral + + + + + + + + + + + + + + + + + + + +