diff --git a/docs/list-of-supported-messages.rst b/docs/list-of-supported-messages.rst index 7ab835460..96411a624 100644 --- a/docs/list-of-supported-messages.rst +++ b/docs/list-of-supported-messages.rst @@ -66,6 +66,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 @@ -106,7 +107,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 `_) diff --git a/docs/samples.rst b/docs/samples.rst index a7d88811b..ce6b21410 100644 --- a/docs/samples.rst +++ b/docs/samples.rst @@ -3265,6 +3265,61 @@ All the examples for ``Service_IntegratedPricing`` (see above) should also work ] ]) ); + +--------------------------- +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; + use Amadeus\Client\RequestOptions\Service\PaxSegRef; + use Amadeus\Client\RequestOptions\Fare\PricePnr\FareBasis; + + $standaloneCatalogueResponse = $client->serviceStandaloneCatalogue( + new ServiceStandaloneCatalogueOptions([ + 'passengers' => [ + new ServicePassenger([ + 'reference' => 1, + 'type' => ServicePassenger::TYPE_ADULT + ]) + ], + 'segments' => [ + 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', + 'to' => 'TUN', + 'marketingCompany' => 'TU', + 'operatingCompany' => 'TU', + 'flightNumber' => '814', + 'bookingClass' => 'L', + 'groupNumber' => 'L', + 'segmentTattoo' => 1 + ]) + ], + 'pricingOptions' => new ServiceStandalonePricingOptions([ + 'pricingsFareBasis' => [ + new FareBasis([ + 'fareBasisCode' => 'LOXOW', + ]) + ], + 'references' => [ + new PaxSegRef([ + 'reference' => 1, + 'type' => 'S' + ]), + new PaxSegRef([ + 'reference' => 1, + 'type' => 'P' + ]) + ] + ]) + ]) +); *** FOP diff --git a/src/Amadeus/Client.php b/src/Amadeus/Client.php index 9d3236e7a..701739750 100644 --- a/src/Amadeus/Client.php +++ b/src/Amadeus/Client.php @@ -1622,6 +1622,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 * 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..b99381eb6 --- /dev/null +++ b/src/Amadeus/Client/RequestCreator/Converter/Service/StandaloneCatalogueConv.php @@ -0,0 +1,46 @@ + + */ +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/ServicePassenger.php b/src/Amadeus/Client/RequestOptions/Service/StandaloneCatalogue/ServicePassenger.php new file mode 100755 index 000000000..3e0fd9e9f --- /dev/null +++ b/src/Amadeus/Client/RequestOptions/Service/StandaloneCatalogue/ServicePassenger.php @@ -0,0 +1,43 @@ + + */ +class ServicePassenger extends Passenger +{ + /** + * Specifies the passenger index + * + * If you have 3 passengers of this type, you need to provide 3 unique passenger index. + * + * @var int + */ + public $reference; +} diff --git a/src/Amadeus/Client/RequestOptions/Service/StandaloneCatalogue/ServiceStandalonePricingOptions.php b/src/Amadeus/Client/RequestOptions/Service/StandaloneCatalogue/ServiceStandalonePricingOptions.php new file mode 100755 index 000000000..2862765b2 --- /dev/null +++ b/src/Amadeus/Client/RequestOptions/Service/StandaloneCatalogue/ServiceStandalonePricingOptions.php @@ -0,0 +1,36 @@ + + */ +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 new file mode 100755 index 000000000..67d8cfdf1 --- /dev/null +++ b/src/Amadeus/Client/RequestOptions/ServiceStandaloneCatalogueOptions.php @@ -0,0 +1,33 @@ + + */ +class ServiceStandaloneCatalogueOptions extends FareInformativePricingWithoutPnrOptions +{ +} 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 +{ +} diff --git a/src/Amadeus/Client/Struct/Service/IntegratedPricing/PricingOptionKey.php b/src/Amadeus/Client/Struct/Service/IntegratedPricing/PricingOptionKey.php old mode 100644 new mode 100755 diff --git a/src/Amadeus/Client/Struct/Service/StandaloneCatalogue.php b/src/Amadeus/Client/Struct/Service/StandaloneCatalogue.php new file mode 100755 index 000000000..4324226d3 --- /dev/null +++ b/src/Amadeus/Client/Struct/Service/StandaloneCatalogue.php @@ -0,0 +1,108 @@ + + */ +class StandaloneCatalogue extends BaseWsMessage +{ + + /** + * + * @var PassengerInfoGroup[] + */ + public $passengerInfoGroup = []; + + /** + * + * @var FlightInfo[] + */ + public $flightInfo = []; + + /** + * + * @var PricingOptions[] + */ + public $pricingOption = []; + + /** + * StandaloneCatalogue constructor. + * + * @param ServiceStandaloneCatalogueOptions|null $options + */ + public function __construct($options) + { + 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) { + $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) + { + $this->pricingOption = PricePNRWithBookingClass13::loadPricingOptionsFromRequestOptions($pricingOptions); + } +} diff --git a/src/Amadeus/Client/Struct/Service/StandaloneCatalogue/FareInfo.php b/src/Amadeus/Client/Struct/Service/StandaloneCatalogue/FareInfo.php new file mode 100755 index 000000000..bf9366042 --- /dev/null +++ b/src/Amadeus/Client/Struct/Service/StandaloneCatalogue/FareInfo.php @@ -0,0 +1,43 @@ + + */ +class FareInfo +{ + + /** + * + * @var string + */ + public $valueQualifier; + + public function __construct($paxType) + { + $this->valueQualifier = $paxType; + } +} diff --git a/src/Amadeus/Client/Struct/Service/StandaloneCatalogue/FlightInfo.php b/src/Amadeus/Client/Struct/Service/StandaloneCatalogue/FlightInfo.php new file mode 100755 index 000000000..c44b9fed5 --- /dev/null +++ b/src/Amadeus/Client/Struct/Service/StandaloneCatalogue/FlightInfo.php @@ -0,0 +1,86 @@ + + */ +class FlightInfo extends SegmentGroup +{ + /** + * @var SegmentInformation + */ + public $flightDetails; + + /** + * FlightInfo 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); + + SegmentGroup::loadInventory($options->inventory); + } + + /** + * Load non-required options if available + * + * @param FlightInfo $options + */ + protected function loadOptionalSegmentInformation($options) + { + if (! empty($options->operatingCompany)) { + $this->flightDetails->companyDetails->operatingCompany = $options->operatingCompany; + } + + if ($options->arrivalDate instanceof \DateTime) { + $this->flightDetails->flightDate->setArrivalDate($options->arrivalDate); + } + + if (! empty($options->groupNumber)) { + $this->flightDetails->flightTypeDetails = new FlightTypeDetails($options->groupNumber); + } + + SegmentGroup::loadAdditionalSegmentDetails($options->airplaneCode, $options->nrOfStops); + } +} diff --git a/src/Amadeus/Client/Struct/Service/StandaloneCatalogue/PassengerInfoGroup.php b/src/Amadeus/Client/Struct/Service/StandaloneCatalogue/PassengerInfoGroup.php new file mode 100755 index 000000000..ed116a50e --- /dev/null +++ b/src/Amadeus/Client/Struct/Service/StandaloneCatalogue/PassengerInfoGroup.php @@ -0,0 +1,62 @@ + + */ +class PassengerInfoGroup +{ + + /** + * + * @var specificTravellerDetails + */ + public $specificTravellerDetails; + + /** + * + * @var fareInfo + */ + public $fareInfo; + + /** + * PassengerInfoGroup constructor. + * + * @param Passenger $passenger + * @param int $referenceNumber + */ + public function __construct($passenger, $referenceNumber) + { + $this->specificTravellerDetails = new SpecificTravellerDetails($referenceNumber); + + if (! empty($passenger->type)) { + $this->fareInfo = new FareInfo($passenger->type); + } + } +} diff --git a/src/Amadeus/Client/Struct/Service/StandaloneCatalogue/SpecificTravellerDetails.php b/src/Amadeus/Client/Struct/Service/StandaloneCatalogue/SpecificTravellerDetails.php new file mode 100755 index 000000000..f177ec257 --- /dev/null +++ b/src/Amadeus/Client/Struct/Service/StandaloneCatalogue/SpecificTravellerDetails.php @@ -0,0 +1,49 @@ + + */ +class SpecificTravellerDetails +{ + + /** + * + * @var specificTravellerDetails[] + */ + public $travellerDetails; + + /** + * SpecificTravellerDetails constructor. + * + * @param int $referenceNumber + */ + public function __construct($referenceNumber) + { + $this->travellerDetails = new TravellerDetails($referenceNumber); + } +} diff --git a/src/Amadeus/Client/Struct/Service/StandaloneCatalogue/TravellerDetails.php b/src/Amadeus/Client/Struct/Service/StandaloneCatalogue/TravellerDetails.php new file mode 100755 index 000000000..0a65bf107 --- /dev/null +++ b/src/Amadeus/Client/Struct/Service/StandaloneCatalogue/TravellerDetails.php @@ -0,0 +1,48 @@ + + */ +class TravellerDetails +{ + + /** + * + * @var int + */ + public $referenceNumber; + + /** + * TravellerDetails constructor. + * + * @param int $referenceNumber + */ + public function __construct($referenceNumber) + { + $this->referenceNumber = $referenceNumber; + } +} diff --git a/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); + } +} 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