-
Notifications
You must be signed in to change notification settings - Fork 191
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
1,051 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
src/Amadeus/Client/RequestCreator/Converter/Service/BookPriceServiceConv.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?php | ||
/** | ||
* amadeus-ws-client | ||
* | ||
* Copyright 2015 Amadeus Benelux NV | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
* @package Amadeus | ||
* @license https://opensource.org/licenses/Apache-2.0 Apache 2.0 | ||
*/ | ||
|
||
namespace Amadeus\Client\RequestCreator\Converter\Service; | ||
|
||
use Amadeus\Client\RequestCreator\Converter\BaseConverter; | ||
use Amadeus\Client\RequestOptions\ServiceBookPriceServiceOptions; | ||
use Amadeus\Client\Struct; | ||
|
||
/** | ||
* Service_BookPriceService Request converter | ||
* | ||
* @package Amadeus\Client\RequestCreator\Converter\Service | ||
* @author Mike Hernas <mike@ahoy.io> | ||
*/ | ||
class BookPriceServiceConv extends BaseConverter | ||
{ | ||
/** | ||
* @param ServiceBookPriceServiceOptions $requestOptions | ||
* @param int|string $version | ||
* @return Struct\Service\BookPriceService | ||
*/ | ||
public function convert($requestOptions, $version) | ||
{ | ||
return new Struct\Service\BookPriceService($requestOptions); | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
src/Amadeus/Client/RequestOptions/Fare/MPAnchoredSegment.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
/** | ||
* amadeus-ws-client | ||
* | ||
* Copyright 2015 Amadeus Benelux NV | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
* @package Amadeus | ||
* @license https://opensource.org/licenses/Apache-2.0 Apache 2.0 | ||
*/ | ||
|
||
namespace Amadeus\Client\RequestOptions\Fare; | ||
|
||
use Amadeus\Client\RequestOptions\Air\SellFromRecommendation\Segment as SegmentOptions; | ||
|
||
/** | ||
* MPAnchoredSegment request options. | ||
* | ||
* @package Amadeus\Client\RequestOptions\Fare | ||
* @author Mike Hernas <mike@ahoy.io> | ||
*/ | ||
class MPAnchoredSegment extends SegmentOptions | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 65 additions & 0 deletions
65
src/Amadeus/Client/RequestOptions/Service/BookPriceService/Identifier.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
<?php | ||
/** | ||
* amadeus-ws-client | ||
* | ||
* Copyright 2015 Amadeus Benelux NV | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
* @package Amadeus | ||
* @license https://opensource.org/licenses/Apache-2.0 Apache 2.0 | ||
*/ | ||
|
||
namespace Amadeus\Client\RequestOptions\Service\BookPriceService; | ||
|
||
use Amadeus\Client\LoadParamsFromArray; | ||
|
||
/** | ||
* Identifier | ||
* | ||
* @package Amadeus\Client\RequestOptions\Service\BookPriceService | ||
* @author Mike Hernas <mike@ahoy.io> | ||
*/ | ||
class Identifier extends LoadParamsFromArray | ||
{ | ||
const BOOKING_METHOD_SSR = 1; | ||
const BOOKING_METHOD_SVC = 2; | ||
|
||
/** | ||
* self::BOOKING_METHOD_* | ||
* | ||
* 01 SSR type of booking method | ||
* 02 SVC type of booking method | ||
* | ||
* @var string | ||
*/ | ||
public $bookingMethod; | ||
|
||
/** | ||
* | ||
* @var string | ||
*/ | ||
public $RFIC; | ||
|
||
/** | ||
* | ||
* @var string | ||
*/ | ||
public $RFISC; | ||
|
||
/** | ||
* | ||
* @var string | ||
*/ | ||
public $code; | ||
} |
54 changes: 54 additions & 0 deletions
54
src/Amadeus/Client/RequestOptions/ServiceBookPriceServiceOptions.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<?php | ||
/** | ||
* amadeus-ws-client | ||
* | ||
* Copyright 2015 Amadeus Benelux NV | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
* @package Amadeus | ||
* @license https://opensource.org/licenses/Apache-2.0 Apache 2.0 | ||
*/ | ||
|
||
namespace Amadeus\Client\RequestOptions; | ||
|
||
use Amadeus\Client\RequestOptions\Service\BookPriceService\Identifier; | ||
|
||
/** | ||
* Service_BookPriceService Request Options | ||
* | ||
* @package Amadeus\Client\RequestOptions | ||
* @author Mike Hernas <mike@ahoy.io> | ||
*/ | ||
class ServiceBookPriceServiceOptions extends Base | ||
{ | ||
|
||
/** | ||
* Booking carrier of the service | ||
* | ||
* @var string | ||
*/ | ||
public $serviceProvider; | ||
|
||
/** | ||
* | ||
* @var Identifier | ||
*/ | ||
public $identifier; | ||
|
||
/** | ||
* Request ID | ||
* @var string | ||
*/ | ||
public $TID; | ||
} |
70 changes: 70 additions & 0 deletions
70
src/Amadeus/Client/ResponseHandler/Service/HandlerBookPriceService.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
<?php | ||
/** | ||
* amadeus-ws-client | ||
* | ||
* Copyright 2015 Amadeus Benelux NV | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
* @package Amadeus | ||
* @license https://opensource.org/licenses/Apache-2.0 Apache 2.0 | ||
*/ | ||
|
||
namespace Amadeus\Client\ResponseHandler\Service; | ||
|
||
use Amadeus\Client\ResponseHandler\StandardResponseHandler; | ||
use Amadeus\Client\Result; | ||
use Amadeus\Client\Session\Handler\SendResult; | ||
|
||
/** | ||
* HandlerBookPriceService | ||
* | ||
* @package Amadeus\Client\ResponseHandler\Service | ||
* @author Mike Hernas <m@hern.as> | ||
*/ | ||
class HandlerBookPriceService extends StandardResponseHandler | ||
{ | ||
/** | ||
* @param SendResult $response | ||
* @return Result | ||
*/ | ||
public function analyze(SendResult $response) | ||
{ | ||
$analyzeResponse = new Result($response); | ||
$domXpath = $this->makeDomXpath($response->responseXml); | ||
|
||
$errorCodeNodeList = $domXpath->query("//ama:Error"); | ||
|
||
if ($errorCodeNodeList->length > 0) { | ||
$analyzeResponse->status = Result::STATUS_ERROR; | ||
|
||
foreach (iterator_to_array($errorCodeNodeList) as $msg) { | ||
$analyzeResponse->messages[] = new Result\NotOk( | ||
$msg->getAttribute('Code'), | ||
trim($msg->getAttribute('ShortText')) | ||
); | ||
} | ||
|
||
return $analyzeResponse; | ||
} | ||
|
||
$success = $domXpath->query('//m:Success'); | ||
if ($success->length > 0) { | ||
$analyzeResponse->status = Result::STATUS_OK; | ||
return $analyzeResponse; | ||
} | ||
|
||
$analyzeResponse->status = Result::STATUS_UNKNOWN; | ||
return $analyzeResponse; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.