From 227bfc4c607715f3ce6cd31cab9301e1e31f3390 Mon Sep 17 00:00:00 2001 From: "arvind.p" Date: Sat, 4 Aug 2018 18:56:53 +0530 Subject: [PATCH 01/67] new message serviceStandaloneCatalogue --- src/Amadeus/Client.php | 20 +++ .../Service/StandaloneCatalogueConv.php | 45 +++++++ .../Service/StandaloneCatalogue/Passenger.php | 61 +++++++++ .../StandaloneCatalogue/Passenger.php~ | 61 +++++++++ .../StandaloneCatalogue/PricingOptions.php | 41 ++++++ .../StandaloneCatalogue/PricingOptions.php~ | 41 ++++++ .../Service/StandaloneCatalogue/Segment.php | 106 +++++++++++++++ .../Service/StandaloneCatalogue/Segment.php~ | 106 +++++++++++++++ .../ServiceStandaloneCatalogueOptions.php | 40 ++++++ .../Struct/Service/IntegratedPricing.php | 39 +++++- .../IntegratedPricing/PricingOptionKey.php | 1 + .../Service/StandaloneCatalogue/FareInfo.php | 43 ++++++ .../StandaloneCatalogue/FlightInfo.php | 124 ++++++++++++++++++ .../PassengerInfoGroup.php | 60 +++++++++ .../SegmentInformation.php | 66 ++++++++++ .../SpecificTravellerDetails.php | 49 +++++++ .../StandaloneCatalogue/TravellerDetails.php | 47 +++++++ 17 files changed, 949 insertions(+), 1 deletion(-) create mode 100755 src/Amadeus/Client/RequestCreator/Converter/Service/StandaloneCatalogueConv.php create mode 100755 src/Amadeus/Client/RequestOptions/Service/StandaloneCatalogue/Passenger.php create mode 100755 src/Amadeus/Client/RequestOptions/Service/StandaloneCatalogue/Passenger.php~ create mode 100755 src/Amadeus/Client/RequestOptions/Service/StandaloneCatalogue/PricingOptions.php create mode 100755 src/Amadeus/Client/RequestOptions/Service/StandaloneCatalogue/PricingOptions.php~ create mode 100755 src/Amadeus/Client/RequestOptions/Service/StandaloneCatalogue/Segment.php create mode 100755 src/Amadeus/Client/RequestOptions/Service/StandaloneCatalogue/Segment.php~ create mode 100755 src/Amadeus/Client/RequestOptions/ServiceStandaloneCatalogueOptions.php create mode 100755 src/Amadeus/Client/Struct/Service/StandaloneCatalogue/FareInfo.php create mode 100755 src/Amadeus/Client/Struct/Service/StandaloneCatalogue/FlightInfo.php create mode 100755 src/Amadeus/Client/Struct/Service/StandaloneCatalogue/PassengerInfoGroup.php create mode 100755 src/Amadeus/Client/Struct/Service/StandaloneCatalogue/SegmentInformation.php create mode 100755 src/Amadeus/Client/Struct/Service/StandaloneCatalogue/SpecificTravellerDetails.php create mode 100755 src/Amadeus/Client/Struct/Service/StandaloneCatalogue/TravellerDetails.php diff --git a/src/Amadeus/Client.php b/src/Amadeus/Client.php index df7d758cd..02cbd3c00 100644 --- a/src/Amadeus/Client.php +++ b/src/Amadeus/Client.php @@ -1564,6 +1564,26 @@ public function serviceIntegratedCatalogue( 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 * diff --git a/src/Amadeus/Client/RequestCreator/Converter/Service/StandaloneCatalogueConv.php b/src/Amadeus/Client/RequestCreator/Converter/Service/StandaloneCatalogueConv.php new file mode 100755 index 000000000..6ff340efa --- /dev/null +++ b/src/Amadeus/Client/RequestCreator/Converter/Service/StandaloneCatalogueConv.php @@ -0,0 +1,45 @@ + + */ +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/Service/StandaloneCatalogue/Passenger.php b/src/Amadeus/Client/RequestOptions/Service/StandaloneCatalogue/Passenger.php new file mode 100755 index 000000000..e3027d540 --- /dev/null +++ b/src/Amadeus/Client/RequestOptions/Service/StandaloneCatalogue/Passenger.php @@ -0,0 +1,61 @@ + + */ +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; + + /** + * List of _unique_ identifiers for these passengers. + * + * If you have 3 passengers of this type, you need to provide 3 unique tattoos. + * + * For infants in a seat with an adult, you must provide the ID of the adult as their tattoo. + * + * @var int[] + */ + public $tattoos = []; +} 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..e3027d540 --- /dev/null +++ b/src/Amadeus/Client/RequestOptions/Service/StandaloneCatalogue/Passenger.php~ @@ -0,0 +1,61 @@ + + */ +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; + + /** + * List of _unique_ identifiers for these passengers. + * + * If you have 3 passengers of this type, you need to provide 3 unique tattoos. + * + * For infants in a seat with an adult, you must provide the ID of the adult as their tattoo. + * + * @var int[] + */ + public $tattoos = []; +} diff --git a/src/Amadeus/Client/RequestOptions/Service/StandaloneCatalogue/PricingOptions.php b/src/Amadeus/Client/RequestOptions/Service/StandaloneCatalogue/PricingOptions.php new file mode 100755 index 000000000..4d24cff1f --- /dev/null +++ b/src/Amadeus/Client/RequestOptions/Service/StandaloneCatalogue/PricingOptions.php @@ -0,0 +1,41 @@ + + */ +class PricingOptions extends ServiceIntegratedPricingOptions +{ + + /** + * Provide a fare basis to price with + * + * @var FareBasis[] + */ + public $pricingsFareBasis = []; +} diff --git a/src/Amadeus/Client/RequestOptions/Service/StandaloneCatalogue/PricingOptions.php~ b/src/Amadeus/Client/RequestOptions/Service/StandaloneCatalogue/PricingOptions.php~ new file mode 100755 index 000000000..4d24cff1f --- /dev/null +++ b/src/Amadeus/Client/RequestOptions/Service/StandaloneCatalogue/PricingOptions.php~ @@ -0,0 +1,41 @@ + + */ +class PricingOptions extends ServiceIntegratedPricingOptions +{ + + /** + * Provide a fare basis to price with + * + * @var FareBasis[] + */ + public $pricingsFareBasis = []; +} diff --git a/src/Amadeus/Client/RequestOptions/Service/StandaloneCatalogue/Segment.php b/src/Amadeus/Client/RequestOptions/Service/StandaloneCatalogue/Segment.php new file mode 100755 index 000000000..6e4251fc9 --- /dev/null +++ b/src/Amadeus/Client/RequestOptions/Service/StandaloneCatalogue/Segment.php @@ -0,0 +1,106 @@ + + */ +class Segment extends LoadParamsFromArray +{ + /** + * Departure date & time + * + * @var \DateTime + */ + public $departureDate; + + /** + * Arrival date & time + * + * @var \DateTime + */ + public $arrivalDate; + + /** + * Departure IATA code + * + * @var string + */ + public $from; + + /** + * Destination IATA code + * + * @var string + */ + public $to; + + /** + * Marketing airline code + * + * @var string + */ + public $marketingCompany; + + /** + * Operating airline code + * + * @var string + */ + public $operatingCompany; + + /** + * Flight number + * + * @var string + */ + public $flightNumber; + + /** + * Booking Class code + * + * @var string + */ + public $bookingClass; + + /** + * The number of stops + * + * @var int + */ + public $flightIndicator; + + /** + * Unique segment tattoo ID. + * + * @var int + */ + public $segmentTattoo; + + +} diff --git a/src/Amadeus/Client/RequestOptions/Service/StandaloneCatalogue/Segment.php~ b/src/Amadeus/Client/RequestOptions/Service/StandaloneCatalogue/Segment.php~ new file mode 100755 index 000000000..6e4251fc9 --- /dev/null +++ b/src/Amadeus/Client/RequestOptions/Service/StandaloneCatalogue/Segment.php~ @@ -0,0 +1,106 @@ + + */ +class Segment extends LoadParamsFromArray +{ + /** + * Departure date & time + * + * @var \DateTime + */ + public $departureDate; + + /** + * Arrival date & time + * + * @var \DateTime + */ + public $arrivalDate; + + /** + * Departure IATA code + * + * @var string + */ + public $from; + + /** + * Destination IATA code + * + * @var string + */ + public $to; + + /** + * Marketing airline code + * + * @var string + */ + public $marketingCompany; + + /** + * Operating airline code + * + * @var string + */ + public $operatingCompany; + + /** + * Flight number + * + * @var string + */ + public $flightNumber; + + /** + * Booking Class code + * + * @var string + */ + public $bookingClass; + + /** + * The number of stops + * + * @var int + */ + public $flightIndicator; + + /** + * Unique segment tattoo ID. + * + * @var int + */ + public $segmentTattoo; + + +} diff --git a/src/Amadeus/Client/RequestOptions/ServiceStandaloneCatalogueOptions.php b/src/Amadeus/Client/RequestOptions/ServiceStandaloneCatalogueOptions.php new file mode 100755 index 000000000..96fb2a5cf --- /dev/null +++ b/src/Amadeus/Client/RequestOptions/ServiceStandaloneCatalogueOptions.php @@ -0,0 +1,40 @@ + + */ +class ServiceStandaloneCatalogueOptions extends Base +{ + public $passengers = []; + + public $segments = []; + + public $pricingOptions; +} + + +?> \ No newline at end of file diff --git a/src/Amadeus/Client/Struct/Service/IntegratedPricing.php b/src/Amadeus/Client/Struct/Service/IntegratedPricing.php index 532b19891..7cf04eca9 100644 --- a/src/Amadeus/Client/Struct/Service/IntegratedPricing.php +++ b/src/Amadeus/Client/Struct/Service/IntegratedPricing.php @@ -36,6 +36,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; @@ -68,10 +69,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) @@ -155,6 +161,37 @@ protected function loadPricingOptions($options) return $priceOptions; } + + /** + * @param FareBasis[] $pricingsFareBasis + * @return PricingOptionGroup[] + */ + protected static function makePricingOptionFareBasisOverride($pricingsFareBasis) + { + $opt = []; + + if ($pricingsFareBasis !== null) { + foreach ($pricingsFareBasis as $pricingFareBasis) { + $po = new PricingOptionGroup(PricingOptionKey::OPTION_FARE_BASIS_SIMPLE_OVERRIDE); + + //Support for legacy fareBasisPrimaryCode to be removed when breaking BC: + $po->optionDetail = new OptionDetail( + $pricingFareBasis->fareBasisPrimaryCode.$pricingFareBasis->fareBasisCode + ); + + //Support for legacy segmentReference to be removed when breaking BC: + $po->paxSegTstReference = new PaxSegTstReference( + $pricingFareBasis->references, + $pricingFareBasis->segmentReference + ); + + $opt[] = $po; + } + } + + return $opt; + } + /** * @param string|null $validatingCarrier diff --git a/src/Amadeus/Client/Struct/Service/IntegratedPricing/PricingOptionKey.php b/src/Amadeus/Client/Struct/Service/IntegratedPricing/PricingOptionKey.php index 2fdbb0cb0..3abb22d99 100644 --- a/src/Amadeus/Client/Struct/Service/IntegratedPricing/PricingOptionKey.php +++ b/src/Amadeus/Client/Struct/Service/IntegratedPricing/PricingOptionKey.php @@ -30,6 +30,7 @@ */ class PricingOptionKey { + const OPTION_FARE_BASIS_SIMPLE_OVERRIDE = "FBA"; const OVERRIDE_ACCOUNT_CODE = "ACC"; const OVERRIDE_PRICING_ALL_SERVICES = "ALL"; const OVERRIDE_AWARD = "AWD"; 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..bcabf8243 --- /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..da1028cf4 --- /dev/null +++ b/src/Amadeus/Client/Struct/Service/StandaloneCatalogue/FlightInfo.php @@ -0,0 +1,124 @@ + + */ +class FlightInfo +{ + /** + * @var SegmentInformation + */ + public $flightDetails; + + /** + * @var AdditionalSegmentDetails + */ + public $additionnalSegmentDetails; + + /** + * @var Inventory + */ + public $inventory; + + /** + * SegmentGroup constructor. + * + * @param Segment $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); + + $this->loadInventory($options->inventory); + } + + /** + * Load non-required options if available + * + * @param Segment $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); + } + + $this->loadAdditionalSegmentDetails($options->airplaneCode, $options->nrOfStops); + } + + /** + * @param string|null $airplaneCode + * @param int|null $nrOfStops + */ + protected function loadAdditionalSegmentDetails($airplaneCode, $nrOfStops) + { + if (!empty($airplaneCode) || !empty($nrOfStops)) { + $this->additionalFlightInfo = new AdditionalSegmentDetails($airplaneCode, $nrOfStops); + } + } + + /** + * Load inventory information + * + * @param array $inventory + */ + protected function loadInventory($inventory) + { + if (is_array($inventory) && count($inventory) > 0) { + $this->inventory = new Inventory(); + + foreach ($inventory as $bookingClass => $availabilityAmount) { + $this->inventory->bookingClassDetails[] = new BookingClassDetails( + $bookingClass, + $availabilityAmount + ); + } + } + } +} 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..57da2a17d --- /dev/null +++ b/src/Amadeus/Client/Struct/Service/StandaloneCatalogue/PassengerInfoGroup.php @@ -0,0 +1,60 @@ + + */ +class PassengerInfoGroup +{ + /** + * @var specificTravellerDetails + */ + public $specificTravellerDetails; + + + /** + * @var fareInfo + */ + public $fareInfo; + + /** + * PassengersGroup constructor. + * + * @param Passenger $passenger + * @param int $group + */ + 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/SegmentInformation.php b/src/Amadeus/Client/Struct/Service/StandaloneCatalogue/SegmentInformation.php new file mode 100755 index 000000000..74bbeafac --- /dev/null +++ b/src/Amadeus/Client/Struct/Service/StandaloneCatalogue/SegmentInformation.php @@ -0,0 +1,66 @@ + + */ +class SegmentInformation extends TravelProductInformation +{ + /** + * @var int + */ + public $itemNumber; + + /** + * SegmentInformation constructor. + * + * @param int $itemNumber + * @param \DateTime $departureDate + * @param string $from + * @param string $to + * @param string $company + * @param string $flightNumber + * @param string $bookingClass + */ + public function __construct( + $itemNumber, + \DateTime $departureDate, + $from, + $to, + $company, + $flightNumber, + $bookingClass + ) { + $this->itemNumber = $itemNumber; + + parent::__construct($departureDate, $from, $to, $company, $flightNumber, $bookingClass); + } +} 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..1c2698cf5 --- /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..e61acc1b8 --- /dev/null +++ b/src/Amadeus/Client/Struct/Service/StandaloneCatalogue/TravellerDetails.php @@ -0,0 +1,47 @@ + + */ +class TravellerDetails +{ + /** + * @var int + */ + public $referenceNumber; + + /** + * TravellerDetails constructor. + * + * @param int $referenceNumber + */ + public function __construct($referenceNumber) + { + $this->referenceNumber = $referenceNumber; + } +} From d08bfe914e0d0fbd53deaac03beeaef3a13d3203 Mon Sep 17 00:00:00 2001 From: arvind-pandey <40858867+arvind-pandey@users.noreply.github.com> Date: Sat, 4 Aug 2018 19:02:18 +0530 Subject: [PATCH 02/67] Update list-of-supported-messages.rst - Service_StandaloneCatalogue Message is added --- docs/list-of-supported-messages.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/list-of-supported-messages.rst b/docs/list-of-supported-messages.rst index 5af3b9347..37151cf88 100644 --- a/docs/list-of-supported-messages.rst +++ b/docs/list-of-supported-messages.rst @@ -65,6 +65,7 @@ This is the list of messages that are at least partially supported at this time: - DocRefund_IgnoreRefund - Service_IntegratedPricing - Service_IntegratedCatalogue +- Service_StandaloneCatalogue - Offer_CreateOffer - Offer_VerifyOffer - Offer_ConfirmAirOffer @@ -103,7 +104,6 @@ These messages will be implemented at some point in the future. *Pull requests a - Media_GetMedia - Service_PriceServiceViaCatalogue - Service_PriceIntegratedMode -- Service_StandaloneCatalogue - Service_StandalonePricing - Hotel_MultiSingleAvailability (see `issue 70 `_) - Hotel_DescriptiveInfo (see `issue 70 `_) From a06dcbef87e01f2fef5dcf9f20d4918ed97bb96c Mon Sep 17 00:00:00 2001 From: arvind-pandey <40858867+arvind-pandey@users.noreply.github.com> Date: Sat, 4 Aug 2018 19:08:26 +0530 Subject: [PATCH 03/67] Update samples.rst New Message Service_StandaloneCatalogue implementation --- docs/samples.rst | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/docs/samples.rst b/docs/samples.rst index b02d069ec..a7e7db8fe 100644 --- a/docs/samples.rst +++ b/docs/samples.rst @@ -3195,6 +3195,50 @@ All the examples for ``Service_IntegratedPricing`` (see above) should also work ] ]) ); + +--------------------------- +Service_IntegratedCatalogue +--------------------------- + +.. 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 PricingOptions([ + 'pricingsFareBasis' => [ + new FareBasis([ + 'fareBasisCode' => 'LOXOW', + ]) + ] + ]) + ]) +); *** FOP From 028098019c43efe9082c294a68ea37730f1e3edc Mon Sep 17 00:00:00 2001 From: arvind-pandey <40858867+arvind-pandey@users.noreply.github.com> Date: Sat, 4 Aug 2018 19:10:08 +0530 Subject: [PATCH 04/67] Update samples.rst ServiceStandaloneCatalogue Changes --- docs/samples.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/samples.rst b/docs/samples.rst index a7e7db8fe..0b040b393 100644 --- a/docs/samples.rst +++ b/docs/samples.rst @@ -3197,7 +3197,7 @@ All the examples for ``Service_IntegratedPricing`` (see above) should also work ); --------------------------- -Service_IntegratedCatalogue +Service_StandaloneCatalogue --------------------------- .. code-block:: php From d9c475a535327867349d9a647f0c8e502e045f8b Mon Sep 17 00:00:00 2001 From: "arvind.p" Date: Mon, 6 Aug 2018 17:37:24 +0530 Subject: [PATCH 05/67] changes --- .../Service/StandaloneCatalogue/Passenger.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/Amadeus/Client/RequestOptions/Service/StandaloneCatalogue/Passenger.php b/src/Amadeus/Client/RequestOptions/Service/StandaloneCatalogue/Passenger.php index e3027d540..cec6e55a8 100755 --- a/src/Amadeus/Client/RequestOptions/Service/StandaloneCatalogue/Passenger.php +++ b/src/Amadeus/Client/RequestOptions/Service/StandaloneCatalogue/Passenger.php @@ -49,13 +49,11 @@ class Passenger extends LoadParamsFromArray public $type; /** - * List of _unique_ identifiers for these passengers. + * Specifies the passenger index * - * If you have 3 passengers of this type, you need to provide 3 unique tattoos. + * If you have 3 passengers of this type, you need to provide 3 unique passenger index. * - * For infants in a seat with an adult, you must provide the ID of the adult as their tattoo. - * - * @var int[] + * @var int */ - public $tattoos = []; + public $reference; } From acf7fa25c95e3483860f0312308b9c6f192c4a34 Mon Sep 17 00:00:00 2001 From: "arvind.p" Date: Mon, 6 Aug 2018 17:46:50 +0530 Subject: [PATCH 06/67] change --- .../RequestCreator/Converter/Service/StandaloneCatalogueConv.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Amadeus/Client/RequestCreator/Converter/Service/StandaloneCatalogueConv.php b/src/Amadeus/Client/RequestCreator/Converter/Service/StandaloneCatalogueConv.php index 6ff340efa..b99381eb6 100755 --- a/src/Amadeus/Client/RequestCreator/Converter/Service/StandaloneCatalogueConv.php +++ b/src/Amadeus/Client/RequestCreator/Converter/Service/StandaloneCatalogueConv.php @@ -21,6 +21,7 @@ */ namespace Amadeus\Client\RequestCreator\Converter\Service; + use Amadeus\Client\RequestCreator\Converter\BaseConverter; use Amadeus\Client\RequestOptions\ServiceStandaloneCatalogueOptions; use Amadeus\Client\Struct; From 4bcb1416ad0433eb607f50602825d59d4e7bd82c Mon Sep 17 00:00:00 2001 From: "arvind.p" Date: Mon, 6 Aug 2018 17:57:58 +0530 Subject: [PATCH 07/67] change --- .../Service/StandaloneCatalogue/PricingOptions.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Amadeus/Client/RequestOptions/Service/StandaloneCatalogue/PricingOptions.php b/src/Amadeus/Client/RequestOptions/Service/StandaloneCatalogue/PricingOptions.php index 4d24cff1f..2f7cf0224 100755 --- a/src/Amadeus/Client/RequestOptions/Service/StandaloneCatalogue/PricingOptions.php +++ b/src/Amadeus/Client/RequestOptions/Service/StandaloneCatalogue/PricingOptions.php @@ -20,6 +20,7 @@ * @license https://opensource.org/licenses/Apache-2.0 Apache 2.0 */ namespace Amadeus\Client\RequestOptions\Service\StandaloneCatalogue; + use Amadeus\Client\RequestOptions\ServiceIntegratedPricingOptions; /** * Pricing Options for the Fare_InformativePricingWithoutPNR message @@ -30,8 +31,7 @@ * @author Arvind Pandey */ class PricingOptions extends ServiceIntegratedPricingOptions -{ - +{ /** * Provide a fare basis to price with * From 4616da48d35ae3c1ea0555c33067af9e3b938231 Mon Sep 17 00:00:00 2001 From: "arvind.p" Date: Mon, 6 Aug 2018 19:03:32 +0530 Subject: [PATCH 08/67] changes --- .../Service/StandaloneCatalogue/Segment.php | 106 ------------------ .../StandaloneCatalogue/FlightInfo.php | 9 +- .../PassengerInfoGroup.php | 6 +- .../SegmentInformation.php | 66 ----------- .../SpecificTravellerDetails.php | 4 +- .../StandaloneCatalogue/TravellerDetails.php | 2 +- 6 files changed, 11 insertions(+), 182 deletions(-) delete mode 100755 src/Amadeus/Client/RequestOptions/Service/StandaloneCatalogue/Segment.php delete mode 100755 src/Amadeus/Client/Struct/Service/StandaloneCatalogue/SegmentInformation.php diff --git a/src/Amadeus/Client/RequestOptions/Service/StandaloneCatalogue/Segment.php b/src/Amadeus/Client/RequestOptions/Service/StandaloneCatalogue/Segment.php deleted file mode 100755 index 6e4251fc9..000000000 --- a/src/Amadeus/Client/RequestOptions/Service/StandaloneCatalogue/Segment.php +++ /dev/null @@ -1,106 +0,0 @@ - - */ -class Segment extends LoadParamsFromArray -{ - /** - * Departure date & time - * - * @var \DateTime - */ - public $departureDate; - - /** - * Arrival date & time - * - * @var \DateTime - */ - public $arrivalDate; - - /** - * Departure IATA code - * - * @var string - */ - public $from; - - /** - * Destination IATA code - * - * @var string - */ - public $to; - - /** - * Marketing airline code - * - * @var string - */ - public $marketingCompany; - - /** - * Operating airline code - * - * @var string - */ - public $operatingCompany; - - /** - * Flight number - * - * @var string - */ - public $flightNumber; - - /** - * Booking Class code - * - * @var string - */ - public $bookingClass; - - /** - * The number of stops - * - * @var int - */ - public $flightIndicator; - - /** - * Unique segment tattoo ID. - * - * @var int - */ - public $segmentTattoo; - - -} diff --git a/src/Amadeus/Client/Struct/Service/StandaloneCatalogue/FlightInfo.php b/src/Amadeus/Client/Struct/Service/StandaloneCatalogue/FlightInfo.php index da1028cf4..1b22ab905 100755 --- a/src/Amadeus/Client/Struct/Service/StandaloneCatalogue/FlightInfo.php +++ b/src/Amadeus/Client/Struct/Service/StandaloneCatalogue/FlightInfo.php @@ -22,14 +22,15 @@ namespace Amadeus\Client\Struct\Service\StandaloneCatalogue; -use Amadeus\Client\RequestOptions\Service\StandaloneCatalogue\Segment; +use Amadeus\Client\RequestOptions\Fare\InformativePricing\Segment; +use Amadeus\Client\Struct\Fare\InformativePricing13\SegmentInformation; use Amadeus\Client\Struct\Air\FlightTypeDetails; /** - * SegmentGroup + * FlightInfo * - * @package Amadeus\Client\Struct\Fare\InformativePricing13 - * @author Dieter Devlieghere + * @package Amadeus\Client\Struct\Service\StandaloneCatalogue + * @author Arvind Pandey */ class FlightInfo { diff --git a/src/Amadeus/Client/Struct/Service/StandaloneCatalogue/PassengerInfoGroup.php b/src/Amadeus/Client/Struct/Service/StandaloneCatalogue/PassengerInfoGroup.php index 57da2a17d..1b0294ad6 100755 --- a/src/Amadeus/Client/Struct/Service/StandaloneCatalogue/PassengerInfoGroup.php +++ b/src/Amadeus/Client/Struct/Service/StandaloneCatalogue/PassengerInfoGroup.php @@ -22,13 +22,13 @@ namespace Amadeus\Client\Struct\Service\StandaloneCatalogue; -use Amadeus\Client\RequestOptions\Service\StandaloneCatalogue\Passenger; +use Amadeus\Client\Struct\Service\StandaloneCatalogue\Passenger; /** * PassengersGroup * - * @package Amadeus\Client\Struct\Fare\InformativePricing13 - * @author Dieter Devlieghere + * @package Amadeus\Client\Struct\Service\StandaloneCatalogue + * @author Arvind Pandey */ class PassengerInfoGroup { diff --git a/src/Amadeus/Client/Struct/Service/StandaloneCatalogue/SegmentInformation.php b/src/Amadeus/Client/Struct/Service/StandaloneCatalogue/SegmentInformation.php deleted file mode 100755 index 74bbeafac..000000000 --- a/src/Amadeus/Client/Struct/Service/StandaloneCatalogue/SegmentInformation.php +++ /dev/null @@ -1,66 +0,0 @@ - - */ -class SegmentInformation extends TravelProductInformation -{ - /** - * @var int - */ - public $itemNumber; - - /** - * SegmentInformation constructor. - * - * @param int $itemNumber - * @param \DateTime $departureDate - * @param string $from - * @param string $to - * @param string $company - * @param string $flightNumber - * @param string $bookingClass - */ - public function __construct( - $itemNumber, - \DateTime $departureDate, - $from, - $to, - $company, - $flightNumber, - $bookingClass - ) { - $this->itemNumber = $itemNumber; - - parent::__construct($departureDate, $from, $to, $company, $flightNumber, $bookingClass); - } -} diff --git a/src/Amadeus/Client/Struct/Service/StandaloneCatalogue/SpecificTravellerDetails.php b/src/Amadeus/Client/Struct/Service/StandaloneCatalogue/SpecificTravellerDetails.php index 1c2698cf5..fbaf65d0f 100755 --- a/src/Amadeus/Client/Struct/Service/StandaloneCatalogue/SpecificTravellerDetails.php +++ b/src/Amadeus/Client/Struct/Service/StandaloneCatalogue/SpecificTravellerDetails.php @@ -23,10 +23,10 @@ namespace Amadeus\Client\Struct\Service\StandaloneCatalogue; /** - * SegmentRepetitionControl + * SpecificTravellerDetails * * @package Amadeus\Client\Struct\Service\StandaloneCatalogue - * @author Dieter Devlieghere + * @author Arvind Pandey */ class SpecificTravellerDetails { diff --git a/src/Amadeus/Client/Struct/Service/StandaloneCatalogue/TravellerDetails.php b/src/Amadeus/Client/Struct/Service/StandaloneCatalogue/TravellerDetails.php index e61acc1b8..9280efa9e 100755 --- a/src/Amadeus/Client/Struct/Service/StandaloneCatalogue/TravellerDetails.php +++ b/src/Amadeus/Client/Struct/Service/StandaloneCatalogue/TravellerDetails.php @@ -26,7 +26,7 @@ * TravellerDetails * * @package Amadeus\Client\Struct\Service\StandaloneCatalogue - * @author Dieter Devlieghere + * @author Arvind Pandey */ class TravellerDetails { From 16c67c95a45ea86677d594074547410edab9d156 Mon Sep 17 00:00:00 2001 From: "arvind.p" Date: Mon, 6 Aug 2018 19:10:54 +0530 Subject: [PATCH 09/67] deleted --- .../StandaloneCatalogue/Passenger.php~ | 61 ---------- .../StandaloneCatalogue/PricingOptions.php~ | 41 ------- .../Service/StandaloneCatalogue/Segment.php~ | 106 ------------------ 3 files changed, 208 deletions(-) delete mode 100755 src/Amadeus/Client/RequestOptions/Service/StandaloneCatalogue/Passenger.php~ delete mode 100755 src/Amadeus/Client/RequestOptions/Service/StandaloneCatalogue/PricingOptions.php~ delete mode 100755 src/Amadeus/Client/RequestOptions/Service/StandaloneCatalogue/Segment.php~ diff --git a/src/Amadeus/Client/RequestOptions/Service/StandaloneCatalogue/Passenger.php~ b/src/Amadeus/Client/RequestOptions/Service/StandaloneCatalogue/Passenger.php~ deleted file mode 100755 index e3027d540..000000000 --- a/src/Amadeus/Client/RequestOptions/Service/StandaloneCatalogue/Passenger.php~ +++ /dev/null @@ -1,61 +0,0 @@ - - */ -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; - - /** - * List of _unique_ identifiers for these passengers. - * - * If you have 3 passengers of this type, you need to provide 3 unique tattoos. - * - * For infants in a seat with an adult, you must provide the ID of the adult as their tattoo. - * - * @var int[] - */ - public $tattoos = []; -} diff --git a/src/Amadeus/Client/RequestOptions/Service/StandaloneCatalogue/PricingOptions.php~ b/src/Amadeus/Client/RequestOptions/Service/StandaloneCatalogue/PricingOptions.php~ deleted file mode 100755 index 4d24cff1f..000000000 --- a/src/Amadeus/Client/RequestOptions/Service/StandaloneCatalogue/PricingOptions.php~ +++ /dev/null @@ -1,41 +0,0 @@ - - */ -class PricingOptions extends ServiceIntegratedPricingOptions -{ - - /** - * Provide a fare basis to price with - * - * @var FareBasis[] - */ - public $pricingsFareBasis = []; -} diff --git a/src/Amadeus/Client/RequestOptions/Service/StandaloneCatalogue/Segment.php~ b/src/Amadeus/Client/RequestOptions/Service/StandaloneCatalogue/Segment.php~ deleted file mode 100755 index 6e4251fc9..000000000 --- a/src/Amadeus/Client/RequestOptions/Service/StandaloneCatalogue/Segment.php~ +++ /dev/null @@ -1,106 +0,0 @@ - - */ -class Segment extends LoadParamsFromArray -{ - /** - * Departure date & time - * - * @var \DateTime - */ - public $departureDate; - - /** - * Arrival date & time - * - * @var \DateTime - */ - public $arrivalDate; - - /** - * Departure IATA code - * - * @var string - */ - public $from; - - /** - * Destination IATA code - * - * @var string - */ - public $to; - - /** - * Marketing airline code - * - * @var string - */ - public $marketingCompany; - - /** - * Operating airline code - * - * @var string - */ - public $operatingCompany; - - /** - * Flight number - * - * @var string - */ - public $flightNumber; - - /** - * Booking Class code - * - * @var string - */ - public $bookingClass; - - /** - * The number of stops - * - * @var int - */ - public $flightIndicator; - - /** - * Unique segment tattoo ID. - * - * @var int - */ - public $segmentTattoo; - - -} From d2bc03c4da7847475b7d237d9ff784f06c2770a8 Mon Sep 17 00:00:00 2001 From: "arvind.p" Date: Tue, 7 Aug 2018 19:15:20 +0530 Subject: [PATCH 10/67] change --- .../Service/StandaloneCatalogue/FlightInfo.php | 2 +- .../StandaloneCatalogue/PassengerInfoGroup.php | 14 ++++++++------ .../SpecificTravellerDetails.php | 8 ++++---- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/Amadeus/Client/Struct/Service/StandaloneCatalogue/FlightInfo.php b/src/Amadeus/Client/Struct/Service/StandaloneCatalogue/FlightInfo.php index 1b22ab905..12663ce69 100755 --- a/src/Amadeus/Client/Struct/Service/StandaloneCatalogue/FlightInfo.php +++ b/src/Amadeus/Client/Struct/Service/StandaloneCatalogue/FlightInfo.php @@ -35,7 +35,7 @@ class FlightInfo { /** - * @var SegmentInformation + * @var flightDetails */ public $flightDetails; diff --git a/src/Amadeus/Client/Struct/Service/StandaloneCatalogue/PassengerInfoGroup.php b/src/Amadeus/Client/Struct/Service/StandaloneCatalogue/PassengerInfoGroup.php index 1b0294ad6..ac5289e9c 100755 --- a/src/Amadeus/Client/Struct/Service/StandaloneCatalogue/PassengerInfoGroup.php +++ b/src/Amadeus/Client/Struct/Service/StandaloneCatalogue/PassengerInfoGroup.php @@ -32,13 +32,15 @@ */ class PassengerInfoGroup { + /** + * * @var specificTravellerDetails */ public $specificTravellerDetails; - /** + * * @var fareInfo */ public $fareInfo; @@ -47,13 +49,13 @@ class PassengerInfoGroup * PassengersGroup constructor. * * @param Passenger $passenger - * @param int $group + * @param int $referenceNumber */ public function __construct($passenger, $referenceNumber) - { - $this->specificTravellerDetails = new SpecificTravellerDetails($referenceNumber); - - if (!empty($passenger->type)) { + { + $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 index fbaf65d0f..0cc0cc4b8 100755 --- a/src/Amadeus/Client/Struct/Service/StandaloneCatalogue/SpecificTravellerDetails.php +++ b/src/Amadeus/Client/Struct/Service/StandaloneCatalogue/SpecificTravellerDetails.php @@ -30,7 +30,9 @@ */ class SpecificTravellerDetails { + /** + * * @var specificTravellerDetails[] */ public $travellerDetails; @@ -39,11 +41,9 @@ class SpecificTravellerDetails * segmentControlDetails constructor. * * @param int $referenceNumber - */ + */ public function __construct($referenceNumber) { - $this->travellerDetails = new TravellerDetails( - $referenceNumber - ); + $this->travellerDetails = new TravellerDetails($referenceNumber); } } From 80e6a06995112ea95bfbc62076a075de4ac70fa8 Mon Sep 17 00:00:00 2001 From: "arvind.p" Date: Tue, 7 Aug 2018 19:20:04 +0530 Subject: [PATCH 11/67] changes --- .../Client/Struct/Service/IntegratedPricing/PricingOptionKey.php | 1 - 1 file changed, 1 deletion(-) mode change 100644 => 100755 src/Amadeus/Client/Struct/Service/IntegratedPricing/PricingOptionKey.php 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 index 3abb22d99..2fdbb0cb0 --- a/src/Amadeus/Client/Struct/Service/IntegratedPricing/PricingOptionKey.php +++ b/src/Amadeus/Client/Struct/Service/IntegratedPricing/PricingOptionKey.php @@ -30,7 +30,6 @@ */ class PricingOptionKey { - const OPTION_FARE_BASIS_SIMPLE_OVERRIDE = "FBA"; const OVERRIDE_ACCOUNT_CODE = "ACC"; const OVERRIDE_PRICING_ALL_SERVICES = "ALL"; const OVERRIDE_AWARD = "AWD"; From 75b361dda0cb28546f110e18bf75a8959a62be36 Mon Sep 17 00:00:00 2001 From: "arvind.p" Date: Wed, 8 Aug 2018 11:59:35 +0530 Subject: [PATCH 12/67] change --- src/Amadeus/Client.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Amadeus/Client.php b/src/Amadeus/Client.php index 02cbd3c00..f1dbd2ae2 100644 --- a/src/Amadeus/Client.php +++ b/src/Amadeus/Client.php @@ -1568,17 +1568,16 @@ public function serviceIntegratedCatalogue( * Service_StandaloneCatalogue * * @param RequestOptions\ServiceStandaloneCatalogueOptions $options - * @param array $messageOptions (OPTIONAL) + * @param array $messageOptions + * (OPTIONAL) * @return Result * @throws Client\InvalidMessageException * @throws Client\RequestCreator\MessageVersionUnsupportedException * @throws Exception */ public function serviceStandaloneCatalogue( - RequestOptions\ServiceStandaloneCatalogueOptions $options, - $messageOptions = [] - - ) { + RequestOptions\ServiceStandaloneCatalogueOptions $options, $messageOptions = []) + { $msgName = 'Service_StandaloneCatalogue'; return $this->callMessage($msgName, $options, $messageOptions); From 966f851803630f41fd51568041d6e47846482903 Mon Sep 17 00:00:00 2001 From: "arvind.p" Date: Wed, 8 Aug 2018 12:24:12 +0530 Subject: [PATCH 13/67] change --- src/Amadeus/Client.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Amadeus/Client.php b/src/Amadeus/Client.php index f1dbd2ae2..e687c632f 100644 --- a/src/Amadeus/Client.php +++ b/src/Amadeus/Client.php @@ -1578,9 +1578,9 @@ public function serviceIntegratedCatalogue( public function serviceStandaloneCatalogue( RequestOptions\ServiceStandaloneCatalogueOptions $options, $messageOptions = []) { - $msgName = 'Service_StandaloneCatalogue'; + $msgName = 'Service_StandaloneCatalogue'; - return $this->callMessage($msgName, $options, $messageOptions); + return $this->callMessage($msgName, $options, $messageOptions); } /** From 7111c55dfde025c4d3eb22e407b1e0b60bd1c169 Mon Sep 17 00:00:00 2001 From: "arvind.p" Date: Wed, 8 Aug 2018 12:30:38 +0530 Subject: [PATCH 14/67] change --- src/Amadeus/Client.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Amadeus/Client.php b/src/Amadeus/Client.php index e687c632f..86c32bd5c 100644 --- a/src/Amadeus/Client.php +++ b/src/Amadeus/Client.php @@ -1575,12 +1575,11 @@ public function serviceIntegratedCatalogue( * @throws Client\RequestCreator\MessageVersionUnsupportedException * @throws Exception */ - public function serviceStandaloneCatalogue( - RequestOptions\ServiceStandaloneCatalogueOptions $options, $messageOptions = []) + public function serviceStandaloneCatalogue(RequestOptions\ServiceStandaloneCatalogueOptions $options, $messageOptions = []) { $msgName = 'Service_StandaloneCatalogue'; - - return $this->callMessage($msgName, $options, $messageOptions); + + return $this->callMessage($msgName, $options, $messageOptions); } /** From 3a94c65e0dcfbb5af121e858024fd61ff6d7e479 Mon Sep 17 00:00:00 2001 From: "arvind.p" Date: Wed, 8 Aug 2018 12:44:18 +0530 Subject: [PATCH 15/67] change --- .../StandaloneCatalogue/PricingOptions.php | 20 ++--- .../ServiceStandaloneCatalogueOptions.php | 76 +++++++++---------- .../Service/StandaloneCatalogue/FareInfo.php | 8 +- .../StandaloneCatalogue/TravellerDetails.php | 7 +- 4 files changed, 55 insertions(+), 56 deletions(-) diff --git a/src/Amadeus/Client/RequestOptions/Service/StandaloneCatalogue/PricingOptions.php b/src/Amadeus/Client/RequestOptions/Service/StandaloneCatalogue/PricingOptions.php index 2f7cf0224..a9084886c 100755 --- a/src/Amadeus/Client/RequestOptions/Service/StandaloneCatalogue/PricingOptions.php +++ b/src/Amadeus/Client/RequestOptions/Service/StandaloneCatalogue/PricingOptions.php @@ -22,20 +22,20 @@ namespace Amadeus\Client\RequestOptions\Service\StandaloneCatalogue; use Amadeus\Client\RequestOptions\ServiceIntegratedPricingOptions; + /** - * Pricing Options for the Fare_InformativePricingWithoutPNR message - * - * The pricing options are the same as a Fare_PricePnrWithBookingClassOptions + * Pricing Options for the Service_StandaloneCatalogue message * * @package Amadeus\Client\RequestOptions\ServiceIntegratedPricingOptions * @author Arvind Pandey */ class PricingOptions extends ServiceIntegratedPricingOptions -{ - /** - * Provide a fare basis to price with - * - * @var FareBasis[] - */ - public $pricingsFareBasis = []; +{ + + /** + * Provide a fare basis to price with + * + * @var pricingsFareBasis[] + */ + public $pricingsFareBasis = []; } diff --git a/src/Amadeus/Client/RequestOptions/ServiceStandaloneCatalogueOptions.php b/src/Amadeus/Client/RequestOptions/ServiceStandaloneCatalogueOptions.php index 96fb2a5cf..b096fccc3 100755 --- a/src/Amadeus/Client/RequestOptions/ServiceStandaloneCatalogueOptions.php +++ b/src/Amadeus/Client/RequestOptions/ServiceStandaloneCatalogueOptions.php @@ -1,40 +1,38 @@ - - */ -class ServiceStandaloneCatalogueOptions extends Base -{ - public $passengers = []; - - public $segments = []; - - public $pricingOptions; + + */ +class ServiceStandaloneCatalogueOptions extends Base +{ + + public $passengers = []; + + public $segments = []; + + public $pricingOptions; } - - -?> \ No newline at end of file diff --git a/src/Amadeus/Client/Struct/Service/StandaloneCatalogue/FareInfo.php b/src/Amadeus/Client/Struct/Service/StandaloneCatalogue/FareInfo.php index bcabf8243..bf9366042 100755 --- a/src/Amadeus/Client/Struct/Service/StandaloneCatalogue/FareInfo.php +++ b/src/Amadeus/Client/Struct/Service/StandaloneCatalogue/FareInfo.php @@ -19,25 +19,25 @@ * @package Amadeus * @license https://opensource.org/licenses/Apache-2.0 Apache 2.0 */ - namespace Amadeus\Client\Struct\Service\StandaloneCatalogue; /** * FareInfo * * @package Amadeus\Client\Struct\Service\StandaloneCatalogue - * @author Dieter Devlieghere + * @author Arvind PAndey */ class FareInfo { + /** + * * @var string */ public $valueQualifier; - public function __construct($paxType) { - $this->valueQualifier = $paxType; + $this->valueQualifier = $paxType; } } diff --git a/src/Amadeus/Client/Struct/Service/StandaloneCatalogue/TravellerDetails.php b/src/Amadeus/Client/Struct/Service/StandaloneCatalogue/TravellerDetails.php index 9280efa9e..0a65bf107 100755 --- a/src/Amadeus/Client/Struct/Service/StandaloneCatalogue/TravellerDetails.php +++ b/src/Amadeus/Client/Struct/Service/StandaloneCatalogue/TravellerDetails.php @@ -19,18 +19,19 @@ * @package Amadeus * @license https://opensource.org/licenses/Apache-2.0 Apache 2.0 */ - namespace Amadeus\Client\Struct\Service\StandaloneCatalogue; /** * TravellerDetails * - * @package Amadeus\Client\Struct\Service\StandaloneCatalogue + * @package Amadeus\Client\Struct\Service\StandaloneCatalogue * @author Arvind Pandey */ class TravellerDetails { - /** + + /** + * * @var int */ public $referenceNumber; From d2ce6655f7467a7a358464dade3513115993b531 Mon Sep 17 00:00:00 2001 From: "arvind.p" Date: Wed, 8 Aug 2018 12:52:28 +0530 Subject: [PATCH 16/67] change --- .../Struct/Service/IntegratedPricing.php | 82 +++++--------- .../Struct/Service/StandaloneCatalogue.php | 105 ++++++++++++++++++ 2 files changed, 133 insertions(+), 54 deletions(-) mode change 100644 => 100755 src/Amadeus/Client/Struct/Service/IntegratedPricing.php create mode 100755 src/Amadeus/Client/Struct/Service/StandaloneCatalogue.php 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 7cf04eca9..69734a057 --- a/src/Amadeus/Client/Struct/Service/IntegratedPricing.php +++ b/src/Amadeus/Client/Struct/Service/IntegratedPricing.php @@ -72,7 +72,7 @@ public function __construct($options = null) public static function loadPricingOptions($options) { $priceOptions = []; - + $priceOptions = self::mergeOptions( $priceOptions, self::makePricingOptionFareBasisOverride($options->pricingsFareBasis) @@ -122,36 +122,17 @@ public static function loadPricingOptions($options) $priceOptions = self::mergeOptions( $priceOptions, - 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) + 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) ); // All options processed, no options found: @@ -161,35 +142,28 @@ public static function loadPricingOptions($options) return $priceOptions; } - + /** + * * @param FareBasis[] $pricingsFareBasis * @return PricingOptionGroup[] */ protected static function makePricingOptionFareBasisOverride($pricingsFareBasis) { - $opt = []; - - if ($pricingsFareBasis !== null) { - foreach ($pricingsFareBasis as $pricingFareBasis) { - $po = new PricingOptionGroup(PricingOptionKey::OPTION_FARE_BASIS_SIMPLE_OVERRIDE); - - //Support for legacy fareBasisPrimaryCode to be removed when breaking BC: - $po->optionDetail = new OptionDetail( - $pricingFareBasis->fareBasisPrimaryCode.$pricingFareBasis->fareBasisCode - ); - - //Support for legacy segmentReference to be removed when breaking BC: - $po->paxSegTstReference = new PaxSegTstReference( - $pricingFareBasis->references, - $pricingFareBasis->segmentReference - ); - - $opt[] = $po; - } - } - - return $opt; + $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; } diff --git a/src/Amadeus/Client/Struct/Service/StandaloneCatalogue.php b/src/Amadeus/Client/Struct/Service/StandaloneCatalogue.php new file mode 100755 index 000000000..0bcf484a9 --- /dev/null +++ b/src/Amadeus/Client/Struct/Service/StandaloneCatalogue.php @@ -0,0 +1,105 @@ +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 PricingOptions)) { + $pricingOptions = new PricingOptions(); + } + $this->pricingOption = IntegratedPricing::loadPricingOptions($pricingOptions); + } +} From edcdbb273c7d245f356eba1bfa1c0f64c655448f Mon Sep 17 00:00:00 2001 From: "arvind.p" Date: Wed, 8 Aug 2018 12:56:45 +0530 Subject: [PATCH 17/67] change --- .../Client/RequestOptions/ServiceStandaloneCatalogueOptions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Amadeus/Client/RequestOptions/ServiceStandaloneCatalogueOptions.php b/src/Amadeus/Client/RequestOptions/ServiceStandaloneCatalogueOptions.php index b096fccc3..2a4f59905 100755 --- a/src/Amadeus/Client/RequestOptions/ServiceStandaloneCatalogueOptions.php +++ b/src/Amadeus/Client/RequestOptions/ServiceStandaloneCatalogueOptions.php @@ -29,10 +29,10 @@ */ class ServiceStandaloneCatalogueOptions extends Base { - public $passengers = []; public $segments = []; public $pricingOptions; + } From 0c0e0a43136453ea70f7b49d119c261d3d1e4da1 Mon Sep 17 00:00:00 2001 From: "arvind.p" Date: Wed, 8 Aug 2018 13:02:55 +0530 Subject: [PATCH 18/67] change --- .../RequestOptions/ServiceStandaloneCatalogueOptions.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Amadeus/Client/RequestOptions/ServiceStandaloneCatalogueOptions.php b/src/Amadeus/Client/RequestOptions/ServiceStandaloneCatalogueOptions.php index 2a4f59905..ebc6b3822 100755 --- a/src/Amadeus/Client/RequestOptions/ServiceStandaloneCatalogueOptions.php +++ b/src/Amadeus/Client/RequestOptions/ServiceStandaloneCatalogueOptions.php @@ -34,5 +34,4 @@ class ServiceStandaloneCatalogueOptions extends Base public $segments = []; public $pricingOptions; - -} +} From 431242a789a354ce18f0f80156455e2eb34c8d12 Mon Sep 17 00:00:00 2001 From: "arvind.p" Date: Wed, 8 Aug 2018 13:10:06 +0530 Subject: [PATCH 19/67] change --- .../Struct/Service/IntegratedPricing.php | 6 ++--- .../Struct/Service/StandaloneCatalogue.php | 25 +++++++++++-------- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/src/Amadeus/Client/Struct/Service/IntegratedPricing.php b/src/Amadeus/Client/Struct/Service/IntegratedPricing.php index 69734a057..c11ea443a 100755 --- a/src/Amadeus/Client/Struct/Service/IntegratedPricing.php +++ b/src/Amadeus/Client/Struct/Service/IntegratedPricing.php @@ -72,10 +72,10 @@ public function __construct($options = null) public static function loadPricingOptions($options) { $priceOptions = []; - + $priceOptions = self::mergeOptions( - $priceOptions, - self::makePricingOptionFareBasisOverride($options->pricingsFareBasis) + $priceOptions, + self::makePricingOptionFareBasisOverride($options->pricingsFareBasis) ); $priceOptions = self::mergeOptions( diff --git a/src/Amadeus/Client/Struct/Service/StandaloneCatalogue.php b/src/Amadeus/Client/Struct/Service/StandaloneCatalogue.php index 0bcf484a9..a7732cf9d 100755 --- a/src/Amadeus/Client/Struct/Service/StandaloneCatalogue.php +++ b/src/Amadeus/Client/Struct/Service/StandaloneCatalogue.php @@ -19,14 +19,12 @@ * @package Amadeus * @license https://opensource.org/licenses/Apache-2.0 Apache 2.0 */ - namespace Amadeus\Client\Struct\Service; use Amadeus\Client\Struct\BaseWsMessage; use Amadeus\Client\RequestOptions\Service\StandaloneCatalogue\Passenger; use Amadeus\Client\RequestOptions\Fare\InformativePricing\Segment; use Amadeus\Client\RequestOptions\ServiceStandaloneCatalogueOptions; - use Amadeus\Client\Struct\Service\StandaloneCatalogue\PassengerInfoGroup; use Amadeus\Client\Struct\Service\StandaloneCatalogue\FlightInfo; use Amadeus\Client\RequestOptions\Service\StandaloneCatalogue\PricingOptions; @@ -39,17 +37,21 @@ */ class StandaloneCatalogue extends BaseWsMessage { - /** + + /** + * * @var passengerInfoGroup[] */ public $passengerInfoGroup = []; /** + * * @var flightInfo[] */ public $flightInfo = []; /** + * * @var pricingOption[] */ public $pricingOption = []; @@ -61,28 +63,30 @@ class StandaloneCatalogue extends BaseWsMessage */ public function __construct($options) { - if (!is_null($options)) { - $this->loadPassengers($options->passengers); - + if (! is_null($options)) { + $this->loadPassengers($options->passengers); + $this->loadflightDetails($options->segments); - + $this->loadPricingOptions($options->pricingOptions); } } /** + * * @param Passenger[] $passengers */ protected function loadPassengers($passengers) { $counter = 1; - foreach ($passengers as $passenger) { + foreach ($passengers as $passenger) { $this->passengerInfoGroup[] = new PassengerInfoGroup($passenger, $counter); - $counter++; + $counter ++; } } /** + * * @param Segment[] $segments */ protected function loadflightDetails($segments) @@ -93,11 +97,12 @@ protected function loadflightDetails($segments) } /** + * * @param PricingOptions|null $pricingOptions */ protected function loadPricingOptions($pricingOptions) { - if (!($pricingOptions instanceof PricingOptions)) { + if (! ($pricingOptions instanceof PricingOptions)) { $pricingOptions = new PricingOptions(); } $this->pricingOption = IntegratedPricing::loadPricingOptions($pricingOptions); From ed5fb9c3dd7fb0da6139f4b7cc5e6e5a52309fca Mon Sep 17 00:00:00 2001 From: "arvind.p" Date: Wed, 8 Aug 2018 15:24:52 +0530 Subject: [PATCH 20/67] change --- src/Amadeus/Client/Struct/Service/IntegratedPricing.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Amadeus/Client/Struct/Service/IntegratedPricing.php b/src/Amadeus/Client/Struct/Service/IntegratedPricing.php index c11ea443a..78284f2db 100755 --- a/src/Amadeus/Client/Struct/Service/IntegratedPricing.php +++ b/src/Amadeus/Client/Struct/Service/IntegratedPricing.php @@ -48,7 +48,9 @@ */ class IntegratedPricing extends BasePricingMessage { + /** + * * @var PricingOption[] */ public $pricingOption = []; @@ -211,7 +213,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 = []; From 3f232c406dda106f829fa74b149dbcfaccb388fa Mon Sep 17 00:00:00 2001 From: "arvind.p" Date: Wed, 8 Aug 2018 15:35:33 +0530 Subject: [PATCH 21/67] change --- tests/Amadeus/Client/Struct/Service/IntegratedCatalogueTest.php | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/Amadeus/Client/Struct/Service/IntegratedCatalogueTest.php b/tests/Amadeus/Client/Struct/Service/IntegratedCatalogueTest.php index 79026ea59..c474b85f4 100644 --- a/tests/Amadeus/Client/Struct/Service/IntegratedCatalogueTest.php +++ b/tests/Amadeus/Client/Struct/Service/IntegratedCatalogueTest.php @@ -24,6 +24,7 @@ use Amadeus\Client\RequestOptions\Service\PaxSegRef; use Amadeus\Client\RequestOptions\ServiceIntegratedCatalogueOptions; +use Amadeus\Client\RequestOptions\ServiceStandaloneCatalogueOptions; use Amadeus\Client\Struct\Service\IntegratedCatalogue; use Amadeus\Client\Struct\Service\IntegratedPricing; use Amadeus\Client\Struct\Fare\PricePnr13\ReferenceDetails; From f456fe1c36b7ea218bec658240b373e52eb85628 Mon Sep 17 00:00:00 2001 From: arvind-pandey <40858867+arvind-pandey@users.noreply.github.com> Date: Wed, 8 Aug 2018 17:56:23 +0530 Subject: [PATCH 22/67] Update samples.rst --- docs/samples.rst | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/docs/samples.rst b/docs/samples.rst index 0b040b393..d01ff8703 100644 --- a/docs/samples.rst +++ b/docs/samples.rst @@ -3230,11 +3230,21 @@ Service_StandaloneCatalogue 'segmentTattoo' => 1 ]) ], - 'pricingOptions' => new PricingOptions([ + 'pricingOptions' => new ServiceIntegratedPricingOptions([ 'pricingsFareBasis' => [ new FareBasis([ 'fareBasisCode' => 'LOXOW', ]) + ], + 'references' => [ + new PaxSegRef([ + 'reference' => 1, + 'type' => 'S' + ]), + new PaxSegRef([ + 'reference' => 1, + 'type' => 'P' + ]) ] ]) ]) From 061208b442b20c319e1288c166f7c17006da38aa Mon Sep 17 00:00:00 2001 From: "arvind.p" Date: Wed, 8 Aug 2018 18:17:14 +0530 Subject: [PATCH 23/67] change --- .../StandaloneCatalogue/PricingOptions.php | 41 ------------------- .../ServiceIntegratedPricingOptions.php | 7 ++++ .../Struct/Service/IntegratedPricing.php | 3 +- .../Struct/Service/StandaloneCatalogue.php | 7 ++-- .../Service/IntegratedCatalogueTest.php | 1 - 5 files changed, 13 insertions(+), 46 deletions(-) delete mode 100755 src/Amadeus/Client/RequestOptions/Service/StandaloneCatalogue/PricingOptions.php mode change 100644 => 100755 src/Amadeus/Client/RequestOptions/ServiceIntegratedPricingOptions.php diff --git a/src/Amadeus/Client/RequestOptions/Service/StandaloneCatalogue/PricingOptions.php b/src/Amadeus/Client/RequestOptions/Service/StandaloneCatalogue/PricingOptions.php deleted file mode 100755 index a9084886c..000000000 --- a/src/Amadeus/Client/RequestOptions/Service/StandaloneCatalogue/PricingOptions.php +++ /dev/null @@ -1,41 +0,0 @@ - - */ -class PricingOptions extends ServiceIntegratedPricingOptions -{ - - /** - * Provide a fare basis to price with - * - * @var pricingsFareBasis[] - */ - public $pricingsFareBasis = []; -} diff --git a/src/Amadeus/Client/RequestOptions/ServiceIntegratedPricingOptions.php b/src/Amadeus/Client/RequestOptions/ServiceIntegratedPricingOptions.php old mode 100644 new mode 100755 index 97a4eb290..f50e143a9 --- 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_* * diff --git a/src/Amadeus/Client/Struct/Service/IntegratedPricing.php b/src/Amadeus/Client/Struct/Service/IntegratedPricing.php index 78284f2db..e06524bc3 100755 --- 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; @@ -74,7 +75,7 @@ public function __construct($options = null) public static function loadPricingOptions($options) { $priceOptions = []; - + $priceOptions = self::mergeOptions( $priceOptions, self::makePricingOptionFareBasisOverride($options->pricingsFareBasis) diff --git a/src/Amadeus/Client/Struct/Service/StandaloneCatalogue.php b/src/Amadeus/Client/Struct/Service/StandaloneCatalogue.php index a7732cf9d..eeae481ad 100755 --- a/src/Amadeus/Client/Struct/Service/StandaloneCatalogue.php +++ b/src/Amadeus/Client/Struct/Service/StandaloneCatalogue.php @@ -24,10 +24,11 @@ use Amadeus\Client\Struct\BaseWsMessage; use Amadeus\Client\RequestOptions\Service\StandaloneCatalogue\Passenger; use Amadeus\Client\RequestOptions\Fare\InformativePricing\Segment; +use Amadeus\Client\RequestOptions\ServiceIntegratedPricingOptions; use Amadeus\Client\RequestOptions\ServiceStandaloneCatalogueOptions; use Amadeus\Client\Struct\Service\StandaloneCatalogue\PassengerInfoGroup; use Amadeus\Client\Struct\Service\StandaloneCatalogue\FlightInfo; -use Amadeus\Client\RequestOptions\Service\StandaloneCatalogue\PricingOptions; + /** * StandaloneCatalogue @@ -102,8 +103,8 @@ protected function loadflightDetails($segments) */ protected function loadPricingOptions($pricingOptions) { - if (! ($pricingOptions instanceof PricingOptions)) { - $pricingOptions = new PricingOptions(); + if (! ($pricingOptions instanceof ServiceIntegratedPricingOptions)) { + $pricingOptions = new ServiceIntegratedPricingOptions(); } $this->pricingOption = IntegratedPricing::loadPricingOptions($pricingOptions); } diff --git a/tests/Amadeus/Client/Struct/Service/IntegratedCatalogueTest.php b/tests/Amadeus/Client/Struct/Service/IntegratedCatalogueTest.php index c474b85f4..79026ea59 100644 --- a/tests/Amadeus/Client/Struct/Service/IntegratedCatalogueTest.php +++ b/tests/Amadeus/Client/Struct/Service/IntegratedCatalogueTest.php @@ -24,7 +24,6 @@ use Amadeus\Client\RequestOptions\Service\PaxSegRef; use Amadeus\Client\RequestOptions\ServiceIntegratedCatalogueOptions; -use Amadeus\Client\RequestOptions\ServiceStandaloneCatalogueOptions; use Amadeus\Client\Struct\Service\IntegratedCatalogue; use Amadeus\Client\Struct\Service\IntegratedPricing; use Amadeus\Client\Struct\Fare\PricePnr13\ReferenceDetails; From 7605a23c7b7cb0c6005df63511eb65097b25692f Mon Sep 17 00:00:00 2001 From: "arvind.p" Date: Wed, 8 Aug 2018 18:27:26 +0530 Subject: [PATCH 24/67] change --- src/Amadeus/Client/Struct/Service/StandaloneCatalogue.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Amadeus/Client/Struct/Service/StandaloneCatalogue.php b/src/Amadeus/Client/Struct/Service/StandaloneCatalogue.php index eeae481ad..795f17ae6 100755 --- a/src/Amadeus/Client/Struct/Service/StandaloneCatalogue.php +++ b/src/Amadeus/Client/Struct/Service/StandaloneCatalogue.php @@ -29,7 +29,6 @@ use Amadeus\Client\Struct\Service\StandaloneCatalogue\PassengerInfoGroup; use Amadeus\Client\Struct\Service\StandaloneCatalogue\FlightInfo; - /** * StandaloneCatalogue * From ce4ee7eb4e76b293014e82e9d9f8368ae8a7e172 Mon Sep 17 00:00:00 2001 From: "arvind.p" Date: Wed, 8 Aug 2018 18:31:52 +0530 Subject: [PATCH 25/67] change --- src/Amadeus/Client/Struct/Service/IntegratedPricing.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Amadeus/Client/Struct/Service/IntegratedPricing.php b/src/Amadeus/Client/Struct/Service/IntegratedPricing.php index e06524bc3..5afbf5744 100755 --- a/src/Amadeus/Client/Struct/Service/IntegratedPricing.php +++ b/src/Amadeus/Client/Struct/Service/IntegratedPricing.php @@ -55,7 +55,7 @@ class IntegratedPricing extends BasePricingMessage * @var PricingOption[] */ public $pricingOption = []; - + /** * IntegratedPricing constructor. * @@ -75,7 +75,7 @@ public function __construct($options = null) public static function loadPricingOptions($options) { $priceOptions = []; - + $priceOptions = self::mergeOptions( $priceOptions, self::makePricingOptionFareBasisOverride($options->pricingsFareBasis) From eb7f3ff6f8aabb96f2076020460a78fca4f5eb12 Mon Sep 17 00:00:00 2001 From: "arvind.p" Date: Mon, 13 Aug 2018 13:11:24 +0530 Subject: [PATCH 26/67] change --- .../StandaloneCatalogue/FlightInfo.php | 54 +++---------------- 1 file changed, 8 insertions(+), 46 deletions(-) diff --git a/src/Amadeus/Client/Struct/Service/StandaloneCatalogue/FlightInfo.php b/src/Amadeus/Client/Struct/Service/StandaloneCatalogue/FlightInfo.php index 12663ce69..f3943418b 100755 --- a/src/Amadeus/Client/Struct/Service/StandaloneCatalogue/FlightInfo.php +++ b/src/Amadeus/Client/Struct/Service/StandaloneCatalogue/FlightInfo.php @@ -23,6 +23,7 @@ namespace Amadeus\Client\Struct\Service\StandaloneCatalogue; use Amadeus\Client\RequestOptions\Fare\InformativePricing\Segment; +use Amadeus\Client\Struct\Fare\InformativePricing13\SegmentGroup; use Amadeus\Client\Struct\Fare\InformativePricing13\SegmentInformation; use Amadeus\Client\Struct\Air\FlightTypeDetails; @@ -32,7 +33,7 @@ * @package Amadeus\Client\Struct\Service\StandaloneCatalogue * @author Arvind Pandey */ -class FlightInfo +class FlightInfo extends SegmentGroup { /** * @var flightDetails @@ -40,19 +41,9 @@ class FlightInfo public $flightDetails; /** - * @var AdditionalSegmentDetails - */ - public $additionnalSegmentDetails; - - /** - * @var Inventory - */ - public $inventory; - - /** - * SegmentGroup constructor. + * FlightInfo constructor. * - * @param Segment $options + * @param FlightInfo $options */ public function __construct($options) { @@ -68,13 +59,13 @@ public function __construct($options) $this->loadOptionalSegmentInformation($options); - $this->loadInventory($options->inventory); + SegmentGroup::loadInventory($options->inventory); } /** * Load non-required options if available * - * @param Segment $options + * @param FlightInfo $options */ protected function loadOptionalSegmentInformation($options) { @@ -90,36 +81,7 @@ protected function loadOptionalSegmentInformation($options) $this->flightDetails->flightTypeDetails = new FlightTypeDetails($options->groupNumber); } - $this->loadAdditionalSegmentDetails($options->airplaneCode, $options->nrOfStops); - } - - /** - * @param string|null $airplaneCode - * @param int|null $nrOfStops - */ - protected function loadAdditionalSegmentDetails($airplaneCode, $nrOfStops) - { - if (!empty($airplaneCode) || !empty($nrOfStops)) { - $this->additionalFlightInfo = new AdditionalSegmentDetails($airplaneCode, $nrOfStops); - } - } - - /** - * Load inventory information - * - * @param array $inventory - */ - protected function loadInventory($inventory) - { - if (is_array($inventory) && count($inventory) > 0) { - $this->inventory = new Inventory(); - - foreach ($inventory as $bookingClass => $availabilityAmount) { - $this->inventory->bookingClassDetails[] = new BookingClassDetails( - $bookingClass, - $availabilityAmount - ); - } - } + SegmentGroup::loadAdditionalSegmentDetails($options->airplaneCode, $options->nrOfStops); } + } From 35a3e6b6f27d79968adf9869e28989af43d1d8f1 Mon Sep 17 00:00:00 2001 From: "arvind.p" Date: Mon, 13 Aug 2018 13:21:32 +0530 Subject: [PATCH 27/67] change --- .../Client/Struct/Service/StandaloneCatalogue/FlightInfo.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Amadeus/Client/Struct/Service/StandaloneCatalogue/FlightInfo.php b/src/Amadeus/Client/Struct/Service/StandaloneCatalogue/FlightInfo.php index f3943418b..075cffd20 100755 --- a/src/Amadeus/Client/Struct/Service/StandaloneCatalogue/FlightInfo.php +++ b/src/Amadeus/Client/Struct/Service/StandaloneCatalogue/FlightInfo.php @@ -83,5 +83,4 @@ protected function loadOptionalSegmentInformation($options) SegmentGroup::loadAdditionalSegmentDetails($options->airplaneCode, $options->nrOfStops); } - } From cc7de1698fc27c4b9af8b49cb58c4b4eeb0d28b8 Mon Sep 17 00:00:00 2001 From: "arvind.p" Date: Thu, 23 Aug 2018 17:59:17 +0530 Subject: [PATCH 28/67] Changes --- .../ServiceStandalonePricingOptions.php | 37 +++++++++++++++++++ .../StandaloneCatalogue/FlightInfo.php | 10 ++--- .../PassengerInfoGroup.php | 2 +- .../SpecificTravellerDetails.php | 2 +- 4 files changed, 44 insertions(+), 7 deletions(-) create mode 100755 src/Amadeus/Client/RequestOptions/Service/StandaloneCatalogue/ServiceStandalonePricingOptions.php diff --git a/src/Amadeus/Client/RequestOptions/Service/StandaloneCatalogue/ServiceStandalonePricingOptions.php b/src/Amadeus/Client/RequestOptions/Service/StandaloneCatalogue/ServiceStandalonePricingOptions.php new file mode 100755 index 000000000..e209b8b22 --- /dev/null +++ b/src/Amadeus/Client/RequestOptions/Service/StandaloneCatalogue/ServiceStandalonePricingOptions.php @@ -0,0 +1,37 @@ + + */ +class ServiceStandalonePricingOptions extends PricingOptions +{ + + const OVERRIDE_MANUAL_INPUT_FORMATTED = 'MIF'; + const OVERRIDE_COMMERCIAL_DESCRIPTION = 'SCD'; +} diff --git a/src/Amadeus/Client/Struct/Service/StandaloneCatalogue/FlightInfo.php b/src/Amadeus/Client/Struct/Service/StandaloneCatalogue/FlightInfo.php index 075cffd20..9a4b13209 100755 --- a/src/Amadeus/Client/Struct/Service/StandaloneCatalogue/FlightInfo.php +++ b/src/Amadeus/Client/Struct/Service/StandaloneCatalogue/FlightInfo.php @@ -69,18 +69,18 @@ public function __construct($options) */ protected function loadOptionalSegmentInformation($options) { - if (!empty($options->operatingCompany)) { + 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)) { + + 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 index ac5289e9c..aa2ff4f4b 100755 --- a/src/Amadeus/Client/Struct/Service/StandaloneCatalogue/PassengerInfoGroup.php +++ b/src/Amadeus/Client/Struct/Service/StandaloneCatalogue/PassengerInfoGroup.php @@ -46,7 +46,7 @@ class PassengerInfoGroup public $fareInfo; /** - * PassengersGroup constructor. + * PassengerInfoGroup constructor. * * @param Passenger $passenger * @param int $referenceNumber diff --git a/src/Amadeus/Client/Struct/Service/StandaloneCatalogue/SpecificTravellerDetails.php b/src/Amadeus/Client/Struct/Service/StandaloneCatalogue/SpecificTravellerDetails.php index 0cc0cc4b8..f177ec257 100755 --- a/src/Amadeus/Client/Struct/Service/StandaloneCatalogue/SpecificTravellerDetails.php +++ b/src/Amadeus/Client/Struct/Service/StandaloneCatalogue/SpecificTravellerDetails.php @@ -38,7 +38,7 @@ class SpecificTravellerDetails public $travellerDetails; /** - * segmentControlDetails constructor. + * SpecificTravellerDetails constructor. * * @param int $referenceNumber */ From c67a6b8fa2d9ab6fd5d2ce897c81f7836b94a8cd Mon Sep 17 00:00:00 2001 From: "arvind.p" Date: Thu, 23 Aug 2018 18:10:38 +0530 Subject: [PATCH 29/67] Changes --- .../RequestOptions/ServiceStandaloneCatalogueOptions.php | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/Amadeus/Client/RequestOptions/ServiceStandaloneCatalogueOptions.php b/src/Amadeus/Client/RequestOptions/ServiceStandaloneCatalogueOptions.php index ebc6b3822..224d2bb66 100755 --- a/src/Amadeus/Client/RequestOptions/ServiceStandaloneCatalogueOptions.php +++ b/src/Amadeus/Client/RequestOptions/ServiceStandaloneCatalogueOptions.php @@ -27,11 +27,6 @@ * @package Amadeus\Client\RequestOptions * @author Arvind Pandey */ -class ServiceStandaloneCatalogueOptions extends Base +class ServiceStandaloneCatalogueOptions extends FareInformativePricingWithoutPnrOptions { - public $passengers = []; - - public $segments = []; - - public $pricingOptions; -} +} From bde5e84db6c98bbe59b15540b95f9ce6c6974761 Mon Sep 17 00:00:00 2001 From: "arvind.p" Date: Thu, 23 Aug 2018 18:18:34 +0530 Subject: [PATCH 30/67] Changes --- .../Client/Struct/Service/StandaloneCatalogue.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/Amadeus/Client/Struct/Service/StandaloneCatalogue.php b/src/Amadeus/Client/Struct/Service/StandaloneCatalogue.php index 795f17ae6..29f5cb15b 100755 --- a/src/Amadeus/Client/Struct/Service/StandaloneCatalogue.php +++ b/src/Amadeus/Client/Struct/Service/StandaloneCatalogue.php @@ -24,16 +24,18 @@ use Amadeus\Client\Struct\BaseWsMessage; use Amadeus\Client\RequestOptions\Service\StandaloneCatalogue\Passenger; use Amadeus\Client\RequestOptions\Fare\InformativePricing\Segment; +use Amadeus\Client\RequestOptions\Service\StandaloneCatalogue\ServiceStandalonePricingOptions; use Amadeus\Client\RequestOptions\ServiceIntegratedPricingOptions; use Amadeus\Client\RequestOptions\ServiceStandaloneCatalogueOptions; use Amadeus\Client\Struct\Service\StandaloneCatalogue\PassengerInfoGroup; use Amadeus\Client\Struct\Service\StandaloneCatalogue\FlightInfo; +use Amadeus\Client\Struct\Fare\PricePNRWithBookingClass13; /** * StandaloneCatalogue * * @package Amadeus\Client\Struct\Fare - * @author StandaloneCatalogue.php + * @author Arvind Pandey */ class StandaloneCatalogue extends BaseWsMessage { @@ -92,7 +94,7 @@ protected function loadPassengers($passengers) protected function loadflightDetails($segments) { foreach ($segments as $segment) { - $this->flightInfo[] = new flightInfo($segment); + $this->flightInfo[] = new FlightInfo($segment); } } @@ -102,9 +104,8 @@ protected function loadflightDetails($segments) */ protected function loadPricingOptions($pricingOptions) { - if (! ($pricingOptions instanceof ServiceIntegratedPricingOptions)) { - $pricingOptions = new ServiceIntegratedPricingOptions(); - } - $this->pricingOption = IntegratedPricing::loadPricingOptions($pricingOptions); + + $this->pricingOption = PricePNRWithBookingClass13::loadPricingOptionsFromRequestOptions($pricingOptions); + } } From 00edb929de5feb8b8592dfd7fe0353f438ea63db Mon Sep 17 00:00:00 2001 From: "arvind.p" Date: Fri, 24 Aug 2018 11:57:32 +0530 Subject: [PATCH 31/67] undone the changes --- .../Client/RequestOptions/ServiceIntegratedPricingOptions.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Amadeus/Client/RequestOptions/ServiceIntegratedPricingOptions.php b/src/Amadeus/Client/RequestOptions/ServiceIntegratedPricingOptions.php index f50e143a9..bbb647f52 100755 --- a/src/Amadeus/Client/RequestOptions/ServiceIntegratedPricingOptions.php +++ b/src/Amadeus/Client/RequestOptions/ServiceIntegratedPricingOptions.php @@ -174,3 +174,4 @@ class ServiceIntegratedPricingOptions extends Base */ public $references = []; } + From febdeee99a7a942ac560971c9b5b5f46d878ac68 Mon Sep 17 00:00:00 2001 From: "arvind.p" Date: Fri, 24 Aug 2018 12:17:42 +0530 Subject: [PATCH 32/67] changes remove --- .../ServiceIntegratedPricingOptions.php | 68 +++++++++---------- 1 file changed, 31 insertions(+), 37 deletions(-) diff --git a/src/Amadeus/Client/RequestOptions/ServiceIntegratedPricingOptions.php b/src/Amadeus/Client/RequestOptions/ServiceIntegratedPricingOptions.php index bbb647f52..e678ae862 100755 --- a/src/Amadeus/Client/RequestOptions/ServiceIntegratedPricingOptions.php +++ b/src/Amadeus/Client/RequestOptions/ServiceIntegratedPricingOptions.php @@ -27,41 +27,42 @@ use Amadeus\Client\RequestOptions\Service\PaxSegRef; /** - * Service_IntegratedPricing Request Options + * ServiceIntegratedPricingOptions * * @package Amadeus\Client\RequestOptions - * @author Dieter Devlieghere + * @author Dieter Devlieghere */ class ServiceIntegratedPricingOptions extends Base { - const OVERRIDE_ACCOUNT_CODE = 'ACC'; - const OVERRIDE_PRICING_ALL_SERVICES = 'ALL'; - const OVERRIDE_AWARD = 'AWD'; - const OVERRIDE_CODE_SELECTION = 'COD'; - const OVERRIDE_CORPORATION_NUMBER = 'CRP'; - const OVERRIDE_PRICING_DATE = 'DAT'; - const OVERRIDE_CURRENCY = 'FCO'; - const OVERRIDE_INFANT_PROCESSING = 'INF'; - const OVERRIDE_JOURNEY_TURNAROUND_POINT = 'JTP'; - const OVERRIDE_NO_BREAK_POINT = 'NBP'; - const OVERRIDE_NO_JOURNEY_TURNAROUND_POINT = 'NJT'; - const OVERRIDE_NO_OPTION = 'NOP'; - const OVERRIDE_NON_TRUSTED_REQUEST = 'NTR'; - const OVERRIDE_ORIGIN_DESTINATION = 'OD'; - const OVERRIDE_PASSENGER_DISCOUNT_PTC = 'PAX'; - const OVERRIDE_POINT_OF_SALE = 'POS'; - const OVERRIDE_PTCONLY = 'PTC'; - const OVERRIDE_SHOW_COMMERCIAL_DESCRIPTION = 'SCD'; - const OVERRIDE_PAX_SEG_ELEMENT_SELECTION = 'SEL'; - const OVERRIDE_SHOW_PRICING_DESCRIPTION = 'SPD'; - const OVERRIDE_TICKET_DESIGNATOR = 'TKD'; - const OVERRIDE_VALIDATING_CARRIER = 'VC'; - const OVERRIDE_FORM_OF_PAYMENT = 'FOP'; - const OVERRIDE_FREQUENT_FLYER_INFORMATION = 'FTI'; - - const AWARDPRICING_MILES = 'MIL'; - const AWARDPRICING_POINTS = 'PTS'; - const AWARDPRICING_E_VOUCHER = 'EVO'; + const OVERRIDE_ACCOUNT_CODE = "ACC"; + const OVERRIDE_PRICING_ALL_SERVICES = "ALL"; + const OVERRIDE_AWARD = "AWD"; + const OVERRIDE_CODE_SELECTION = "COD"; + const OVERRIDE_CORPORATION_NUMBER = "CRP"; + const OVERRIDE_PRICING_DATE = "DAT"; + const OVERRIDE_CURRENCY = "FCO"; + const OVERRIDE_INFANT_PROCESSING = "INF"; + const OVERRIDE_JOURNEY_TURNAROUND_POINT = "JTP"; + const OVERRIDE_NO_BREAK_POINT = "NBP"; + const OVERRIDE_NO_JOURNEY_TURNAROUND_POINT = "NJT"; + const OVERRIDE_NO_OPTION = "NOP"; + const OVERRIDE_NON_TRUSTED_REQUEST = "NTR"; + const OVERRIDE_ORIGIN_DESTINATION = "OD"; + const OVERRIDE_PASSENGER_DISCOUNT_PTC = "PAX"; + const OVERRIDE_POINT_OF_SALE = "POS"; + const OVERRIDE_PTCONLY = "PTC"; + const OVERRIDE_SHOW_COMMERCIAL_DESCRIPTION = "SCD"; + const OVERRIDE_PAX_SEG_ELEMENT_SELECTION = "SEL"; + const OVERRIDE_SHOW_PRICING_DESCRIPTION = "SPD"; + const OVERRIDE_TICKET_DESIGNATOR = "TKD"; + const OVERRIDE_VALIDATING_CARRIER = "VC "; + const OVERRIDE_FORM_OF_PAYMENT = "FOP"; + const OVERRIDE_FREQUENT_FLYER_INFORMATION = "FTI"; + + const AWARDPRICING_MILES = "MIL"; + const AWARDPRICING_POINTS = "PTS"; + const AWARDPRICING_E_VOUCHER = "EVO"; + /** * self::OVERRIDE_* @@ -93,13 +94,6 @@ class ServiceIntegratedPricingOptions extends Base */ public $overrideOptions = []; - /** - * Provide a fare basis to price with - * - * @var pricingsFareBasis[] - */ - public $pricingsFareBasis = []; - /** * self::AWARDPRICING_* * From b486607eda2e611b3ce58483a224fe6f34afe649 Mon Sep 17 00:00:00 2001 From: "arvind.p" Date: Fri, 24 Aug 2018 12:23:10 +0530 Subject: [PATCH 33/67] changes --- .../ServiceIntegratedPricingOptions.php | 340 +++++++++--------- 1 file changed, 169 insertions(+), 171 deletions(-) diff --git a/src/Amadeus/Client/RequestOptions/ServiceIntegratedPricingOptions.php b/src/Amadeus/Client/RequestOptions/ServiceIntegratedPricingOptions.php index e678ae862..84d6ed248 100755 --- a/src/Amadeus/Client/RequestOptions/ServiceIntegratedPricingOptions.php +++ b/src/Amadeus/Client/RequestOptions/ServiceIntegratedPricingOptions.php @@ -1,171 +1,169 @@ - - */ -class ServiceIntegratedPricingOptions extends Base -{ - const OVERRIDE_ACCOUNT_CODE = "ACC"; - const OVERRIDE_PRICING_ALL_SERVICES = "ALL"; - const OVERRIDE_AWARD = "AWD"; - const OVERRIDE_CODE_SELECTION = "COD"; - const OVERRIDE_CORPORATION_NUMBER = "CRP"; - const OVERRIDE_PRICING_DATE = "DAT"; - const OVERRIDE_CURRENCY = "FCO"; - const OVERRIDE_INFANT_PROCESSING = "INF"; - const OVERRIDE_JOURNEY_TURNAROUND_POINT = "JTP"; - const OVERRIDE_NO_BREAK_POINT = "NBP"; - const OVERRIDE_NO_JOURNEY_TURNAROUND_POINT = "NJT"; - const OVERRIDE_NO_OPTION = "NOP"; - const OVERRIDE_NON_TRUSTED_REQUEST = "NTR"; - const OVERRIDE_ORIGIN_DESTINATION = "OD"; - const OVERRIDE_PASSENGER_DISCOUNT_PTC = "PAX"; - const OVERRIDE_POINT_OF_SALE = "POS"; - const OVERRIDE_PTCONLY = "PTC"; - const OVERRIDE_SHOW_COMMERCIAL_DESCRIPTION = "SCD"; - const OVERRIDE_PAX_SEG_ELEMENT_SELECTION = "SEL"; - const OVERRIDE_SHOW_PRICING_DESCRIPTION = "SPD"; - const OVERRIDE_TICKET_DESIGNATOR = "TKD"; - const OVERRIDE_VALIDATING_CARRIER = "VC "; - const OVERRIDE_FORM_OF_PAYMENT = "FOP"; - const OVERRIDE_FREQUENT_FLYER_INFORMATION = "FTI"; - - const AWARDPRICING_MILES = "MIL"; - const AWARDPRICING_POINTS = "PTS"; - const AWARDPRICING_E_VOUCHER = "EVO"; - - - /** - * self::OVERRIDE_* - * - * ACC Account Code - * ALL Pricing all services - * AWD Award - * COD Code selection - * CRP Corporation number - * DAT Pricing Date - * FCO Fare currency override - * INF Infant processing - * JTP Journey turnaround point - * NBP No break point - * NJT No journey turnaround point - * NOP No option - * NTR Non trusted request - * OD Origin and destination option - * PAX Passenger discount/PTC - * POS Point of sale - * PTC PTC only - * SCD Show commercial description - * SEL Passenger/Segment/Element selection - * SPD Show pricing description - * TKD Ticket designator - * VC Validating carrier - * - * @var string[] - */ - public $overrideOptions = []; - - /** - * self::AWARDPRICING_* - * - * @var string - */ - public $awardPricing; - - /** - * Specify the validating carrier - * - * @var string - */ - public $validatingCarrier; - - /** - * @var string - */ - public $accountCode; - - /** - * @var PaxSegRef[] - */ - public $accountCodeRefs; - - /** - * @var string - */ - public $corporationNumber; - - /** - * @var string - */ - public $ticketDesignator; - - /** - * This option allows you to override the currency of the office. - * - * @var string - */ - public $currencyOverride; - - /** - * Override the Point of Sale - * - * e.g. 'LON' for point of sale London - * - * @var string - */ - public $pointOfSaleOverride; - - /** - * Overrides the pricing date. - * - * @var \DateTime - */ - public $overrideDate; - - /** - * @var FormOfPayment[] - */ - public $formOfPayment = []; - - /** - * @var FrequentFlyer[] - */ - public $frequentFlyers = []; - - /** - * Passenger, Segment or TST references to partially price the PNR - * - * @var PaxSegRef[] - */ - public $references = []; -} - + + */ +class ServiceIntegratedPricingOptions extends Base +{ + const OVERRIDE_ACCOUNT_CODE = 'ACC'; + const OVERRIDE_PRICING_ALL_SERVICES = 'ALL'; + const OVERRIDE_AWARD = 'AWD'; + const OVERRIDE_CODE_SELECTION = 'COD'; + const OVERRIDE_CORPORATION_NUMBER = 'CRP'; + const OVERRIDE_PRICING_DATE = 'DAT'; + const OVERRIDE_CURRENCY = 'FCO'; + const OVERRIDE_INFANT_PROCESSING = 'INF'; + const OVERRIDE_JOURNEY_TURNAROUND_POINT = 'JTP'; + const OVERRIDE_NO_BREAK_POINT = 'NBP'; + const OVERRIDE_NO_JOURNEY_TURNAROUND_POINT = 'NJT'; + const OVERRIDE_NO_OPTION = 'NOP'; + const OVERRIDE_NON_TRUSTED_REQUEST = 'NTR'; + const OVERRIDE_ORIGIN_DESTINATION = 'OD'; + const OVERRIDE_PASSENGER_DISCOUNT_PTC = 'PAX'; + const OVERRIDE_POINT_OF_SALE = 'POS'; + const OVERRIDE_PTCONLY = 'PTC'; + const OVERRIDE_SHOW_COMMERCIAL_DESCRIPTION = 'SCD'; + const OVERRIDE_PAX_SEG_ELEMENT_SELECTION = 'SEL'; + const OVERRIDE_SHOW_PRICING_DESCRIPTION = 'SPD'; + const OVERRIDE_TICKET_DESIGNATOR = 'TKD'; + const OVERRIDE_VALIDATING_CARRIER = 'VC'; + const OVERRIDE_FORM_OF_PAYMENT = 'FOP'; + const OVERRIDE_FREQUENT_FLYER_INFORMATION = 'FTI'; + + const AWARDPRICING_MILES = 'MIL'; + const AWARDPRICING_POINTS = 'PTS'; + const AWARDPRICING_E_VOUCHER = 'EVO'; + + /** + * self::OVERRIDE_* + * + * ACC Account Code + * ALL Pricing all services + * AWD Award + * COD Code selection + * CRP Corporation number + * DAT Pricing Date + * FCO Fare currency override + * INF Infant processing + * JTP Journey turnaround point + * NBP No break point + * NJT No journey turnaround point + * NOP No option + * NTR Non trusted request + * OD Origin and destination option + * PAX Passenger discount/PTC + * POS Point of sale + * PTC PTC only + * SCD Show commercial description + * SEL Passenger/Segment/Element selection + * SPD Show pricing description + * TKD Ticket designator + * VC Validating carrier + * + * @var string[] + */ + public $overrideOptions = []; + + /** + * self::AWARDPRICING_* + * + * @var string + */ + public $awardPricing; + + /** + * Specify the validating carrier + * + * @var string + */ + public $validatingCarrier; + + /** + * @var string + */ + public $accountCode; + + /** + * @var PaxSegRef[] + */ + public $accountCodeRefs; + + /** + * @var string + */ + public $corporationNumber; + + /** + * @var string + */ + public $ticketDesignator; + + /** + * This option allows you to override the currency of the office. + * + * @var string + */ + public $currencyOverride; + + /** + * Override the Point of Sale + * + * e.g. 'LON' for point of sale London + * + * @var string + */ + public $pointOfSaleOverride; + + /** + * Overrides the pricing date. + * + * @var \DateTime + */ + public $overrideDate; + + /** + * @var FormOfPayment[] + */ + public $formOfPayment = []; + + /** + * @var FrequentFlyer[] + */ + public $frequentFlyers = []; + + /** + * Passenger, Segment or TST references to partially price the PNR + * + * @var PaxSegRef[] + */ + public $references = []; +} From 3416966bb6248ca2446cbb08adea04014f1df8f2 Mon Sep 17 00:00:00 2001 From: "arvind.p" Date: Fri, 24 Aug 2018 12:30:55 +0530 Subject: [PATCH 34/67] changes --- .../Client/RequestOptions/ServiceIntegratedCatalogueOptions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Amadeus/Client/RequestOptions/ServiceIntegratedCatalogueOptions.php b/src/Amadeus/Client/RequestOptions/ServiceIntegratedCatalogueOptions.php index 2e712effc..682504e4a 100644 --- a/src/Amadeus/Client/RequestOptions/ServiceIntegratedCatalogueOptions.php +++ b/src/Amadeus/Client/RequestOptions/ServiceIntegratedCatalogueOptions.php @@ -26,7 +26,7 @@ * Service_IntegratedCatalogue Request Options * * @package Amadeus\Client\RequestOptions - * @author Dieter Devlieghere + * @author Arvind Pandey */ class ServiceIntegratedCatalogueOptions extends ServiceIntegratedPricingOptions { From 691cfc588c80ae15a9c2b9d7afc11a017b59a092 Mon Sep 17 00:00:00 2001 From: "arvind.p" Date: Fri, 24 Aug 2018 12:37:47 +0530 Subject: [PATCH 35/67] changes --- .../ServiceIntegratedCatalogueOptions.php | 2 +- .../ServiceIntegratedPricingOptions.php | 338 +++++++++--------- 2 files changed, 170 insertions(+), 170 deletions(-) mode change 100755 => 100644 src/Amadeus/Client/RequestOptions/ServiceIntegratedPricingOptions.php diff --git a/src/Amadeus/Client/RequestOptions/ServiceIntegratedCatalogueOptions.php b/src/Amadeus/Client/RequestOptions/ServiceIntegratedCatalogueOptions.php index 682504e4a..2e712effc 100644 --- a/src/Amadeus/Client/RequestOptions/ServiceIntegratedCatalogueOptions.php +++ b/src/Amadeus/Client/RequestOptions/ServiceIntegratedCatalogueOptions.php @@ -26,7 +26,7 @@ * Service_IntegratedCatalogue Request Options * * @package Amadeus\Client\RequestOptions - * @author Arvind Pandey + * @author Dieter Devlieghere */ class ServiceIntegratedCatalogueOptions extends ServiceIntegratedPricingOptions { diff --git a/src/Amadeus/Client/RequestOptions/ServiceIntegratedPricingOptions.php b/src/Amadeus/Client/RequestOptions/ServiceIntegratedPricingOptions.php old mode 100755 new mode 100644 index 84d6ed248..97a4eb290 --- a/src/Amadeus/Client/RequestOptions/ServiceIntegratedPricingOptions.php +++ b/src/Amadeus/Client/RequestOptions/ServiceIntegratedPricingOptions.php @@ -1,169 +1,169 @@ - - */ -class ServiceIntegratedPricingOptions extends Base -{ - const OVERRIDE_ACCOUNT_CODE = 'ACC'; - const OVERRIDE_PRICING_ALL_SERVICES = 'ALL'; - const OVERRIDE_AWARD = 'AWD'; - const OVERRIDE_CODE_SELECTION = 'COD'; - const OVERRIDE_CORPORATION_NUMBER = 'CRP'; - const OVERRIDE_PRICING_DATE = 'DAT'; - const OVERRIDE_CURRENCY = 'FCO'; - const OVERRIDE_INFANT_PROCESSING = 'INF'; - const OVERRIDE_JOURNEY_TURNAROUND_POINT = 'JTP'; - const OVERRIDE_NO_BREAK_POINT = 'NBP'; - const OVERRIDE_NO_JOURNEY_TURNAROUND_POINT = 'NJT'; - const OVERRIDE_NO_OPTION = 'NOP'; - const OVERRIDE_NON_TRUSTED_REQUEST = 'NTR'; - const OVERRIDE_ORIGIN_DESTINATION = 'OD'; - const OVERRIDE_PASSENGER_DISCOUNT_PTC = 'PAX'; - const OVERRIDE_POINT_OF_SALE = 'POS'; - const OVERRIDE_PTCONLY = 'PTC'; - const OVERRIDE_SHOW_COMMERCIAL_DESCRIPTION = 'SCD'; - const OVERRIDE_PAX_SEG_ELEMENT_SELECTION = 'SEL'; - const OVERRIDE_SHOW_PRICING_DESCRIPTION = 'SPD'; - const OVERRIDE_TICKET_DESIGNATOR = 'TKD'; - const OVERRIDE_VALIDATING_CARRIER = 'VC'; - const OVERRIDE_FORM_OF_PAYMENT = 'FOP'; - const OVERRIDE_FREQUENT_FLYER_INFORMATION = 'FTI'; - - const AWARDPRICING_MILES = 'MIL'; - const AWARDPRICING_POINTS = 'PTS'; - const AWARDPRICING_E_VOUCHER = 'EVO'; - - /** - * self::OVERRIDE_* - * - * ACC Account Code - * ALL Pricing all services - * AWD Award - * COD Code selection - * CRP Corporation number - * DAT Pricing Date - * FCO Fare currency override - * INF Infant processing - * JTP Journey turnaround point - * NBP No break point - * NJT No journey turnaround point - * NOP No option - * NTR Non trusted request - * OD Origin and destination option - * PAX Passenger discount/PTC - * POS Point of sale - * PTC PTC only - * SCD Show commercial description - * SEL Passenger/Segment/Element selection - * SPD Show pricing description - * TKD Ticket designator - * VC Validating carrier - * - * @var string[] - */ - public $overrideOptions = []; - - /** - * self::AWARDPRICING_* - * - * @var string - */ - public $awardPricing; - - /** - * Specify the validating carrier - * - * @var string - */ - public $validatingCarrier; - - /** - * @var string - */ - public $accountCode; - - /** - * @var PaxSegRef[] - */ - public $accountCodeRefs; - - /** - * @var string - */ - public $corporationNumber; - - /** - * @var string - */ - public $ticketDesignator; - - /** - * This option allows you to override the currency of the office. - * - * @var string - */ - public $currencyOverride; - - /** - * Override the Point of Sale - * - * e.g. 'LON' for point of sale London - * - * @var string - */ - public $pointOfSaleOverride; - - /** - * Overrides the pricing date. - * - * @var \DateTime - */ - public $overrideDate; - - /** - * @var FormOfPayment[] - */ - public $formOfPayment = []; - - /** - * @var FrequentFlyer[] - */ - public $frequentFlyers = []; - - /** - * Passenger, Segment or TST references to partially price the PNR - * - * @var PaxSegRef[] - */ - public $references = []; -} + + */ +class ServiceIntegratedPricingOptions extends Base +{ + const OVERRIDE_ACCOUNT_CODE = 'ACC'; + const OVERRIDE_PRICING_ALL_SERVICES = 'ALL'; + const OVERRIDE_AWARD = 'AWD'; + const OVERRIDE_CODE_SELECTION = 'COD'; + const OVERRIDE_CORPORATION_NUMBER = 'CRP'; + const OVERRIDE_PRICING_DATE = 'DAT'; + const OVERRIDE_CURRENCY = 'FCO'; + const OVERRIDE_INFANT_PROCESSING = 'INF'; + const OVERRIDE_JOURNEY_TURNAROUND_POINT = 'JTP'; + const OVERRIDE_NO_BREAK_POINT = 'NBP'; + const OVERRIDE_NO_JOURNEY_TURNAROUND_POINT = 'NJT'; + const OVERRIDE_NO_OPTION = 'NOP'; + const OVERRIDE_NON_TRUSTED_REQUEST = 'NTR'; + const OVERRIDE_ORIGIN_DESTINATION = 'OD'; + const OVERRIDE_PASSENGER_DISCOUNT_PTC = 'PAX'; + const OVERRIDE_POINT_OF_SALE = 'POS'; + const OVERRIDE_PTCONLY = 'PTC'; + const OVERRIDE_SHOW_COMMERCIAL_DESCRIPTION = 'SCD'; + const OVERRIDE_PAX_SEG_ELEMENT_SELECTION = 'SEL'; + const OVERRIDE_SHOW_PRICING_DESCRIPTION = 'SPD'; + const OVERRIDE_TICKET_DESIGNATOR = 'TKD'; + const OVERRIDE_VALIDATING_CARRIER = 'VC'; + const OVERRIDE_FORM_OF_PAYMENT = 'FOP'; + const OVERRIDE_FREQUENT_FLYER_INFORMATION = 'FTI'; + + const AWARDPRICING_MILES = 'MIL'; + const AWARDPRICING_POINTS = 'PTS'; + const AWARDPRICING_E_VOUCHER = 'EVO'; + + /** + * self::OVERRIDE_* + * + * ACC Account Code + * ALL Pricing all services + * AWD Award + * COD Code selection + * CRP Corporation number + * DAT Pricing Date + * FCO Fare currency override + * INF Infant processing + * JTP Journey turnaround point + * NBP No break point + * NJT No journey turnaround point + * NOP No option + * NTR Non trusted request + * OD Origin and destination option + * PAX Passenger discount/PTC + * POS Point of sale + * PTC PTC only + * SCD Show commercial description + * SEL Passenger/Segment/Element selection + * SPD Show pricing description + * TKD Ticket designator + * VC Validating carrier + * + * @var string[] + */ + public $overrideOptions = []; + + /** + * self::AWARDPRICING_* + * + * @var string + */ + public $awardPricing; + + /** + * Specify the validating carrier + * + * @var string + */ + public $validatingCarrier; + + /** + * @var string + */ + public $accountCode; + + /** + * @var PaxSegRef[] + */ + public $accountCodeRefs; + + /** + * @var string + */ + public $corporationNumber; + + /** + * @var string + */ + public $ticketDesignator; + + /** + * This option allows you to override the currency of the office. + * + * @var string + */ + public $currencyOverride; + + /** + * Override the Point of Sale + * + * e.g. 'LON' for point of sale London + * + * @var string + */ + public $pointOfSaleOverride; + + /** + * Overrides the pricing date. + * + * @var \DateTime + */ + public $overrideDate; + + /** + * @var FormOfPayment[] + */ + public $formOfPayment = []; + + /** + * @var FrequentFlyer[] + */ + public $frequentFlyers = []; + + /** + * Passenger, Segment or TST references to partially price the PNR + * + * @var PaxSegRef[] + */ + public $references = []; +} From 03240f8eb114baf228b9f639f90cfe9d1928b02e Mon Sep 17 00:00:00 2001 From: "arvind.p" Date: Fri, 24 Aug 2018 12:50:16 +0530 Subject: [PATCH 36/67] changes --- src/Amadeus/Client/Struct/Service/IntegratedPricing.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) mode change 100755 => 100644 src/Amadeus/Client/Struct/Service/IntegratedPricing.php diff --git a/src/Amadeus/Client/Struct/Service/IntegratedPricing.php b/src/Amadeus/Client/Struct/Service/IntegratedPricing.php old mode 100755 new mode 100644 index 5afbf5744..e06524bc3 --- a/src/Amadeus/Client/Struct/Service/IntegratedPricing.php +++ b/src/Amadeus/Client/Struct/Service/IntegratedPricing.php @@ -55,7 +55,7 @@ class IntegratedPricing extends BasePricingMessage * @var PricingOption[] */ public $pricingOption = []; - + /** * IntegratedPricing constructor. * @@ -75,7 +75,7 @@ public function __construct($options = null) public static function loadPricingOptions($options) { $priceOptions = []; - + $priceOptions = self::mergeOptions( $priceOptions, self::makePricingOptionFareBasisOverride($options->pricingsFareBasis) From 30cf0ba7c63860e29b63fcf5c9837521777ed3a1 Mon Sep 17 00:00:00 2001 From: "arvind.p" Date: Fri, 24 Aug 2018 12:56:09 +0530 Subject: [PATCH 37/67] arvind --- .../Struct/Service/IntegratedPricing.php | 211 ++++++++---------- 1 file changed, 98 insertions(+), 113 deletions(-) diff --git a/src/Amadeus/Client/Struct/Service/IntegratedPricing.php b/src/Amadeus/Client/Struct/Service/IntegratedPricing.php index e06524bc3..9cc79a91e 100644 --- a/src/Amadeus/Client/Struct/Service/IntegratedPricing.php +++ b/src/Amadeus/Client/Struct/Service/IntegratedPricing.php @@ -25,9 +25,7 @@ use Amadeus\Client\RequestOptions\Fare\PricePnr\PaxSegRef; use Amadeus\Client\RequestOptions\Service\FormOfPayment; 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; @@ -37,7 +35,6 @@ 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; @@ -45,21 +42,19 @@ * Service_IntegratedPricing request structure * * @package Amadeus\Client\Struct\Service - * @author Dieter Devlieghere + * @author Dieter Devlieghere */ class IntegratedPricing extends BasePricingMessage { - /** - * * @var PricingOption[] */ public $pricingOption = []; - + /** * IntegratedPricing constructor. * - * @param ServiceIntegratedPricingOptions|ServiceIntegratedCatalogueOptions|null $options + * @param ServiceIntegratedPricingOptions|null $options */ public function __construct($options = null) { @@ -67,109 +62,99 @@ public function __construct($options = null) $this->pricingOption = $this->loadPricingOptions($options); } } - + /** - * @param ServiceIntegratedPricingOptions|ServiceIntegratedCatalogueOptions $options + * @param ServiceIntegratedPricingOptions $options * @return PricingOption[] */ - public static function loadPricingOptions($options) + protected function loadPricingOptions(ServiceIntegratedPricingOptions $options) { $priceOptions = []; - - $priceOptions = self::mergeOptions( - $priceOptions, - self::makePricingOptionFareBasisOverride($options->pricingsFareBasis) - ); $priceOptions = self::mergeOptions( $priceOptions, self::makePricingOptionForValidatingCarrier($options->validatingCarrier) - ); - + ); + $priceOptions = self::mergeOptions( $priceOptions, self::makePricingOptionForCurrencyOverride($options->currencyOverride) - ); - + ); + $priceOptions = self::mergeOptions( $priceOptions, self::makePricingOptionWithOptionDetailAndRefs( PricingOptionKey::OVERRIDE_ACCOUNT_CODE, $options->accountCode, $options->accountCodeRefs - ) - ); - + ) + ); + $priceOptions = self::mergeOptions( $priceOptions, self::makePricingOptionWithOptionDetailAndRefs( PricingOptionKey::OVERRIDE_AWARD, $options->awardPricing, [] - ) - ); - + ) + ); + $priceOptions = self::mergeOptions( $priceOptions, self::makePricingOptionWithOptionDetailAndRefs( PricingOptionKey::OVERRIDE_CORPORATION_NUMBER, $options->corporationNumber, [] - ) - ); - + ) + ); + $priceOptions = self::mergeOptions( $priceOptions, self::loadDateOverride($options->overrideDate) - ); - + ); + $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::loadPointOverrides($options->pointOfSaleOverride)); + $priceOptions = self::mergeOptions( + $priceOptions, + self::loadFormOfPaymentOverride($options->formOfPayment) + ); - $priceOptions = self::mergeOptions($priceOptions, self::loadFormOfPaymentOverride($options->formOfPayment)); + $priceOptions = self::mergeOptions( + $priceOptions, + self::loadFrequentFlyerOverride($options->frequentFlyers) + ); - $priceOptions = self::mergeOptions($priceOptions, self::loadFrequentFlyerOverride($options->frequentFlyers)); + $priceOptions = self::mergeOptions( + $priceOptions, + self::loadReferences($options->references) + ); - $priceOptions = self::mergeOptions($priceOptions, self::loadReferences($options->references)); + $priceOptions = self::mergeOptions( + $priceOptions, + self::makeOverrideOptions($options->overrideOptions, $priceOptions) + ); - $priceOptions = self::mergeOptions($priceOptions, self::makeOverrideOptions($options->overrideOptions, $priceOptions) - ); - // All options processed, no options found: if (empty($priceOptions)) { $priceOptions[] = new PricingOption(PricingOptionKey::OVERRIDE_NO_OPTION); } - - return $priceOptions; - } - - /** - * - * @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; + return $priceOptions; } - /** * @param string|null $validatingCarrier * @return PricingOption[] @@ -177,18 +162,18 @@ protected static function makePricingOptionFareBasisOverride($pricingsFareBasis) protected static function makePricingOptionForValidatingCarrier($validatingCarrier) { $opt = []; - + if ($validatingCarrier !== null) { $po = new PricingOption(PricingOptionKey::OVERRIDE_VALIDATING_CARRIER); - + $po->carrierInformation = new CarrierInformation($validatingCarrier); - + $opt[] = $po; } - + return $opt; } - + /** * @param string|null $currency * @return PricingOption[] @@ -196,43 +181,43 @@ protected static function makePricingOptionForValidatingCarrier($validatingCarri protected static function makePricingOptionForCurrencyOverride($currency) { $opt = []; - + if ($currency !== null) { $po = new PricingOption(PricingOptionKey::OVERRIDE_CURRENCY); - + $po->currency = new Currency($currency); - + $opt[] = $po; } - + return $opt; } - + /** * @param string $overrideCode * @param string|array|null $options * @param PaxSegRef[] $references * @return PricingOption[] */ - protected static function makePricingOptionWithOptionDetailAndRefs($overrideCode, $options, $references) + protected function makePricingOptionWithOptionDetailAndRefs($overrideCode, $options, $references) { $opt = []; - + if ($options !== null) { $po = new PricingOption($overrideCode); - + $po->optionDetail = new OptionDetail($options); - + if (!empty($references)) { $po->paxSegTstReference = new PaxSegTstReference($references); } - + $opt[] = $po; } - + return $opt; } - + /** * @param \DateTime|null $dateOverride * @return PricingOption[] @@ -240,21 +225,21 @@ protected static function makePricingOptionWithOptionDetailAndRefs($overrideCode protected static function loadDateOverride($dateOverride) { $opt = []; - + if ($dateOverride instanceof \DateTime) { $po = new PricingOption(PricingOptionKey::OVERRIDE_PRICING_DATE); - + $po->dateInformation = new DateInformation( DateInformation::OPT_DATE_OVERRIDE, $dateOverride - ); - + ); + $opt[] = $po; } - + return $opt; } - + /** * @param string|null $posOverride * @return PricingOption[] @@ -262,21 +247,21 @@ protected static function loadDateOverride($dateOverride) protected static function loadPointOverrides($posOverride) { $opt = []; - + if (!empty($posOverride)) { $po = new PricingOption(PricingOptionKey::OVERRIDE_POINT_OF_SALE); - + $po->locationInformation = new LocationInformation( LocationInformation::TYPE_POINT_OF_SALE, $posOverride - ); - + ); + $opt[] = $po; } - + return $opt; } - + /** * @param FormOfPayment[] $formOfPayment * @return PricingOption[] @@ -284,18 +269,18 @@ protected static function loadPointOverrides($posOverride) protected static function loadFormOfPaymentOverride($formOfPayment) { $opt = []; - + if (!empty($formOfPayment)) { $po = new PricingOption(PricingOptionKey::OVERRIDE_FORM_OF_PAYMENT); - + $po->formOfPaymentInformation = new FormOfPaymentInformation($formOfPayment); - + $opt[] = $po; } - + return $opt; } - + /** * @param FrequentFlyer[] $frequentFlyers * @return PricingOption[] @@ -303,18 +288,18 @@ protected static function loadFormOfPaymentOverride($formOfPayment) protected static function loadFrequentFlyerOverride($frequentFlyers) { $opt = []; - + if (!empty($frequentFlyers)) { $po = new PricingOption(PricingOptionKey::OVERRIDE_FREQUENT_FLYER_INFORMATION); - + $po->frequentFlyerInformation = new FrequentFlyerInformation($frequentFlyers); - + $opt[] = $po; } - + return $opt; } - + /** * @param PaxSegRef[] $references * @return PricingOption[] @@ -322,18 +307,18 @@ protected static function loadFrequentFlyerOverride($frequentFlyers) protected static function loadReferences($references) { $opt = []; - + if (!empty($references)) { $po = new PricingOption(PricingOptionKey::OVERRIDE_PAX_SEG_ELEMENT_SELECTION); - + $po->paxSegTstReference = new PaxSegTstReference($references); - + $opt[] = $po; } - + return $opt; } - + /** * @param string[] $overrideOptions * @param PricingOption[] $priceOptions @@ -342,16 +327,16 @@ protected static function loadReferences($references) protected static function makeOverrideOptions($overrideOptions, $priceOptions) { $opt = []; - + foreach ($overrideOptions as $overrideOption) { if (!self::hasPricingGroup($overrideOption, $priceOptions)) { $opt[] = new PricingOption($overrideOption); } } - + return $opt; } - + /** * Merges Pricing options * @@ -365,9 +350,9 @@ protected static function mergeOptions($existingOptions, $newOptions) $existingOptions = array_merge( $existingOptions, $newOptions - ); + ); } - + return $existingOptions; } } From e68a7d5679cf606fd985acd845f918e15d9174f2 Mon Sep 17 00:00:00 2001 From: "arvind.p" Date: Fri, 24 Aug 2018 13:09:04 +0530 Subject: [PATCH 38/67] arvind --- src/Amadeus/Client/Struct/Service/IntegratedPricing.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Amadeus/Client/Struct/Service/IntegratedPricing.php b/src/Amadeus/Client/Struct/Service/IntegratedPricing.php index 9cc79a91e..301693ef1 100644 --- a/src/Amadeus/Client/Struct/Service/IntegratedPricing.php +++ b/src/Amadeus/Client/Struct/Service/IntegratedPricing.php @@ -25,6 +25,7 @@ use Amadeus\Client\RequestOptions\Fare\PricePnr\PaxSegRef; use Amadeus\Client\RequestOptions\Service\FormOfPayment; use Amadeus\Client\RequestOptions\Service\FrequentFlyer; +use Amadeus\Client\RequestOptions\ServiceIntegratedCatalogueOptions; use Amadeus\Client\RequestOptions\ServiceIntegratedPricingOptions; use Amadeus\Client\Struct\Fare\BasePricingMessage; use Amadeus\Client\Struct\Fare\PricePnr13\CarrierInformation; @@ -42,7 +43,7 @@ * Service_IntegratedPricing request structure * * @package Amadeus\Client\Struct\Service - * @author Dieter Devlieghere + * @author Dieter Devlieghere */ class IntegratedPricing extends BasePricingMessage { @@ -54,7 +55,7 @@ class IntegratedPricing extends BasePricingMessage /** * IntegratedPricing constructor. * - * @param ServiceIntegratedPricingOptions|null $options + * @param ServiceIntegratedPricingOptions|ServiceIntegratedCatalogueOptions|null $options */ public function __construct($options = null) { @@ -64,10 +65,10 @@ public function __construct($options = null) } /** - * @param ServiceIntegratedPricingOptions $options + * @param ServiceIntegratedPricingOptions|ServiceIntegratedCatalogueOptions $options * @return PricingOption[] */ - protected function loadPricingOptions(ServiceIntegratedPricingOptions $options) + protected function loadPricingOptions($options) { $priceOptions = []; From f8a18ec7539cce4436fac54e22f3a48b5bbee8c6 Mon Sep 17 00:00:00 2001 From: "arvind.p" Date: Fri, 24 Aug 2018 13:13:10 +0530 Subject: [PATCH 39/67] arvind --- .../Struct/Service/IntegratedPricing.php | 179 ++++++++---------- 1 file changed, 82 insertions(+), 97 deletions(-) diff --git a/src/Amadeus/Client/Struct/Service/IntegratedPricing.php b/src/Amadeus/Client/Struct/Service/IntegratedPricing.php index 301693ef1..9499026c1 100644 --- 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. * @@ -63,99 +67,80 @@ public function __construct($options = null) $this->pricingOption = $this->loadPricingOptions($options); } } - + /** * @param ServiceIntegratedPricingOptions|ServiceIntegratedCatalogueOptions $options * @return PricingOption[] */ - protected function loadPricingOptions($options) + public static function loadPricingOptions($options) { $priceOptions = []; - + $priceOptions = self::mergeOptions( $priceOptions, self::makePricingOptionForValidatingCarrier($options->validatingCarrier) - ); - + ); + $priceOptions = self::mergeOptions( $priceOptions, self::makePricingOptionForCurrencyOverride($options->currencyOverride) - ); - + ); + $priceOptions = self::mergeOptions( $priceOptions, self::makePricingOptionWithOptionDetailAndRefs( PricingOptionKey::OVERRIDE_ACCOUNT_CODE, $options->accountCode, $options->accountCodeRefs - ) - ); - + ) + ); + $priceOptions = self::mergeOptions( $priceOptions, self::makePricingOptionWithOptionDetailAndRefs( PricingOptionKey::OVERRIDE_AWARD, $options->awardPricing, [] - ) - ); - + ) + ); + $priceOptions = self::mergeOptions( $priceOptions, self::makePricingOptionWithOptionDetailAndRefs( PricingOptionKey::OVERRIDE_CORPORATION_NUMBER, $options->corporationNumber, [] - ) - ); - + ) + ); + $priceOptions = self::mergeOptions( $priceOptions, self::loadDateOverride($options->overrideDate) - ); - + ); + $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::loadPointOverrides($options->pointOfSaleOverride)); - $priceOptions = self::mergeOptions( - $priceOptions, - self::loadFormOfPaymentOverride($options->formOfPayment) - ); - - $priceOptions = self::mergeOptions( - $priceOptions, - self::loadFrequentFlyerOverride($options->frequentFlyers) - ); + $priceOptions = self::mergeOptions($priceOptions, self::loadFormOfPaymentOverride($options->formOfPayment)); - $priceOptions = self::mergeOptions( - $priceOptions, - self::loadReferences($options->references) - ); + $priceOptions = self::mergeOptions($priceOptions, self::loadFrequentFlyerOverride($options->frequentFlyers)); - $priceOptions = self::mergeOptions( - $priceOptions, - self::makeOverrideOptions($options->overrideOptions, $priceOptions) - ); + $priceOptions = self::mergeOptions($priceOptions, self::loadReferences($options->references)); + $priceOptions = self::mergeOptions($priceOptions, self::makeOverrideOptions($options->overrideOptions, $priceOptions) + ); + // All options processed, no options found: if (empty($priceOptions)) { $priceOptions[] = new PricingOption(PricingOptionKey::OVERRIDE_NO_OPTION); } - + return $priceOptions; } - + /** * @param string|null $validatingCarrier * @return PricingOption[] @@ -163,18 +148,18 @@ protected function loadPricingOptions($options) protected static function makePricingOptionForValidatingCarrier($validatingCarrier) { $opt = []; - + if ($validatingCarrier !== null) { $po = new PricingOption(PricingOptionKey::OVERRIDE_VALIDATING_CARRIER); - + $po->carrierInformation = new CarrierInformation($validatingCarrier); - + $opt[] = $po; } - + return $opt; } - + /** * @param string|null $currency * @return PricingOption[] @@ -182,43 +167,43 @@ protected static function makePricingOptionForValidatingCarrier($validatingCarri protected static function makePricingOptionForCurrencyOverride($currency) { $opt = []; - + if ($currency !== null) { $po = new PricingOption(PricingOptionKey::OVERRIDE_CURRENCY); - + $po->currency = new Currency($currency); - + $opt[] = $po; } - + return $opt; } - + /** * @param string $overrideCode * @param string|array|null $options * @param PaxSegRef[] $references * @return PricingOption[] */ - protected function makePricingOptionWithOptionDetailAndRefs($overrideCode, $options, $references) + protected static function makePricingOptionWithOptionDetailAndRefs($overrideCode, $options, $references) { $opt = []; - + if ($options !== null) { $po = new PricingOption($overrideCode); - + $po->optionDetail = new OptionDetail($options); - + if (!empty($references)) { $po->paxSegTstReference = new PaxSegTstReference($references); } - + $opt[] = $po; } - + return $opt; } - + /** * @param \DateTime|null $dateOverride * @return PricingOption[] @@ -226,21 +211,21 @@ protected function makePricingOptionWithOptionDetailAndRefs($overrideCode, $opti protected static function loadDateOverride($dateOverride) { $opt = []; - + if ($dateOverride instanceof \DateTime) { $po = new PricingOption(PricingOptionKey::OVERRIDE_PRICING_DATE); - + $po->dateInformation = new DateInformation( DateInformation::OPT_DATE_OVERRIDE, $dateOverride - ); - + ); + $opt[] = $po; } - + return $opt; } - + /** * @param string|null $posOverride * @return PricingOption[] @@ -248,21 +233,21 @@ protected static function loadDateOverride($dateOverride) protected static function loadPointOverrides($posOverride) { $opt = []; - + if (!empty($posOverride)) { $po = new PricingOption(PricingOptionKey::OVERRIDE_POINT_OF_SALE); - + $po->locationInformation = new LocationInformation( LocationInformation::TYPE_POINT_OF_SALE, $posOverride - ); - + ); + $opt[] = $po; } - + return $opt; } - + /** * @param FormOfPayment[] $formOfPayment * @return PricingOption[] @@ -270,18 +255,18 @@ protected static function loadPointOverrides($posOverride) protected static function loadFormOfPaymentOverride($formOfPayment) { $opt = []; - + if (!empty($formOfPayment)) { $po = new PricingOption(PricingOptionKey::OVERRIDE_FORM_OF_PAYMENT); - + $po->formOfPaymentInformation = new FormOfPaymentInformation($formOfPayment); - + $opt[] = $po; } - + return $opt; } - + /** * @param FrequentFlyer[] $frequentFlyers * @return PricingOption[] @@ -289,18 +274,18 @@ protected static function loadFormOfPaymentOverride($formOfPayment) protected static function loadFrequentFlyerOverride($frequentFlyers) { $opt = []; - + if (!empty($frequentFlyers)) { $po = new PricingOption(PricingOptionKey::OVERRIDE_FREQUENT_FLYER_INFORMATION); - + $po->frequentFlyerInformation = new FrequentFlyerInformation($frequentFlyers); - + $opt[] = $po; } - + return $opt; } - + /** * @param PaxSegRef[] $references * @return PricingOption[] @@ -308,18 +293,18 @@ protected static function loadFrequentFlyerOverride($frequentFlyers) protected static function loadReferences($references) { $opt = []; - + if (!empty($references)) { $po = new PricingOption(PricingOptionKey::OVERRIDE_PAX_SEG_ELEMENT_SELECTION); - + $po->paxSegTstReference = new PaxSegTstReference($references); - + $opt[] = $po; } - + return $opt; } - + /** * @param string[] $overrideOptions * @param PricingOption[] $priceOptions @@ -328,16 +313,16 @@ protected static function loadReferences($references) protected static function makeOverrideOptions($overrideOptions, $priceOptions) { $opt = []; - + foreach ($overrideOptions as $overrideOption) { if (!self::hasPricingGroup($overrideOption, $priceOptions)) { $opt[] = new PricingOption($overrideOption); } } - + return $opt; } - + /** * Merges Pricing options * @@ -351,9 +336,9 @@ protected static function mergeOptions($existingOptions, $newOptions) $existingOptions = array_merge( $existingOptions, $newOptions - ); + ); } - + return $existingOptions; } } From c6b3a11f6a605da1ffec01aeefd19de7feed53ff Mon Sep 17 00:00:00 2001 From: "arvind.p" Date: Fri, 24 Aug 2018 13:24:37 +0530 Subject: [PATCH 40/67] arvind --- .../Struct/Service/IntegratedPricing.php | 179 ++++++++++-------- 1 file changed, 97 insertions(+), 82 deletions(-) diff --git a/src/Amadeus/Client/Struct/Service/IntegratedPricing.php b/src/Amadeus/Client/Struct/Service/IntegratedPricing.php index 9499026c1..301693ef1 100644 --- a/src/Amadeus/Client/Struct/Service/IntegratedPricing.php +++ b/src/Amadeus/Client/Struct/Service/IntegratedPricing.php @@ -27,7 +27,6 @@ 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; @@ -37,7 +36,6 @@ 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; @@ -49,13 +47,11 @@ */ class IntegratedPricing extends BasePricingMessage { - /** - * * @var PricingOption[] */ public $pricingOption = []; - + /** * IntegratedPricing constructor. * @@ -67,80 +63,99 @@ public function __construct($options = null) $this->pricingOption = $this->loadPricingOptions($options); } } - + /** * @param ServiceIntegratedPricingOptions|ServiceIntegratedCatalogueOptions $options * @return PricingOption[] */ - public static function loadPricingOptions($options) + protected function loadPricingOptions($options) { $priceOptions = []; - + $priceOptions = self::mergeOptions( $priceOptions, self::makePricingOptionForValidatingCarrier($options->validatingCarrier) - ); - + ); + $priceOptions = self::mergeOptions( $priceOptions, self::makePricingOptionForCurrencyOverride($options->currencyOverride) - ); - + ); + $priceOptions = self::mergeOptions( $priceOptions, self::makePricingOptionWithOptionDetailAndRefs( PricingOptionKey::OVERRIDE_ACCOUNT_CODE, $options->accountCode, $options->accountCodeRefs - ) - ); - + ) + ); + $priceOptions = self::mergeOptions( $priceOptions, self::makePricingOptionWithOptionDetailAndRefs( PricingOptionKey::OVERRIDE_AWARD, $options->awardPricing, [] - ) - ); - + ) + ); + $priceOptions = self::mergeOptions( $priceOptions, self::makePricingOptionWithOptionDetailAndRefs( PricingOptionKey::OVERRIDE_CORPORATION_NUMBER, $options->corporationNumber, [] - ) - ); - + ) + ); + $priceOptions = self::mergeOptions( $priceOptions, self::loadDateOverride($options->overrideDate) - ); - + ); + $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::loadPointOverrides($options->pointOfSaleOverride) + ); - $priceOptions = self::mergeOptions($priceOptions, self::loadFormOfPaymentOverride($options->formOfPayment)); + $priceOptions = self::mergeOptions( + $priceOptions, + self::loadFormOfPaymentOverride($options->formOfPayment) + ); + + $priceOptions = self::mergeOptions( + $priceOptions, + self::loadFrequentFlyerOverride($options->frequentFlyers) + ); - $priceOptions = self::mergeOptions($priceOptions, self::loadFrequentFlyerOverride($options->frequentFlyers)); + $priceOptions = self::mergeOptions( + $priceOptions, + self::loadReferences($options->references) + ); - $priceOptions = self::mergeOptions($priceOptions, self::loadReferences($options->references)); + $priceOptions = self::mergeOptions( + $priceOptions, + self::makeOverrideOptions($options->overrideOptions, $priceOptions) + ); - $priceOptions = self::mergeOptions($priceOptions, self::makeOverrideOptions($options->overrideOptions, $priceOptions) - ); - // All options processed, no options found: if (empty($priceOptions)) { $priceOptions[] = new PricingOption(PricingOptionKey::OVERRIDE_NO_OPTION); } - + return $priceOptions; } - + /** * @param string|null $validatingCarrier * @return PricingOption[] @@ -148,18 +163,18 @@ public static function loadPricingOptions($options) protected static function makePricingOptionForValidatingCarrier($validatingCarrier) { $opt = []; - + if ($validatingCarrier !== null) { $po = new PricingOption(PricingOptionKey::OVERRIDE_VALIDATING_CARRIER); - + $po->carrierInformation = new CarrierInformation($validatingCarrier); - + $opt[] = $po; } - + return $opt; } - + /** * @param string|null $currency * @return PricingOption[] @@ -167,43 +182,43 @@ protected static function makePricingOptionForValidatingCarrier($validatingCarri protected static function makePricingOptionForCurrencyOverride($currency) { $opt = []; - + if ($currency !== null) { $po = new PricingOption(PricingOptionKey::OVERRIDE_CURRENCY); - + $po->currency = new Currency($currency); - + $opt[] = $po; } - + return $opt; } - + /** * @param string $overrideCode * @param string|array|null $options * @param PaxSegRef[] $references * @return PricingOption[] */ - protected static function makePricingOptionWithOptionDetailAndRefs($overrideCode, $options, $references) + protected function makePricingOptionWithOptionDetailAndRefs($overrideCode, $options, $references) { $opt = []; - + if ($options !== null) { $po = new PricingOption($overrideCode); - + $po->optionDetail = new OptionDetail($options); - + if (!empty($references)) { $po->paxSegTstReference = new PaxSegTstReference($references); } - + $opt[] = $po; } - + return $opt; } - + /** * @param \DateTime|null $dateOverride * @return PricingOption[] @@ -211,21 +226,21 @@ protected static function makePricingOptionWithOptionDetailAndRefs($overrideCode protected static function loadDateOverride($dateOverride) { $opt = []; - + if ($dateOverride instanceof \DateTime) { $po = new PricingOption(PricingOptionKey::OVERRIDE_PRICING_DATE); - + $po->dateInformation = new DateInformation( DateInformation::OPT_DATE_OVERRIDE, $dateOverride - ); - + ); + $opt[] = $po; } - + return $opt; } - + /** * @param string|null $posOverride * @return PricingOption[] @@ -233,21 +248,21 @@ protected static function loadDateOverride($dateOverride) protected static function loadPointOverrides($posOverride) { $opt = []; - + if (!empty($posOverride)) { $po = new PricingOption(PricingOptionKey::OVERRIDE_POINT_OF_SALE); - + $po->locationInformation = new LocationInformation( LocationInformation::TYPE_POINT_OF_SALE, $posOverride - ); - + ); + $opt[] = $po; } - + return $opt; } - + /** * @param FormOfPayment[] $formOfPayment * @return PricingOption[] @@ -255,18 +270,18 @@ protected static function loadPointOverrides($posOverride) protected static function loadFormOfPaymentOverride($formOfPayment) { $opt = []; - + if (!empty($formOfPayment)) { $po = new PricingOption(PricingOptionKey::OVERRIDE_FORM_OF_PAYMENT); - + $po->formOfPaymentInformation = new FormOfPaymentInformation($formOfPayment); - + $opt[] = $po; } - + return $opt; } - + /** * @param FrequentFlyer[] $frequentFlyers * @return PricingOption[] @@ -274,18 +289,18 @@ protected static function loadFormOfPaymentOverride($formOfPayment) protected static function loadFrequentFlyerOverride($frequentFlyers) { $opt = []; - + if (!empty($frequentFlyers)) { $po = new PricingOption(PricingOptionKey::OVERRIDE_FREQUENT_FLYER_INFORMATION); - + $po->frequentFlyerInformation = new FrequentFlyerInformation($frequentFlyers); - + $opt[] = $po; } - + return $opt; } - + /** * @param PaxSegRef[] $references * @return PricingOption[] @@ -293,18 +308,18 @@ protected static function loadFrequentFlyerOverride($frequentFlyers) protected static function loadReferences($references) { $opt = []; - + if (!empty($references)) { $po = new PricingOption(PricingOptionKey::OVERRIDE_PAX_SEG_ELEMENT_SELECTION); - + $po->paxSegTstReference = new PaxSegTstReference($references); - + $opt[] = $po; } - + return $opt; } - + /** * @param string[] $overrideOptions * @param PricingOption[] $priceOptions @@ -313,16 +328,16 @@ protected static function loadReferences($references) protected static function makeOverrideOptions($overrideOptions, $priceOptions) { $opt = []; - + foreach ($overrideOptions as $overrideOption) { if (!self::hasPricingGroup($overrideOption, $priceOptions)) { $opt[] = new PricingOption($overrideOption); } } - + return $opt; } - + /** * Merges Pricing options * @@ -336,9 +351,9 @@ protected static function mergeOptions($existingOptions, $newOptions) $existingOptions = array_merge( $existingOptions, $newOptions - ); + ); } - + return $existingOptions; } } From 618216f6b1e6dbfb50d819077c9f3dca2f59fe30 Mon Sep 17 00:00:00 2001 From: "arvind.p" Date: Fri, 24 Aug 2018 13:33:24 +0530 Subject: [PATCH 41/67] changes --- .../Struct/Service/IntegratedPricing.php | 177 ++++++++---------- 1 file changed, 81 insertions(+), 96 deletions(-) diff --git a/src/Amadeus/Client/Struct/Service/IntegratedPricing.php b/src/Amadeus/Client/Struct/Service/IntegratedPricing.php index 301693ef1..09242e3c3 100644 --- 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. * @@ -63,7 +67,7 @@ public function __construct($options = null) $this->pricingOption = $this->loadPricingOptions($options); } } - + /** * @param ServiceIntegratedPricingOptions|ServiceIntegratedCatalogueOptions $options * @return PricingOption[] @@ -71,91 +75,72 @@ public function __construct($options = null) protected function loadPricingOptions($options) { $priceOptions = []; - + $priceOptions = self::mergeOptions( $priceOptions, self::makePricingOptionForValidatingCarrier($options->validatingCarrier) - ); - + ); + $priceOptions = self::mergeOptions( $priceOptions, self::makePricingOptionForCurrencyOverride($options->currencyOverride) - ); - + ); + $priceOptions = self::mergeOptions( $priceOptions, self::makePricingOptionWithOptionDetailAndRefs( PricingOptionKey::OVERRIDE_ACCOUNT_CODE, $options->accountCode, $options->accountCodeRefs - ) - ); - + ) + ); + $priceOptions = self::mergeOptions( $priceOptions, self::makePricingOptionWithOptionDetailAndRefs( PricingOptionKey::OVERRIDE_AWARD, $options->awardPricing, [] - ) - ); - + ) + ); + $priceOptions = self::mergeOptions( $priceOptions, self::makePricingOptionWithOptionDetailAndRefs( PricingOptionKey::OVERRIDE_CORPORATION_NUMBER, $options->corporationNumber, [] - ) - ); - + ) + ); + $priceOptions = self::mergeOptions( $priceOptions, self::loadDateOverride($options->overrideDate) - ); - + ); + $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::loadPointOverrides($options->pointOfSaleOverride)); - $priceOptions = self::mergeOptions( - $priceOptions, - self::loadFormOfPaymentOverride($options->formOfPayment) - ); - - $priceOptions = self::mergeOptions( - $priceOptions, - self::loadFrequentFlyerOverride($options->frequentFlyers) - ); + $priceOptions = self::mergeOptions($priceOptions, self::loadFormOfPaymentOverride($options->formOfPayment)); - $priceOptions = self::mergeOptions( - $priceOptions, - self::loadReferences($options->references) - ); + $priceOptions = self::mergeOptions($priceOptions, self::loadFrequentFlyerOverride($options->frequentFlyers)); - $priceOptions = self::mergeOptions( - $priceOptions, - self::makeOverrideOptions($options->overrideOptions, $priceOptions) - ); + $priceOptions = self::mergeOptions($priceOptions, self::loadReferences($options->references)); + $priceOptions = self::mergeOptions($priceOptions, self::makeOverrideOptions($options->overrideOptions, $priceOptions) + ); + // All options processed, no options found: if (empty($priceOptions)) { $priceOptions[] = new PricingOption(PricingOptionKey::OVERRIDE_NO_OPTION); } - + return $priceOptions; } - + /** * @param string|null $validatingCarrier * @return PricingOption[] @@ -163,18 +148,18 @@ protected function loadPricingOptions($options) protected static function makePricingOptionForValidatingCarrier($validatingCarrier) { $opt = []; - + if ($validatingCarrier !== null) { $po = new PricingOption(PricingOptionKey::OVERRIDE_VALIDATING_CARRIER); - + $po->carrierInformation = new CarrierInformation($validatingCarrier); - + $opt[] = $po; } - + return $opt; } - + /** * @param string|null $currency * @return PricingOption[] @@ -182,18 +167,18 @@ protected static function makePricingOptionForValidatingCarrier($validatingCarri protected static function makePricingOptionForCurrencyOverride($currency) { $opt = []; - + if ($currency !== null) { $po = new PricingOption(PricingOptionKey::OVERRIDE_CURRENCY); - + $po->currency = new Currency($currency); - + $opt[] = $po; } - + return $opt; } - + /** * @param string $overrideCode * @param string|array|null $options @@ -203,44 +188,44 @@ protected static function makePricingOptionForCurrencyOverride($currency) protected function makePricingOptionWithOptionDetailAndRefs($overrideCode, $options, $references) { $opt = []; - + if ($options !== null) { $po = new PricingOption($overrideCode); - + $po->optionDetail = new OptionDetail($options); - + if (!empty($references)) { $po->paxSegTstReference = new PaxSegTstReference($references); } - + $opt[] = $po; } - + return $opt; } - + /** * @param \DateTime|null $dateOverride * @return PricingOption[] */ - protected static function loadDateOverride($dateOverride) + protected function loadDateOverride($dateOverride) { $opt = []; - + if ($dateOverride instanceof \DateTime) { $po = new PricingOption(PricingOptionKey::OVERRIDE_PRICING_DATE); - + $po->dateInformation = new DateInformation( DateInformation::OPT_DATE_OVERRIDE, $dateOverride - ); - + ); + $opt[] = $po; } - + return $opt; } - + /** * @param string|null $posOverride * @return PricingOption[] @@ -248,21 +233,21 @@ protected static function loadDateOverride($dateOverride) protected static function loadPointOverrides($posOverride) { $opt = []; - + if (!empty($posOverride)) { $po = new PricingOption(PricingOptionKey::OVERRIDE_POINT_OF_SALE); - + $po->locationInformation = new LocationInformation( LocationInformation::TYPE_POINT_OF_SALE, $posOverride - ); - + ); + $opt[] = $po; } - + return $opt; } - + /** * @param FormOfPayment[] $formOfPayment * @return PricingOption[] @@ -270,18 +255,18 @@ protected static function loadPointOverrides($posOverride) protected static function loadFormOfPaymentOverride($formOfPayment) { $opt = []; - + if (!empty($formOfPayment)) { $po = new PricingOption(PricingOptionKey::OVERRIDE_FORM_OF_PAYMENT); - + $po->formOfPaymentInformation = new FormOfPaymentInformation($formOfPayment); - + $opt[] = $po; } - + return $opt; } - + /** * @param FrequentFlyer[] $frequentFlyers * @return PricingOption[] @@ -289,18 +274,18 @@ protected static function loadFormOfPaymentOverride($formOfPayment) protected static function loadFrequentFlyerOverride($frequentFlyers) { $opt = []; - + if (!empty($frequentFlyers)) { $po = new PricingOption(PricingOptionKey::OVERRIDE_FREQUENT_FLYER_INFORMATION); - + $po->frequentFlyerInformation = new FrequentFlyerInformation($frequentFlyers); - + $opt[] = $po; } - + return $opt; } - + /** * @param PaxSegRef[] $references * @return PricingOption[] @@ -308,18 +293,18 @@ protected static function loadFrequentFlyerOverride($frequentFlyers) protected static function loadReferences($references) { $opt = []; - + if (!empty($references)) { $po = new PricingOption(PricingOptionKey::OVERRIDE_PAX_SEG_ELEMENT_SELECTION); - + $po->paxSegTstReference = new PaxSegTstReference($references); - + $opt[] = $po; } - + return $opt; } - + /** * @param string[] $overrideOptions * @param PricingOption[] $priceOptions @@ -328,16 +313,16 @@ protected static function loadReferences($references) protected static function makeOverrideOptions($overrideOptions, $priceOptions) { $opt = []; - + foreach ($overrideOptions as $overrideOption) { if (!self::hasPricingGroup($overrideOption, $priceOptions)) { $opt[] = new PricingOption($overrideOption); } } - + return $opt; } - + /** * Merges Pricing options * @@ -351,9 +336,9 @@ protected static function mergeOptions($existingOptions, $newOptions) $existingOptions = array_merge( $existingOptions, $newOptions - ); + ); } - + return $existingOptions; } } From aa77b898d0c8b85623502a3b8754e512df7c2a05 Mon Sep 17 00:00:00 2001 From: "arvind.p" Date: Mon, 27 Aug 2018 11:27:28 +0530 Subject: [PATCH 42/67] changes --- .../Struct/Service/IntegratedPricing.php | 44 +++++++++++-------- 1 file changed, 26 insertions(+), 18 deletions(-) diff --git a/src/Amadeus/Client/Struct/Service/IntegratedPricing.php b/src/Amadeus/Client/Struct/Service/IntegratedPricing.php index 09242e3c3..64fbc2e10 100644 --- a/src/Amadeus/Client/Struct/Service/IntegratedPricing.php +++ b/src/Amadeus/Client/Struct/Service/IntegratedPricing.php @@ -27,7 +27,6 @@ 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; @@ -37,7 +36,6 @@ 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; @@ -49,9 +47,7 @@ */ class IntegratedPricing extends BasePricingMessage { - /** - * * @var PricingOption[] */ public $pricingOption = []; @@ -75,7 +71,6 @@ public function __construct($options = null) protected function loadPricingOptions($options) { $priceOptions = []; - $priceOptions = self::mergeOptions( $priceOptions, self::makePricingOptionForValidatingCarrier($options->validatingCarrier) @@ -120,19 +115,32 @@ protected function loadPricingOptions($options) $priceOptions = self::mergeOptions( $priceOptions, - 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) + 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) ); - // All options processed, no options found: if (empty($priceOptions)) { $priceOptions[] = new PricingOption(PricingOptionKey::OVERRIDE_NO_OPTION); @@ -208,7 +216,7 @@ protected function makePricingOptionWithOptionDetailAndRefs($overrideCode, $opti * @param \DateTime|null $dateOverride * @return PricingOption[] */ - protected function loadDateOverride($dateOverride) + protected static function loadDateOverride($dateOverride) { $opt = []; From 3911d21fc69e79f088e7ce9efbcd9e5f658f7446 Mon Sep 17 00:00:00 2001 From: "arvind.p" Date: Mon, 27 Aug 2018 11:37:56 +0530 Subject: [PATCH 43/67] changes --- src/Amadeus/Client/Struct/Service/IntegratedPricing.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Amadeus/Client/Struct/Service/IntegratedPricing.php b/src/Amadeus/Client/Struct/Service/IntegratedPricing.php index 64fbc2e10..6cf358697 100644 --- a/src/Amadeus/Client/Struct/Service/IntegratedPricing.php +++ b/src/Amadeus/Client/Struct/Service/IntegratedPricing.php @@ -71,6 +71,7 @@ public function __construct($options = null) protected function loadPricingOptions($options) { $priceOptions = []; + $priceOptions = self::mergeOptions( $priceOptions, self::makePricingOptionForValidatingCarrier($options->validatingCarrier) @@ -121,26 +122,32 @@ protected function loadPricingOptions($options) [] ) ); + $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) ); + // All options processed, no options found: if (empty($priceOptions)) { $priceOptions[] = new PricingOption(PricingOptionKey::OVERRIDE_NO_OPTION); From a2aa6168f6ebd4a0994d34a5a80fd801a0dd8cec Mon Sep 17 00:00:00 2001 From: "arvind.p" Date: Mon, 27 Aug 2018 11:44:36 +0530 Subject: [PATCH 44/67] changes --- src/Amadeus/Client/Struct/Service/IntegratedPricing.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Amadeus/Client/Struct/Service/IntegratedPricing.php b/src/Amadeus/Client/Struct/Service/IntegratedPricing.php index 6cf358697..532b19891 100644 --- a/src/Amadeus/Client/Struct/Service/IntegratedPricing.php +++ b/src/Amadeus/Client/Struct/Service/IntegratedPricing.php @@ -71,7 +71,7 @@ public function __construct($options = null) protected function loadPricingOptions($options) { $priceOptions = []; - + $priceOptions = self::mergeOptions( $priceOptions, self::makePricingOptionForValidatingCarrier($options->validatingCarrier) From 19453b76baf329d4171be9b10855f64918cc3d51 Mon Sep 17 00:00:00 2001 From: "arvind.p" Date: Mon, 27 Aug 2018 12:01:44 +0530 Subject: [PATCH 45/67] Style CI resolved --- .../StandaloneCatalogue/ServiceStandalonePricingOptions.php | 1 - .../Client/RequestOptions/ServiceStandaloneCatalogueOptions.php | 1 + src/Amadeus/Client/Struct/Service/StandaloneCatalogue.php | 2 -- 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Amadeus/Client/RequestOptions/Service/StandaloneCatalogue/ServiceStandalonePricingOptions.php b/src/Amadeus/Client/RequestOptions/Service/StandaloneCatalogue/ServiceStandalonePricingOptions.php index e209b8b22..2862765b2 100755 --- a/src/Amadeus/Client/RequestOptions/Service/StandaloneCatalogue/ServiceStandalonePricingOptions.php +++ b/src/Amadeus/Client/RequestOptions/Service/StandaloneCatalogue/ServiceStandalonePricingOptions.php @@ -31,7 +31,6 @@ */ class ServiceStandalonePricingOptions extends PricingOptions { - const OVERRIDE_MANUAL_INPUT_FORMATTED = 'MIF'; const OVERRIDE_COMMERCIAL_DESCRIPTION = 'SCD'; } diff --git a/src/Amadeus/Client/RequestOptions/ServiceStandaloneCatalogueOptions.php b/src/Amadeus/Client/RequestOptions/ServiceStandaloneCatalogueOptions.php index 224d2bb66..46b06ba1c 100755 --- a/src/Amadeus/Client/RequestOptions/ServiceStandaloneCatalogueOptions.php +++ b/src/Amadeus/Client/RequestOptions/ServiceStandaloneCatalogueOptions.php @@ -29,4 +29,5 @@ */ class ServiceStandaloneCatalogueOptions extends FareInformativePricingWithoutPnrOptions { + } diff --git a/src/Amadeus/Client/Struct/Service/StandaloneCatalogue.php b/src/Amadeus/Client/Struct/Service/StandaloneCatalogue.php index 29f5cb15b..294fa0d46 100755 --- a/src/Amadeus/Client/Struct/Service/StandaloneCatalogue.php +++ b/src/Amadeus/Client/Struct/Service/StandaloneCatalogue.php @@ -104,8 +104,6 @@ protected function loadflightDetails($segments) */ protected function loadPricingOptions($pricingOptions) { - $this->pricingOption = PricePNRWithBookingClass13::loadPricingOptionsFromRequestOptions($pricingOptions); - } } From 35c1ca60caabfd9eb1df09f1846854217e52a37d Mon Sep 17 00:00:00 2001 From: "arvind.p" Date: Mon, 27 Aug 2018 12:04:48 +0530 Subject: [PATCH 46/67] git style ci issue --- .../Client/RequestOptions/ServiceStandaloneCatalogueOptions.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Amadeus/Client/RequestOptions/ServiceStandaloneCatalogueOptions.php b/src/Amadeus/Client/RequestOptions/ServiceStandaloneCatalogueOptions.php index 46b06ba1c..224d2bb66 100755 --- a/src/Amadeus/Client/RequestOptions/ServiceStandaloneCatalogueOptions.php +++ b/src/Amadeus/Client/RequestOptions/ServiceStandaloneCatalogueOptions.php @@ -29,5 +29,4 @@ */ class ServiceStandaloneCatalogueOptions extends FareInformativePricingWithoutPnrOptions { - } From 9e517563e3f89146bc2aa9786f6a896a69eb0de6 Mon Sep 17 00:00:00 2001 From: "arvind.p" Date: Mon, 27 Aug 2018 12:08:59 +0530 Subject: [PATCH 47/67] git style ci issue --- .../Client/RequestOptions/ServiceStandaloneCatalogueOptions.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Amadeus/Client/RequestOptions/ServiceStandaloneCatalogueOptions.php b/src/Amadeus/Client/RequestOptions/ServiceStandaloneCatalogueOptions.php index 224d2bb66..89834302d 100755 --- a/src/Amadeus/Client/RequestOptions/ServiceStandaloneCatalogueOptions.php +++ b/src/Amadeus/Client/RequestOptions/ServiceStandaloneCatalogueOptions.php @@ -19,6 +19,7 @@ * @package Amadeus * @license https://opensource.org/licenses/Apache-2.0 Apache 2.0 */ + namespace Amadeus\Client\RequestOptions; /** From eac425c68c9a21d950c4e99a610f73c1c75bb227 Mon Sep 17 00:00:00 2001 From: "arvind.p" Date: Mon, 27 Aug 2018 12:21:11 +0530 Subject: [PATCH 48/67] git style ci issue --- .../Client/RequestOptions/ServiceStandaloneCatalogueOptions.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Amadeus/Client/RequestOptions/ServiceStandaloneCatalogueOptions.php b/src/Amadeus/Client/RequestOptions/ServiceStandaloneCatalogueOptions.php index 89834302d..098065807 100755 --- a/src/Amadeus/Client/RequestOptions/ServiceStandaloneCatalogueOptions.php +++ b/src/Amadeus/Client/RequestOptions/ServiceStandaloneCatalogueOptions.php @@ -30,4 +30,5 @@ */ class ServiceStandaloneCatalogueOptions extends FareInformativePricingWithoutPnrOptions { + } From eb391ef3f810d5e204a91fe01aa7a05b41051c6e Mon Sep 17 00:00:00 2001 From: "arvind.p" Date: Mon, 27 Aug 2018 12:23:36 +0530 Subject: [PATCH 49/67] git style ci issue --- .../Client/RequestOptions/ServiceStandaloneCatalogueOptions.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Amadeus/Client/RequestOptions/ServiceStandaloneCatalogueOptions.php b/src/Amadeus/Client/RequestOptions/ServiceStandaloneCatalogueOptions.php index 098065807..89834302d 100755 --- a/src/Amadeus/Client/RequestOptions/ServiceStandaloneCatalogueOptions.php +++ b/src/Amadeus/Client/RequestOptions/ServiceStandaloneCatalogueOptions.php @@ -30,5 +30,4 @@ */ class ServiceStandaloneCatalogueOptions extends FareInformativePricingWithoutPnrOptions { - } From dc9d03fc40a7869f3e021792b2f8cac2ef01380e Mon Sep 17 00:00:00 2001 From: "arvind.p" Date: Mon, 27 Aug 2018 12:25:09 +0530 Subject: [PATCH 50/67] git style ci issue --- .../Client/RequestOptions/ServiceStandaloneCatalogueOptions.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Amadeus/Client/RequestOptions/ServiceStandaloneCatalogueOptions.php b/src/Amadeus/Client/RequestOptions/ServiceStandaloneCatalogueOptions.php index 89834302d..50dae383b 100755 --- a/src/Amadeus/Client/RequestOptions/ServiceStandaloneCatalogueOptions.php +++ b/src/Amadeus/Client/RequestOptions/ServiceStandaloneCatalogueOptions.php @@ -30,4 +30,5 @@ */ class ServiceStandaloneCatalogueOptions extends FareInformativePricingWithoutPnrOptions { + } From 872e3da76269deceb5d7c174e1f99431bbe6fbb0 Mon Sep 17 00:00:00 2001 From: "arvind.p" Date: Mon, 27 Aug 2018 12:29:55 +0530 Subject: [PATCH 51/67] git style ci issue --- .../RequestOptions/ServiceStandaloneCatalogueOptions.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Amadeus/Client/RequestOptions/ServiceStandaloneCatalogueOptions.php b/src/Amadeus/Client/RequestOptions/ServiceStandaloneCatalogueOptions.php index 50dae383b..67d8cfdf1 100755 --- a/src/Amadeus/Client/RequestOptions/ServiceStandaloneCatalogueOptions.php +++ b/src/Amadeus/Client/RequestOptions/ServiceStandaloneCatalogueOptions.php @@ -23,12 +23,11 @@ namespace Amadeus\Client\RequestOptions; /** - * Service_StandaloneCatalogue Request Options + * ServiceStandaloneCatalogueOptions Request Options * * @package Amadeus\Client\RequestOptions * @author Arvind Pandey */ class ServiceStandaloneCatalogueOptions extends FareInformativePricingWithoutPnrOptions { - -} +} From c0c33b71e3fbe0b46e4c7887aa926fe8170b5038 Mon Sep 17 00:00:00 2001 From: "arvind.p" Date: Mon, 27 Aug 2018 13:01:58 +0530 Subject: [PATCH 52/67] changes in request option --- .../{Passenger.php => ServicePassenger.php} | 20 ++----------------- 1 file changed, 2 insertions(+), 18 deletions(-) rename src/Amadeus/Client/RequestOptions/Service/StandaloneCatalogue/{Passenger.php => ServicePassenger.php} (77%) diff --git a/src/Amadeus/Client/RequestOptions/Service/StandaloneCatalogue/Passenger.php b/src/Amadeus/Client/RequestOptions/Service/StandaloneCatalogue/ServicePassenger.php similarity index 77% rename from src/Amadeus/Client/RequestOptions/Service/StandaloneCatalogue/Passenger.php rename to src/Amadeus/Client/RequestOptions/Service/StandaloneCatalogue/ServicePassenger.php index cec6e55a8..3e0fd9e9f 100755 --- a/src/Amadeus/Client/RequestOptions/Service/StandaloneCatalogue/Passenger.php +++ b/src/Amadeus/Client/RequestOptions/Service/StandaloneCatalogue/ServicePassenger.php @@ -22,7 +22,7 @@ namespace Amadeus\Client\RequestOptions\Service\StandaloneCatalogue; -use Amadeus\Client\LoadParamsFromArray; +use Amadeus\Client\RequestOptions\Fare\InformativePricing\Passenger; /** * Passenger @@ -30,24 +30,8 @@ * @package Amadeus\Client\RequestOptions\Fare\InformativePricing * @author Arvind Pandey */ -class Passenger extends LoadParamsFromArray +class ServicePassenger extends Passenger { - 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 * From b8170284ecdbfc643ae512cf0332f23cc239abb2 Mon Sep 17 00:00:00 2001 From: arvind-pandey <40858867+arvind-pandey@users.noreply.github.com> Date: Mon, 27 Aug 2018 13:22:17 +0530 Subject: [PATCH 53/67] Update samples.rst --- docs/samples.rst | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/samples.rst b/docs/samples.rst index d01ff8703..c7cddd54e 100644 --- a/docs/samples.rst +++ b/docs/samples.rst @@ -3203,21 +3203,21 @@ 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\Service\StandaloneCatalogue\ServiceStandalonePricingOptions; + use Amadeus\Client\RequestOptions\Service\StandaloneCatalogue\ServicePassenger; + use Amadeus\Client\RequestOptions\Service\PaxSegRef; use Amadeus\Client\RequestOptions\Fare\PricePnr\FareBasis; - + $standaloneCatalogueResponse = $client->serviceStandaloneCatalogue( new ServiceStandaloneCatalogueOptions([ 'passengers' => [ - new servicePassenger([ - 'tattoos' => [1, 2], - 'type' => Passenger::TYPE_ADULT + new ServicePassenger([ + 'reference' => 1, + 'type' => ServicePassenger::TYPE_ADULT ]) ], 'segments' => [ - new serviceSegment([ + new fareSegment([ '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', @@ -3230,7 +3230,7 @@ Service_StandaloneCatalogue 'segmentTattoo' => 1 ]) ], - 'pricingOptions' => new ServiceIntegratedPricingOptions([ + 'pricingOptions' => new ServiceStandalonePricingOptions([ 'pricingsFareBasis' => [ new FareBasis([ 'fareBasisCode' => 'LOXOW', From 69437df6f087a23790517c97fe5e55a7c75dbdf2 Mon Sep 17 00:00:00 2001 From: "arvind.p" Date: Sat, 3 Nov 2018 15:18:36 +0530 Subject: [PATCH 54/67] change for coverage --- src/Amadeus/Client/Struct/Service/StandaloneCatalogue.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/Amadeus/Client/Struct/Service/StandaloneCatalogue.php b/src/Amadeus/Client/Struct/Service/StandaloneCatalogue.php index 294fa0d46..1de9deb8a 100755 --- a/src/Amadeus/Client/Struct/Service/StandaloneCatalogue.php +++ b/src/Amadeus/Client/Struct/Service/StandaloneCatalogue.php @@ -22,11 +22,6 @@ namespace Amadeus\Client\Struct\Service; use Amadeus\Client\Struct\BaseWsMessage; -use Amadeus\Client\RequestOptions\Service\StandaloneCatalogue\Passenger; -use Amadeus\Client\RequestOptions\Fare\InformativePricing\Segment; -use Amadeus\Client\RequestOptions\Service\StandaloneCatalogue\ServiceStandalonePricingOptions; -use Amadeus\Client\RequestOptions\ServiceIntegratedPricingOptions; -use Amadeus\Client\RequestOptions\ServiceStandaloneCatalogueOptions; use Amadeus\Client\Struct\Service\StandaloneCatalogue\PassengerInfoGroup; use Amadeus\Client\Struct\Service\StandaloneCatalogue\FlightInfo; use Amadeus\Client\Struct\Fare\PricePNRWithBookingClass13; From 911bd1405a6454653c5a929d23ecc1a88c8e5c76 Mon Sep 17 00:00:00 2001 From: "arvind.p" Date: Sat, 3 Nov 2018 15:49:29 +0530 Subject: [PATCH 55/67] conflict resolve --- src/Amadeus/Client.php | 40 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/src/Amadeus/Client.php b/src/Amadeus/Client.php index 86c32bd5c..979c4d397 100644 --- a/src/Amadeus/Client.php +++ b/src/Amadeus/Client.php @@ -1581,7 +1581,45 @@ public function serviceStandaloneCatalogue(RequestOptions\ServiceStandaloneCatal return $this->callMessage($msgName, $options, $messageOptions); } - + + /** + * SalesReports_DisplayorSummarizedReport + * + * @param RequestOptions\SalesReportsDisplayDailyOrSummarizedReportOptions $options + * @param array $messageOptions (OPTIONAL) + * @return Result + * @throws Client\InvalidMessageException + * @throws Client\RequestCreator\MessageVersionUnsupportedException + * @throws Exception + */ + public function salesReportsDisplayDailyOrSummarizedReport( + RequestOptions\SalesReportsDisplayDailyOrSummarizedReportOptions $options, + $messageOptions = [] + ) { + $msgName = 'SalesReports_DisplayDailyOrSummarizedReport'; + + return $this->callMessage($msgName, $options, $messageOptions); + } + + /** + * SalesReports_DisplayNetRemitReport + * + * @param RequestOptions\SalesReportsDisplayNetRemitReportOptions $options + * @param array $messageOptions (OPTIONAL) + * @return Result + * @throws Client\InvalidMessageException + * @throws Client\RequestCreator\MessageVersionUnsupportedException + * @throws Exception + */ + public function salesReportsDisplayNetRemitReport( + RequestOptions\SalesReportsDisplayNetRemitReportOptions $options, + $messageOptions = [] + ) { + $msgName = 'SalesReports_DisplayNetRemitReport'; + + return $this->callMessage($msgName, $options, $messageOptions); + } + /** * Call a message with the given parameters * From 611f0ad461dc5eb65cd64f5d4e873d604c7f2108 Mon Sep 17 00:00:00 2001 From: "arvind.p" Date: Sat, 3 Nov 2018 16:39:06 +0530 Subject: [PATCH 56/67] conflick resolved --- src/Amadeus/Client.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Amadeus/Client.php b/src/Amadeus/Client.php index 979c4d397..5eb21afde 100644 --- a/src/Amadeus/Client.php +++ b/src/Amadeus/Client.php @@ -1564,6 +1564,7 @@ public function serviceIntegratedCatalogue( return $this->callMessage($msgName, $options, $messageOptions); } + /** * Service_StandaloneCatalogue * From 01d531e71ae1238ff4a9759968bba3327032344d Mon Sep 17 00:00:00 2001 From: "arvind.p" Date: Sat, 3 Nov 2018 16:52:58 +0530 Subject: [PATCH 57/67] conflick resolved --- src/Amadeus/Client.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Amadeus/Client.php b/src/Amadeus/Client.php index 5eb21afde..40d29b18e 100644 --- a/src/Amadeus/Client.php +++ b/src/Amadeus/Client.php @@ -1564,8 +1564,7 @@ public function serviceIntegratedCatalogue( return $this->callMessage($msgName, $options, $messageOptions); } - - /** + /*** * Service_StandaloneCatalogue * * @param RequestOptions\ServiceStandaloneCatalogueOptions $options @@ -1582,7 +1581,6 @@ public function serviceStandaloneCatalogue(RequestOptions\ServiceStandaloneCatal return $this->callMessage($msgName, $options, $messageOptions); } - /** * SalesReports_DisplayorSummarizedReport * From 86e3cda8ac6b7a630f8a35603615313d1d20e30e Mon Sep 17 00:00:00 2001 From: "arvind.p" Date: Sat, 3 Nov 2018 17:36:52 +0530 Subject: [PATCH 58/67] conflick resolved --- src/Amadeus/Client.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Amadeus/Client.php b/src/Amadeus/Client.php index 40d29b18e..aee9cc067 100644 --- a/src/Amadeus/Client.php +++ b/src/Amadeus/Client.php @@ -1563,8 +1563,7 @@ public function serviceIntegratedCatalogue( return $this->callMessage($msgName, $options, $messageOptions); } - - /*** + /** * Service_StandaloneCatalogue * * @param RequestOptions\ServiceStandaloneCatalogueOptions $options @@ -1581,6 +1580,7 @@ public function serviceStandaloneCatalogue(RequestOptions\ServiceStandaloneCatal return $this->callMessage($msgName, $options, $messageOptions); } + /** * SalesReports_DisplayorSummarizedReport * From 5d4697cfc0892a2b4e704f1633f0bf27ac7cc742 Mon Sep 17 00:00:00 2001 From: "arvind.p" Date: Sat, 3 Nov 2018 17:39:44 +0530 Subject: [PATCH 59/67] conflick resolved --- src/Amadeus/Client.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Amadeus/Client.php b/src/Amadeus/Client.php index aee9cc067..979c4d397 100644 --- a/src/Amadeus/Client.php +++ b/src/Amadeus/Client.php @@ -1563,6 +1563,7 @@ public function serviceIntegratedCatalogue( return $this->callMessage($msgName, $options, $messageOptions); } + /** * Service_StandaloneCatalogue * From 8ea8f31f60d62342a3043dfb04fe6814312beaa4 Mon Sep 17 00:00:00 2001 From: "arvind.p" Date: Sat, 3 Nov 2018 17:44:07 +0530 Subject: [PATCH 60/67] conflick resolved --- src/Amadeus/Client.php | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/Amadeus/Client.php b/src/Amadeus/Client.php index 979c4d397..caa1d6f66 100644 --- a/src/Amadeus/Client.php +++ b/src/Amadeus/Client.php @@ -1564,24 +1564,6 @@ public function serviceIntegratedCatalogue( 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); - } - /** * SalesReports_DisplayorSummarizedReport * @@ -1620,6 +1602,24 @@ public function salesReportsDisplayNetRemitReport( 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 * From 3638560b90b3a675b6cf0a1a9de7f44c4f9a1d38 Mon Sep 17 00:00:00 2001 From: "arvind.p" Date: Sat, 3 Nov 2018 17:46:24 +0530 Subject: [PATCH 61/67] conflick resolved --- src/Amadeus/Client.php | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/src/Amadeus/Client.php b/src/Amadeus/Client.php index caa1d6f66..5eb21afde 100644 --- a/src/Amadeus/Client.php +++ b/src/Amadeus/Client.php @@ -1564,6 +1564,25 @@ public function serviceIntegratedCatalogue( 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); + } + /** * SalesReports_DisplayorSummarizedReport * @@ -1602,24 +1621,6 @@ public function salesReportsDisplayNetRemitReport( 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 * From 762658ee2af91c16268ccf9c5d63f8e4f044f584 Mon Sep 17 00:00:00 2001 From: "arvind.p" Date: Wed, 9 Jan 2019 11:27:28 +0530 Subject: [PATCH 62/67] change --- src/Amadeus/Client.php | 37 ++++++++++++++++++------------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/src/Amadeus/Client.php b/src/Amadeus/Client.php index 5eb21afde..caa1d6f66 100644 --- a/src/Amadeus/Client.php +++ b/src/Amadeus/Client.php @@ -1564,25 +1564,6 @@ public function serviceIntegratedCatalogue( 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); - } - /** * SalesReports_DisplayorSummarizedReport * @@ -1621,6 +1602,24 @@ public function salesReportsDisplayNetRemitReport( 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 * From 0989c12f2edf9ab037a61b965840d73b957475ce Mon Sep 17 00:00:00 2001 From: Artem Zakharchenko Date: Mon, 3 Jun 2019 14:08:36 +0300 Subject: [PATCH 63/67] Fix sample --- docs/samples.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/samples.rst b/docs/samples.rst index ed65580a1..ce6b21410 100644 --- a/docs/samples.rst +++ b/docs/samples.rst @@ -3272,6 +3272,7 @@ Service_StandaloneCatalogue .. code-block:: php + use Amadeus\Client\RequestOptions\Fare\InformativePricing\Segment; use Amadeus\Client\RequestOptions\ServiceStandaloneCatalogueOptions; use Amadeus\Client\RequestOptions\Service\StandaloneCatalogue\ServiceStandalonePricingOptions; use Amadeus\Client\RequestOptions\Service\StandaloneCatalogue\ServicePassenger; @@ -3287,7 +3288,7 @@ Service_StandaloneCatalogue ]) ], 'segments' => [ - new fareSegment([ + new Segment([ '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', @@ -3296,7 +3297,7 @@ Service_StandaloneCatalogue 'operatingCompany' => 'TU', 'flightNumber' => '814', 'bookingClass' => 'L', - 'flightIndicator' => 'L', + 'groupNumber' => 'L', 'segmentTattoo' => 1 ]) ], From dcdefcfe11b215a5dfb3d743717428ac48284b21 Mon Sep 17 00:00:00 2001 From: Artem Zakharchenko Date: Mon, 3 Jun 2019 14:35:50 +0300 Subject: [PATCH 64/67] Create response handler for Service_StandaloneCatalogue --- .../Service/HandlerStandaloneCatalogue.php | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 src/Amadeus/Client/ResponseHandler/Service/HandlerStandaloneCatalogue.php diff --git a/src/Amadeus/Client/ResponseHandler/Service/HandlerStandaloneCatalogue.php b/src/Amadeus/Client/ResponseHandler/Service/HandlerStandaloneCatalogue.php new file mode 100644 index 000000000..074bba3be --- /dev/null +++ b/src/Amadeus/Client/ResponseHandler/Service/HandlerStandaloneCatalogue.php @@ -0,0 +1,33 @@ + + */ +class HandlerStandaloneCatalogue extends HandlerIntegratedPricing +{ +} From 68d9f0d664a14bcd88acf674b1201a93e21505a2 Mon Sep 17 00:00:00 2001 From: Artem Zakharchenko Date: Mon, 3 Jun 2019 14:36:17 +0300 Subject: [PATCH 65/67] Add Client test of Service_StandaloneCatalogue --- tests/Amadeus/ClientTest.php | 149 ++++++++++++++++++ .../serviceStandaloneCatalogueReply.txt | 1 + 2 files changed, 150 insertions(+) create mode 100644 tests/Amadeus/testfiles/serviceStandaloneCatalogueReply.txt diff --git a/tests/Amadeus/ClientTest.php b/tests/Amadeus/ClientTest.php index ff5977d8e..2398b3c2a 100644 --- a/tests/Amadeus/ClientTest.php +++ b/tests/Amadeus/ClientTest.php @@ -4319,6 +4319,155 @@ public function testCanSendServiceIntegratedCatalogue() $this->assertEquals($messageResult, $response); } + public function testCanSendServiceStandaloneCatalogue() + { + $mockSessionHandler = $this->getMockBuilder('Amadeus\Client\Session\Handler\HandlerInterface')->getMock(); + + $mockedSendResult = new Client\Session\Handler\SendResult(); + $mockedSendResult->responseXml = $this->getTestFile('serviceStandaloneCatalogueReply.txt'); + + $messageResult = new Client\Result($mockedSendResult); + + $expectedMessageResult = new Client\Struct\Service\StandaloneCatalogue( + new Client\RequestOptions\ServiceStandaloneCatalogueOptions([ + 'passengers' => [ + new Client\RequestOptions\Service\StandaloneCatalogue\ServicePassenger([ + 'reference' => 1, + 'type' => Client\RequestOptions\Service\StandaloneCatalogue\ServicePassenger::TYPE_ADULT + ]) + ], + 'segments' => [ + new Client\RequestOptions\Fare\InformativePricing\Segment([ + 'departureDate' => \DateTime::createFromFormat('Y-m-d H:i:s', '2019-06-13 10:10:00'), + 'arrivalDate' => \DateTime::createFromFormat('Y-m-d H:i:s', '2019-06-13 13:40:00'), + 'from' => 'BOM', + 'to' => 'DXB', + 'marketingCompany' => 'EK', + 'operatingCompany' => 'EK', + 'flightNumber' => '505', + 'bookingClass' => 'K', + 'groupNumber' => 'V', + 'segmentTattoo' => 1 + ]), + new Client\RequestOptions\Fare\InformativePricing\Segment([ + 'departureDate' => \DateTime::createFromFormat('Y-m-d H:i:s', '2019-06-27 21:55:00'), + 'arrivalDate' => \DateTime::createFromFormat('Y-m-d H:i:s', '2019-06-28 02:30:00'), + 'from' => 'DXB', + 'to' => 'BOM', + 'marketingCompany' => 'EK', + 'operatingCompany' => 'EK', + 'flightNumber' => '500', + 'bookingClass' => 'B', + 'groupNumber' => 'V', + 'segmentTattoo' => 2 + ]) + ], + 'pricingOptions' => new Client\RequestOptions\Service\StandaloneCatalogue\ServiceStandalonePricingOptions([ + 'pricingsFareBasis' => [ + new Client\RequestOptions\Fare\PricePnr\FareBasis([ + 'fareBasisCode' => 'KEXESIN1', + ]) + ], + 'references' => [ + new Client\RequestOptions\Service\PaxSegRef([ + 'reference' => 1, + 'type' => 'S' + ]), + new Client\RequestOptions\Service\PaxSegRef([ + 'reference' => 2, + 'type' => 'S' + ]), + new Client\RequestOptions\Service\PaxSegRef([ + 'reference' => 1, + 'type' => 'P' + ]) + ] + ]) + ]) + ); + + $mockSessionHandler + ->expects($this->once()) + ->method('sendMessage') + ->with('Service_StandaloneCatalogue', $expectedMessageResult, ['endSession' => false, 'returnXml' => true]) + ->will($this->returnValue($mockedSendResult));; + $mockSessionHandler + ->expects($this->never()) + ->method('getLastResponse'); + $mockSessionHandler + ->expects($this->once()) + ->method('getMessagesAndVersions') + ->will($this->returnValue(['Service_StandaloneCatalogue' => ['version' => "14.2", 'wsdl' => 'dc22e4ee']])); + + $par = new Params(); + $par->sessionHandler = $mockSessionHandler; + $par->requestCreatorParams = new Params\RequestCreatorParams([ + 'receivedFrom' => 'some RF string', + 'originatorOfficeId' => 'BRUXXXXXX' + ]); + + $client = new Client($par); + + $response = $client->serviceStandaloneCatalogue( + new Client\RequestOptions\ServiceStandaloneCatalogueOptions([ + 'passengers' => [ + new Client\RequestOptions\Service\StandaloneCatalogue\ServicePassenger([ + 'reference' => 1, + 'type' => Client\RequestOptions\Service\StandaloneCatalogue\ServicePassenger::TYPE_ADULT + ]) + ], + 'segments' => [ + new Client\RequestOptions\Fare\InformativePricing\Segment([ + 'departureDate' => \DateTime::createFromFormat('Y-m-d H:i:s', '2019-06-13 10:10:00'), + 'arrivalDate' => \DateTime::createFromFormat('Y-m-d H:i:s', '2019-06-13 13:40:00'), + 'from' => 'BOM', + 'to' => 'DXB', + 'marketingCompany' => 'EK', + 'operatingCompany' => 'EK', + 'flightNumber' => '505', + 'bookingClass' => 'K', + 'groupNumber' => 'V', + 'segmentTattoo' => 1 + ]), + new Client\RequestOptions\Fare\InformativePricing\Segment([ + 'departureDate' => \DateTime::createFromFormat('Y-m-d H:i:s', '2019-06-27 21:55:00'), + 'arrivalDate' => \DateTime::createFromFormat('Y-m-d H:i:s', '2019-06-28 02:30:00'), + 'from' => 'DXB', + 'to' => 'BOM', + 'marketingCompany' => 'EK', + 'operatingCompany' => 'EK', + 'flightNumber' => '500', + 'bookingClass' => 'B', + 'groupNumber' => 'V', + 'segmentTattoo' => 2 + ]) + ], + 'pricingOptions' => new Client\RequestOptions\Service\StandaloneCatalogue\ServiceStandalonePricingOptions([ + 'pricingsFareBasis' => [ + new Client\RequestOptions\Fare\PricePnr\FareBasis([ + 'fareBasisCode' => 'KEXESIN1', + ]) + ], + 'references' => [ + new Client\RequestOptions\Service\PaxSegRef([ + 'reference' => 1, + 'type' => 'S' + ]), + new Client\RequestOptions\Service\PaxSegRef([ + 'reference' => 2, + 'type' => 'S' + ]), + new Client\RequestOptions\Service\PaxSegRef([ + 'reference' => 1, + 'type' => 'P' + ]) + ] + ]) + ]) + ); + + $this->assertEquals($messageResult, $response); + } public function testCanSendFopCreateFormOfPayment() { diff --git a/tests/Amadeus/testfiles/serviceStandaloneCatalogueReply.txt b/tests/Amadeus/testfiles/serviceStandaloneCatalogueReply.txt new file mode 100644 index 000000000..231211846 --- /dev/null +++ b/tests/Amadeus/testfiles/serviceStandaloneCatalogueReply.txt @@ -0,0 +1 @@ +http://www.w3.org/2005/08/addressing/anonymoushttps://nodeD2.test.webservices.amadeus.com/1ASIWBDEBANhttp://webservices.amadeus.com/TPSCGQ_16_1_1Aurn:uuid:63ec1338-4c26-34f4-69f0-8584ab2e9aacBB731611-6CAC-BF30-7B6D-73038E40C2BE009VDHD49J12GYT9CJZ5NG733KM9YDMRFAFOAIAT300519ADT113061910101306191340BOMDXBEKEK505KV1Y77W27061921552806190230DXBBOMEKEK500BV2Y388BTU1S1BTU2S21SRS12P1E0BXF1EKLGCNMLOUNGEEMD2ARANBRANCOMNEMDYIINTNNISRORNEKT38.70JODB38.70JODTX0.00JODP1AEDFEE31ME19.35JODMA100AEDS12ME19.35JODMA100AEDS22SRS12P1G01ZF1EKMLCA1ACNMCAKEEMD2BKM04ARANBRANCOMNEMDYIINTNNISRORNEKT38.70JODB38.70JODTX0.00JODP1AEDFEE41ME19.35JODMA100AEDS12ME19.35JODMA100AEDS23SRS12P1A0B5NSSTF1EKSACNMPRE RESERVED SEAT ASSIGNMENTEMD2BKM01ARANBRAYCOMNEMDYIINTNISSRORNEKT0.00JODB0.00JODTX0.00JODP1FEE01ME0.00JODMA0.00JODS12ME0.00JODMA0.00JODS24SRS12P1A0B5NSSTF1EKSACCCNMPRE RESERVED SEAT ASSIGNMENTEMD2BKM01ARANBRAYCOMNEMDYIINTNISC ISSRORNEKT46.80JODB44.50JODTX2.30JODP1USDFEE41ME23.40JODMA33.00USDS12ME23.40JODMA33.00USDS25SRS12P1A0B5NSSTF1EKSAECNMPRE RESERVED SEAT ASSIGNMENTEMD2BKM01ARANBRAYCOMNEMDYIINTNISC ISSRORNEKT46.80JODB44.50JODTX2.30JODP1USDFEE41ME23.40JODMA33.00USDS12ME23.40JODMA33.00USDS26SRS12P1A0B5NSSTF1EKSAOCNMPRE RESERVED SEAT ASSIGNMENTEMD2BKM01ARANBRAYCOMNEMDYIINTNISC ISSRORNEKT19.90JODB18.90JODTX1.00JODP1USDFEE41ME9.95JODMA14.00USDS12ME9.95JODMA14.00USDS27SRS12P1A0B5NSSTF1EKSATCNMPRE RESERVED SEAT ASSIGNMENTEMD2BKM01ARANBRAYCOMNEMDYIINTNISC ISSRORNEKT31.20JODB29.70JODTX1.50JODP1USDFEE41ME15.60JODMA22.00USDS12ME15.60JODMA22.00USDS28SRS12P1A0B5NSSTF1EKSAWACNMPRE RESERVED SEAT ASSIGNMENTEMD2BKM01ARANBRAYCOMNEMDYIINTNISC ISSRORNEKT46.80JODB44.50JODTX2.30JODP1USDFEE41ME23.40JODMA33.00USDS12ME23.40JODMA33.00USDS29FBABTU1P10DFA1EKBGCNM FREE BAGGAGE ALLOWANCEEMD4ARANBRANCOMNEMDNIINTYISSRORNWK030S1EKFEE010FBABTU2P10DFA1EKBGCNM FREE BAGGAGE ALLOWANCEEMD4ARANBRANCOMNEMDNIINTYISSRORNWK030S2EKFEE011COAS1P1C0LNB1EKBGCYCNM CARRYON HAND BAGGAGE ALLOWANCEEMD4ARANBRANCOMNEMDNIINTYISSRORN1PCPEKFEE012CODS1P10M3C1EKBGCY074UCNM HAND LUGGAGE UPTO 7KGEMD4ARANBRANCOMNDEMDNFOR1INTYISSRORY1NBAPEK13COAS2P1C0LNB1EKBGCYCNM CARRYON HAND BAGGAGE ALLOWANCEEMD4ARANBRANCOMNEMDNIINTYISSRORN1PCPEKFEE014CODS2P10M3C1EKBGCY074UCNM HAND LUGGAGE UPTO 7KGEMD4ARANBRANCOMNDEMDNFOR1INTYISSRORY1NBAPEK From 7950fabceacd923a38919a5a9ca9440f0e2c50f8 Mon Sep 17 00:00:00 2001 From: Artem Zakharchenko Date: Mon, 3 Jun 2019 15:07:34 +0300 Subject: [PATCH 66/67] Refactor doc blocks --- .../Client/Struct/Service/StandaloneCatalogue.php | 14 +++++++++----- .../Service/StandaloneCatalogue/FlightInfo.php | 4 ++-- .../StandaloneCatalogue/PassengerInfoGroup.php | 2 +- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/Amadeus/Client/Struct/Service/StandaloneCatalogue.php b/src/Amadeus/Client/Struct/Service/StandaloneCatalogue.php index 1de9deb8a..4324226d3 100755 --- a/src/Amadeus/Client/Struct/Service/StandaloneCatalogue.php +++ b/src/Amadeus/Client/Struct/Service/StandaloneCatalogue.php @@ -21,6 +21,10 @@ */ namespace Amadeus\Client\Struct\Service; +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\ServiceStandaloneCatalogueOptions; use Amadeus\Client\Struct\BaseWsMessage; use Amadeus\Client\Struct\Service\StandaloneCatalogue\PassengerInfoGroup; use Amadeus\Client\Struct\Service\StandaloneCatalogue\FlightInfo; @@ -37,19 +41,19 @@ class StandaloneCatalogue extends BaseWsMessage /** * - * @var passengerInfoGroup[] + * @var PassengerInfoGroup[] */ public $passengerInfoGroup = []; /** * - * @var flightInfo[] + * @var FlightInfo[] */ public $flightInfo = []; /** * - * @var pricingOption[] + * @var PricingOptions[] */ public $pricingOption = []; @@ -63,7 +67,7 @@ public function __construct($options) if (! is_null($options)) { $this->loadPassengers($options->passengers); - $this->loadflightDetails($options->segments); + $this->loadFlightDetails($options->segments); $this->loadPricingOptions($options->pricingOptions); } @@ -86,7 +90,7 @@ protected function loadPassengers($passengers) * * @param Segment[] $segments */ - protected function loadflightDetails($segments) + protected function loadFlightDetails($segments) { foreach ($segments as $segment) { $this->flightInfo[] = new FlightInfo($segment); diff --git a/src/Amadeus/Client/Struct/Service/StandaloneCatalogue/FlightInfo.php b/src/Amadeus/Client/Struct/Service/StandaloneCatalogue/FlightInfo.php index 9a4b13209..c44b9fed5 100755 --- a/src/Amadeus/Client/Struct/Service/StandaloneCatalogue/FlightInfo.php +++ b/src/Amadeus/Client/Struct/Service/StandaloneCatalogue/FlightInfo.php @@ -36,14 +36,14 @@ class FlightInfo extends SegmentGroup { /** - * @var flightDetails + * @var SegmentInformation */ public $flightDetails; /** * FlightInfo constructor. * - * @param FlightInfo $options + * @param Segment $options */ public function __construct($options) { diff --git a/src/Amadeus/Client/Struct/Service/StandaloneCatalogue/PassengerInfoGroup.php b/src/Amadeus/Client/Struct/Service/StandaloneCatalogue/PassengerInfoGroup.php index aa2ff4f4b..ed116a50e 100755 --- a/src/Amadeus/Client/Struct/Service/StandaloneCatalogue/PassengerInfoGroup.php +++ b/src/Amadeus/Client/Struct/Service/StandaloneCatalogue/PassengerInfoGroup.php @@ -22,7 +22,7 @@ namespace Amadeus\Client\Struct\Service\StandaloneCatalogue; -use Amadeus\Client\Struct\Service\StandaloneCatalogue\Passenger; +use Amadeus\Client\RequestOptions\Fare\InformativePricing\Passenger; /** * PassengersGroup From 6b35d3f0e16d3b46d2d55899d9418370da92e72d Mon Sep 17 00:00:00 2001 From: Artem Zakharchenko Date: Mon, 3 Jun 2019 15:08:10 +0300 Subject: [PATCH 67/67] Added struct test --- .../Service/StandaloneCatalogueTest.php | 145 ++++++++++++++++++ 1 file changed, 145 insertions(+) create mode 100644 tests/Amadeus/Client/Struct/Service/StandaloneCatalogueTest.php diff --git a/tests/Amadeus/Client/Struct/Service/StandaloneCatalogueTest.php b/tests/Amadeus/Client/Struct/Service/StandaloneCatalogueTest.php new file mode 100644 index 000000000..ce7163930 --- /dev/null +++ b/tests/Amadeus/Client/Struct/Service/StandaloneCatalogueTest.php @@ -0,0 +1,145 @@ + + */ +class StandaloneCatalogueTest extends BaseTestCase +{ + public function testCanMakeMessage() + { + $opt = new ServiceStandaloneCatalogueOptions([ + 'passengers' => [ + new ServicePassenger([ + 'reference' => 1, + 'type' => ServicePassenger::TYPE_ADULT + ]) + ], + 'segments' => [ + new Segment([ + 'departureDate' => \DateTime::createFromFormat('Y-m-d H:i:s', '2019-06-13 10:10:00'), + 'arrivalDate' => \DateTime::createFromFormat('Y-m-d H:i:s', '2019-06-13 13:40:00'), + 'from' => 'BOM', + 'to' => 'DXB', + 'marketingCompany' => 'EK', + 'operatingCompany' => 'EK', + 'flightNumber' => '505', + 'bookingClass' => 'K', + 'groupNumber' => 'V', + 'segmentTattoo' => 1 + ]), + new Segment([ + 'departureDate' => \DateTime::createFromFormat('Y-m-d H:i:s', '2019-06-27 21:55:00'), + 'arrivalDate' => \DateTime::createFromFormat('Y-m-d H:i:s', '2019-06-28 02:30:00'), + 'from' => 'DXB', + 'to' => 'BOM', + 'marketingCompany' => 'EK', + 'operatingCompany' => 'EK', + 'flightNumber' => '500', + 'bookingClass' => 'B', + 'groupNumber' => 'V', + 'segmentTattoo' => 2 + ]) + ], + 'pricingOptions' => new ServiceStandalonePricingOptions([ + 'pricingsFareBasis' => [ + new FareBasis([ + 'fareBasisCode' => 'KEXESIN1', + ]) + ], + 'references' => [ + new PaxSegRef([ + 'reference' => 1, + 'type' => 'S' + ]), + new PaxSegRef([ + 'reference' => 2, + 'type' => 'S' + ]), + new PaxSegRef([ + 'reference' => 1, + 'type' => 'P' + ]) + ] + ]) + ]); + + $msg = new StandaloneCatalogue($opt); + + $this->assertEquals(1, $msg->passengerInfoGroup[0]->specificTravellerDetails->travellerDetails->referenceNumber); + $this->assertEquals('ADT', $msg->passengerInfoGroup[0]->fareInfo->valueQualifier); + + $this->assertCount(2, $msg->flightInfo); + $this->assertEquals(1, $msg->flightInfo[0]->flightDetails->itemNumber); + $this->assertEquals('130619', $msg->flightInfo[0]->flightDetails->flightDate->departureDate); + $this->assertEquals('1010', $msg->flightInfo[0]->flightDetails->flightDate->departureTime); + $this->assertEquals('130619', $msg->flightInfo[0]->flightDetails->flightDate->arrivalDate); + $this->assertEquals('1340', $msg->flightInfo[0]->flightDetails->flightDate->arrivalTime); + $this->assertEquals('BOM', $msg->flightInfo[0]->flightDetails->boardPointDetails->trueLocationId); + $this->assertEquals('DXB', $msg->flightInfo[0]->flightDetails->offpointDetails->trueLocationId); + $this->assertEquals('EK', $msg->flightInfo[0]->flightDetails->companyDetails->marketingCompany); + $this->assertEquals('EK', $msg->flightInfo[0]->flightDetails->companyDetails->operatingCompany); + $this->assertEquals('505', $msg->flightInfo[0]->flightDetails->flightIdentification->flightNumber); + $this->assertEquals('K', $msg->flightInfo[0]->flightDetails->flightIdentification->bookingClass); + $this->assertEquals('V', $msg->flightInfo[0]->flightDetails->flightTypeDetails->flightIndicator[0]); + $this->assertEquals(2, $msg->flightInfo[1]->flightDetails->itemNumber); + $this->assertEquals('270619', $msg->flightInfo[1]->flightDetails->flightDate->departureDate); + $this->assertEquals('2155', $msg->flightInfo[1]->flightDetails->flightDate->departureTime); + $this->assertEquals('280619', $msg->flightInfo[1]->flightDetails->flightDate->arrivalDate); + $this->assertEquals('0230', $msg->flightInfo[1]->flightDetails->flightDate->arrivalTime); + $this->assertEquals('DXB', $msg->flightInfo[1]->flightDetails->boardPointDetails->trueLocationId); + $this->assertEquals('BOM', $msg->flightInfo[1]->flightDetails->offpointDetails->trueLocationId); + $this->assertEquals('EK', $msg->flightInfo[1]->flightDetails->companyDetails->marketingCompany); + $this->assertEquals('EK', $msg->flightInfo[1]->flightDetails->companyDetails->operatingCompany); + $this->assertEquals('500', $msg->flightInfo[1]->flightDetails->flightIdentification->flightNumber); + $this->assertEquals('B', $msg->flightInfo[1]->flightDetails->flightIdentification->bookingClass); + $this->assertEquals('V', $msg->flightInfo[1]->flightDetails->flightTypeDetails->flightIndicator[0]); + + $this->assertEquals('FBA', $msg->pricingOption[0]->pricingOptionKey->pricingOptionKey); + $this->assertEquals('KEXESIN1', $msg->pricingOption[0]->optionDetail->criteriaDetails[0]->attributeType); + $this->assertEmpty($msg->pricingOption[0]->paxSegTstReference->referenceDetails); + + $this->assertEquals('SEL', $msg->pricingOption[1]->pricingOptionKey->pricingOptionKey); + $this->assertNull($msg->pricingOption[1]->optionDetail); + $this->assertCount(3, $msg->pricingOption[1]->paxSegTstReference->referenceDetails); + $this->assertEquals('S', $msg->pricingOption[1]->paxSegTstReference->referenceDetails[0]->type); + $this->assertEquals(1, $msg->pricingOption[1]->paxSegTstReference->referenceDetails[0]->value); + $this->assertEquals('S', $msg->pricingOption[1]->paxSegTstReference->referenceDetails[1]->type); + $this->assertEquals(2, $msg->pricingOption[1]->paxSegTstReference->referenceDetails[1]->value); + $this->assertEquals('P', $msg->pricingOption[1]->paxSegTstReference->referenceDetails[2]->type); + $this->assertEquals(1, $msg->pricingOption[1]->paxSegTstReference->referenceDetails[2]->value); + } +}