Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PNR Modification #67

Closed
nikhildeshmukh opened this issue Apr 20, 2017 · 6 comments
Closed

PNR Modification #67

nikhildeshmukh opened this issue Apr 20, 2017 · 6 comments

Comments

@nikhildeshmukh
Copy link

What level of PNR modification does this library supports.
Can i get an example steps for sending messages.
for e.g
Like if i had already generated a pnr and i need to modify so how to proceed ?

@DerMika
Copy link
Collaborator

DerMika commented Apr 20, 2017

What this library does is no more than allowing you to perform specific SOAP messages on the Amadeus Web Services.

So any message and message feature that has been implemented works just as described in the Amadeus docs.

For the scenario you mention, this is perfectly possible. First of all you need configure the client to use a stateful session because you'll need to retain your context between messages.

Then you need to retrieve a PNR with the pnrRetrieve() method. By doing that you have "opened" the PNR and it will be available to perform further actions on it. Most actions in a PNR are done using the pnrAddMultiElements() method or the pnrCancel() method which allow you to respectively add and remove specific PNR elements, segments, or passenger information.

For example, if you want to add a RM (general remark) to a PNR which has been put into context, you just send something like this:

use Amadeus\Client\RequestOptions\PnrCreatePnrOptions;
use Amadeus\Client\RequestOptions\Pnr\Element\MiscellaneousRemark;

$addResult = $client->pnrAddMultiElements(
    new PnrAddMultiElementsOptions([
        'actionCode' => PnrAddMultiElementsOptions::ACTION_END_TRANSACT_RETRIEVE
        'elements' => [
            new MiscellaneousRemark([
                'text' => 'This is a general remark'
            ])
        ]
    ])
);

By providing the actionCode PnrAddMultiElementsOptions::ACTION_END_TRANSACT_RETRIEVE you indicate that after adding the Remark, the updated PNR must be saved and re-retrieved. The response will contain the updated PNR after adding the element (but it could contain errors if the element you've tried to add was somehow invalid)

Also, by re-retrieving the PNR, you have effectively placed the PNR in context again, ready for further actions on the PNR.

Also, after using a stateful session, don't forget to sign out (with the securitySignOut() method).

@nikhildeshmukh
Copy link
Author

thanks but can you give me a example of changing segments
will be helpfull

@DerMika
Copy link
Collaborator

DerMika commented Apr 20, 2017

I don't have any ready samples, but I can tell you how to do it.

Basically, unless you're using a specific message like Air_RebookAirSegment (which isn't supported in this library right now), you need to first cancel the existing segment and then add the new segment. Just like you would do in Amadeus Selling Platform (= an XE cryptic entry followed by an entry to add the new segment).

First of all, you need to do a pnrRetrieve(), and find the Segment Tattoo for the segment you want to remove (can be found at /PNR_Reply/originDestinationDetails/itineraryInfo/elementManagementItinerary/reference/number in the PNR_Reply). This will give you the Tattoo number of the segment to remove.

Then you do a pnrCancel() as explained in the second example here. Contrary to that example, in this case I would only do the ACTION_END_TRANSACT_RETRIEVE action when you have cancelled the old and added the new segment.

After that you add the new segment in any way you would otherwise add a new segment. Via airSellFromRecommendation() - example - or by manually adding an AIR segment via pnrAddMultiElements() - example.

@DerMika
Copy link
Collaborator

DerMika commented Apr 27, 2017

Hi,

Is your question answered? If so, can you please close the issue?

@bimusiek
Copy link
Collaborator

I just want to point out that in ATC documentation there are 2 notes explaining when to cancel first and then add new segments or when to add new segments (to make sure these are available) and then cancel previous ones 👍

All can be found in ATC Guide and because I already read all of it twice I can say that they explained everything there.

@nikhildeshmukh
Copy link
Author

thanks @DerMika @bimusiek

atomy pushed a commit to mlamm/amadeus-ws-client that referenced this issue Nov 26, 2018
…A-3026 to master

* commit '5c6985293e6576a118907486eab76176b363befa':
  FA-3026: review comment
  FA-3026: remove +x from composer.lock
  FA-3026: fix tests, revert unwanted but commited changes
  FA-3026: modify remarks parsing to match remark strings with "-" in the value
  FA-3026: working on remarks to enable handling of more than one traveller
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants