Skip to content

Commit

Permalink
Implemented Ticket_CancelDocument (issue #93)
Browse files Browse the repository at this point in the history
  • Loading branch information
DerMika committed Nov 10, 2017
1 parent addc497 commit 63e89bb
Show file tree
Hide file tree
Showing 21 changed files with 1,182 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Release 1.6.0 (UNRELEASED)
* Implemented ``MiniRule_GetFromETicket`` (https://github.com/amabnl/amadeus-ws-client/issues/122)
* Implemented ``Ticket_CancelDocument`` (https://github.com/amabnl/amadeus-ws-client/issues/93)

# Release 1.5.0 (5 November 2017)
* Added support for Vendor Code in FOP for Fare Pricing messages (https://github.com/amabnl/amadeus-ws-client/pull/82) - Michal Hernas
Expand Down
1 change: 1 addition & 0 deletions docs/list-of-supported-messages.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ This is the list of messages that are at least partially supported at this time:
- Ticket_ATCShopperMasterPricerTravelBoardSearch
- Ticket_RepricePNRWithBookingClass
- Ticket_ReissueConfirmedPricing
- Ticket_CancelDocument
- DocIssuance_IssueTicket
- DocIssuance_IssueMiscellaneousDocuments
- DocIssuance_IssueCombined
Expand Down
97 changes: 97 additions & 0 deletions docs/samples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1713,6 +1713,103 @@ Reissue pricing for e-Ticket 057-2146640300:
])
);
------------------------------
Ticket_CancelDocument
------------------------------

Request E-ticket Direct cancellation

This operation allows the end user to initiate a void transaction using E-ticket direct feature. E-ticket direct cancellation is initiated from TNRMG210C office on XX airline stock:

.. code-block:: php
use Amadeus\Client\RequestOptions\TicketCancelDocumentOptions;
$response = $client->ticketCancelDocument(
new TicketCancelDocumentOptions([
'eTicket' => '2327176820',
'airlineStockProvider' => 'XX',
'officeId' => 'TNRMG210C'
])
);
Request cancellation of a transaction by ticket number associated to sales report process(TRDC/SR)

The void action has been requested by an authorized agent signed in office NCE6X0100, the ticket 1721587458965 is eligible for the void and option "sales report only" is used:

.. code-block:: php
use Amadeus\Client\RequestOptions\TicketCancelDocumentOptions;
$response = $client->ticketCancelDocument(
new TicketCancelDocumentOptions([
'eTicket' => '1721587458965',
'airlineStockProvider' => '6X',
'officeId' => 'NCE6X0100',
'void' => true,
])
);
Request cancellation of a transaction by ticket number for Travel Agent:

.. code-block:: php
use Amadeus\Client\RequestOptions\TicketCancelDocumentOptions;
$response = $client->ticketCancelDocument(
new TicketCancelDocumentOptions([
'eTicket' => '4600052609',
'marketStockProvider' => 'DE',
'officeId' => 'FRAL12177',
])
);
Request cancellation of a transaction from query report:

.. code-block:: php
use Amadeus\Client\RequestOptions\TicketCancelDocumentOptions;
use Amadeus\Client\RequestOptions\Ticket\SequenceRange;
$response = $client->ticketCancelDocument(
new TicketCancelDocumentOptions([
'sequenceRanges' => [
new SequenceRange([
'from' => '1408'
])
],
'airlineStockProvider' => '6X',
'officeId' => 'NCE6X0100',
])
);
Request cancellation of several tickets, individual items and ranges of items from query report:

.. code-block:: php
use Amadeus\Client\RequestOptions\TicketCancelDocumentOptions;
use Amadeus\Client\RequestOptions\Ticket\SequenceRange;
$response = $client->ticketCancelDocument(
new TicketCancelDocumentOptions([
'sequenceRanges' => [
new SequenceRange([
'from' => '1408'
]),
new SequenceRange([
'from' => '1410',
'to' => '1412'
]),
new SequenceRange([
'from' => '1414'
])
],
'airlineStockProvider' => '6X',
'officeId' => 'NCE6X0100',
])
);
***********
DocIssuance
***********
Expand Down
16 changes: 16 additions & 0 deletions src/Amadeus/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -933,6 +933,22 @@ public function ticketRepricePnrWithBookingClass(
return $this->callMessage($msgName, $options, $messageOptions);
}

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

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

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

namespace Amadeus\Client\RequestCreator\Converter\Ticket;

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

/**
* Ticket_CancelDocument request converter
*
* @package Amadeus\Client\RequestCreator\Converter\Ticket
* @author Dieter Devlieghere <dermikagh@gmail.com>
*/
class CancelDocumentConv extends BaseConverter
{
/**
* @param TicketCancelDocumentOptions $requestOptions
* @param int|string $version
* @return Struct\Ticket\CancelDocument
*/
public function convert($requestOptions, $version)
{
return new Struct\Ticket\CancelDocument($requestOptions);
}
}
48 changes: 48 additions & 0 deletions src/Amadeus/Client/RequestOptions/Ticket/SequenceRange.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?php
/**
* amadeus-ws-client
*
* Copyright 2015 Amadeus Benelux NV
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* @package Amadeus
* @license https://opensource.org/licenses/Apache-2.0 Apache 2.0
*/

namespace Amadeus\Client\RequestOptions\Ticket;

use Amadeus\Client\LoadParamsFromArray;

/**
* Sequence Number Range
*
* @package Amadeus\Client\RequestOptions\Ticket
* @author Dieter Devlieghere <dermikagh@gmail.com>
*/
class SequenceRange extends LoadParamsFromArray
{
/**
* The first document of the range
*
* @var string
*/
public $from;

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

namespace Amadeus\Client\RequestOptions;

use Amadeus\Client\RequestOptions\Ticket\SequenceRange;

/**
* Ticket_CancelDocument request options
*
* @package Amadeus\Client\RequestOptions
* @author Dieter Devlieghere <dermikagh@gmail.com>
*/
class TicketCancelDocumentOptions extends Base
{
/**
* E-Ticket document number.
*
* 13-digit document number or 10-digit number (without 3-digit numeric airline code).
*
* @var string
*/
public $eTicket;

/**
* @var SequenceRange[]
*/
public $sequenceRanges = [];

/**
* Void option.
*
* @var bool
*/
public $void = false;

/**
* The targeted Airline Stock Provider (two-character code).
*
* @var string
*/
public $airlineStockProvider;

/**
* The targeted Market Stock Provider (two-character code).
*
* @var string
*/
public $marketStockProvider;

/**
* Office ID.
*
* @var string
*/
public $officeId;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?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\Ticket;

use Amadeus\Client\ResponseHandler\StandardResponseHandler;
use Amadeus\Client\Result;
use Amadeus\Client\Session\Handler\SendResult;

/**
* Ticket_CancelDocument response handler
*
* @package Amadeus\Client\ResponseHandler\Ticket
* @author Dieter Devlieghere <dermikagh@gmail.com>
*/
class HandlerCancelDocument extends StandardResponseHandler
{
/**
* @param SendResult $response
* @return Result
*/
public function analyze(SendResult $response)
{
return $this->analyzeSimpleResponseErrorCodeAndMessage($response);
}
}
Loading

0 comments on commit 63e89bb

Please sign in to comment.