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_AddMultiElements SR DOCS strange issue #50

Closed
fayax opened this issue Mar 19, 2017 · 16 comments
Closed

PNR_AddMultiElements SR DOCS strange issue #50

fayax opened this issue Mar 19, 2017 · 16 comments

Comments

@fayax
Copy link

fayax commented Mar 19, 2017

I have an issue adding SR DOCS for multiple passengers. It works fine for a single passenger.
When I add DOCS for more than 1 passenger, PNR_AddMultiElements response shows SR DOCS entries for all passengers. But when PNR_Retrieve is called again, it shows SR DOCS is added for only one passenger. I checked the logs for PNR_AddMultiElements call, it shows the XML schema with only one passenger.
Is there an issue adding SR DOCS for multiple passenger?

@DerMika
Copy link
Collaborator

DerMika commented Mar 20, 2017

Hi,

Without logs it's a bit hard to understand what's going on.

I'm not 100% sure, but I believe it's important to associate an SR DOCS element to a specific passenger, as SR DOCS (such as APIS) information is relevant for one single person.

Do you provide pax association in your request? If not, here's how you can do it: https://github.com/amabnl/amadeus-ws-client/blob/master/docs/samples/pnr-create-modify.rst#apis-passport-or-identity-card

Also, there might be a shortcoming in those docs. If you're doing a PNR_AddMultiElements and you've just created a full PNR and provided Passenger data, you need to use the Reference::TYPE_PASSENGER_REQUEST type instead of the Reference::TYPE_PASSENGER_TATTOO type. That indicates that you're providing the traveller's ID in the PNR yourself. Here's an example of a PNR creation with a contact element associated to multiple passengers:

$createPnrOptions = new PnrAddMultiElementsOptions([
    'receivedFrom' => 'unittest',
    'travellers' => [
        new Traveller([
            'number' => 1,
            'lastName' => 'Bowie',
            'firstName' => 'David'
        ]),
        new Traveller([
            'number' => 2,
            'lastName' => 'Bowie',
            'firstName' => 'David2'
        ])
    ],
    'actionCode' => PnrCreatePnrOptions::ACTION_END_TRANSACT_RETRIEVE,
    'itineraries' => [
        new Itinerary([
            'origin' => 'BRU',
            'destination' => 'LIS',
            'segments' => [
                new Air([
                    'date' => \DateTime::createFromFormat('Y-m-d His', "2008-06-10 000000", new \DateTimeZone('UTC')),
                    'origin' => 'BRU',
                    'destination' => 'LIS',
                    'flightNumber' => '349',
                    'bookingClass' => 'Y',
                    'company' => 'TP'
                ])
            ]
        ])
    ],
    'elements' => [
        new Ticketing([
            'ticketMode' => Ticketing::TICKETMODE_OK
        ]),
        new Contact([
            'type' => Contact::TYPE_PHONE_GENERAL,
            'value' => '+3223456789',
            'references' => [
                new Reference([
                    'type' => Reference::TYPE_PASSENGER_REQUEST,
                    'id' => 1
                ]),
                new Reference([
                    'type' => Reference::TYPE_PASSENGER_REQUEST,
                    'id' => 2
                ]),
            ]
        ])
    ]
]);

If you're having a different issue, please give me something to reproduce the problem, because I don't quite understand what's going wrong.

@fayax
Copy link
Author

fayax commented Mar 20, 2017

Hi,

When add APIS DOCS and retrieve the PNR it doesn't display APIS DOCS details.
Please refer the attached log files.

Thanks

PNR_AddMultiElements_Request.txt
PNR_AddMultiElements_Response.txt
PNR_Retrieve.txt

@DerMika
Copy link
Collaborator

DerMika commented Mar 20, 2017

I see that you're using actionCode 0 (PnrAddMultiElementsOptions::ACTION_NO_PROCESSING) to add this element to your PNR in context.

Do you perform an End Transact on this PNR later in your workflow? If not, I think it's simply a matter of not saving the updates in your PNR.

Every time you want to 'save' the modifications you do to a PNR, you need to set the actionCode to PnrAddMultiElementsOptions::ACTION_END_TRANSACT (code 10) or PnrAddMultiElementsOptions::ACTION_END_TRANSACT_RETRIEVE (code 11) or else the changes you make won't be persisted beyond the point where you have this PNR in context.

@fayax
Copy link
Author

fayax commented Mar 21, 2017

Hi,
When I set the action code 10 to save the APIS DOCS info I get this error ERROR AT END OF TRANSACTION TIME
Attached complete logs of the process.
Kindly advise what I'm doing wrong here.
_Log.txt

@DerMika
Copy link
Collaborator

DerMika commented Mar 21, 2017

You should really go through the PNR_AddMultiElements documentation on the Amadeus web services extranet if you're planning on making and modifying PNR's. There are a few basic things you should keep in mind when working with PNR's, and one of those is that each time you edit a PNR, you need to enter a "Received From" element to the PNR.

The error you're getting is indeed in the response, :

<generalErrorInfo>
	<messageErrorInformation>
		<errorDetail>
			<errorCode>8111</errorCode>
			<qualifier>EC</qualifier>
			<responsibleAgency>1A</responsibleAgency>
		</errorDetail>
	</messageErrorInformation>
	<messageErrorText>
		<freetextDetail>
			<subjectQualifier>3</subjectQualifier>
		</freetextDetail>
		<text>ERROR AT END OF TRANSACTION TIME</text>
		<text>ERROR AT EOT TIME                                                     </text>
		<text>NEED RECEIVED FROM                                                    </text>
	</messageErrorText>
</generalErrorInfo>

So your problem is that you haven't entered a Received From field, which causes the End Transact to fail.

HOWEVER, your PNR_AddMultiElements version 14.1 has its "general" level error message in a different location than the 14.2+ format, which is implemented in this library. The result is that your error isn't recognized by the library, and you're getting a Result::STATUS_OK when there is in fact an error in the response. You should be getting a RESPONSE::STATUS_ERROR.

I will open a separate issue to fix that error.

@DerMika
Copy link
Collaborator

DerMika commented Mar 21, 2017

And to add a Received From field to your PNR, you should just add an extra element to your PnrAddMultiElementsOptions (re-using the same example as above):

$createPnrOptions = new PnrAddMultiElementsOptions([
    'receivedFrom' => 'unittest',
    'travellers' => [
        new Traveller([
            'number' => 1,
            'lastName' => 'Bowie',
            'firstName' => 'David'
        ]),
        new Traveller([
            'number' => 2,
            'lastName' => 'Bowie',
            'firstName' => 'David2'
        ])
    ],
    'actionCode' => PnrCreatePnrOptions::ACTION_END_TRANSACT_RETRIEVE,
    'itineraries' => [
        new Itinerary([
            'origin' => 'BRU',
            'destination' => 'LIS',
            'segments' => [
                new Air([
                    'date' => \DateTime::createFromFormat('Y-m-d His', "2008-06-10 000000", new \DateTimeZone('UTC')),
                    'origin' => 'BRU',
                    'destination' => 'LIS',
                    'flightNumber' => '349',
                    'bookingClass' => 'Y',
                    'company' => 'TP'
                ])
            ]
        ])
    ],
    'elements' => [
        new Ticketing([
            'ticketMode' => Ticketing::TICKETMODE_OK
        ]),
        new Contact([
            'type' => Contact::TYPE_PHONE_GENERAL,
            'value' => '+3223456789',
            'references' => [
                new Reference([
                    'type' => Reference::TYPE_PASSENGER_REQUEST,
                    'id' => 1
                ]),
                new Reference([
                    'type' => Reference::TYPE_PASSENGER_REQUEST,
                    'id' => 2
                ]),
            ]
        ]),
        new ReceivedFrom([
            'receivedFrom' => 'my amadeus client'
        ]),
    ]
]);

@fayax
Copy link
Author

fayax commented Mar 22, 2017

Hi, Adding RF to PNR resolves the issue. I thought PnrAddMultiElements automatically adds the RF.

@fayax fayax closed this as completed Mar 22, 2017
@DerMika
Copy link
Collaborator

DerMika commented Mar 22, 2017

I think it only does that when you create a new PNR, I'll check.

@DerMika
Copy link
Collaborator

DerMika commented Mar 22, 2017

Hmm, you're right, it should do that.

I will try to reproduce the problem.

@DerMika DerMika reopened this Mar 22, 2017
@DerMika DerMika added the bug label Mar 22, 2017
DerMika added a commit that referenced this issue Mar 22, 2017
…AddMultiElements() method, not only in the pnrCreatePnr() method (issue #50)
@DerMika
Copy link
Collaborator

DerMika commented Mar 22, 2017

So what happened: the automatic addition of a Received From element only happened when the $client->pnrCreatePnr() method was called, but not with $client->pnrAddMultiElements().

I pushed a fix that should also place the automatic Received From field in a pnrAddMultiElements() call.

Would you do me a favor and do a composer update (make sure you're pointed to the master branch) and check if you can modify the PNR without explicity having to add a ReceivedFrom element?

@fayax
Copy link
Author

fayax commented Mar 22, 2017

I think the master branch doesn't have Manual Commission implemented yet. After composer update throws ManualCommission not found error

@DerMika
Copy link
Collaborator

DerMika commented Mar 22, 2017

Yes it does. At the moment it's only implemented on Master.

@fayax
Copy link
Author

fayax commented Mar 22, 2017

The fix doesn't automatically add ReceivedFrom field in pnrAddMultiElements call.
I still get the Need ReceivedFrom error message.

@DerMika
Copy link
Collaborator

DerMika commented Mar 23, 2017

I've just tried to reproduce the problem it with the latest code on the master branch.

I created a new PNR and then did a PNR_AddMultiElements to add a new SSR element to the PNR. The Received From field was automatically added to the second PNR_AddMultiElements call.

So I'm not able to reproduce the problem anymore.

Can you verify in your composer.lock that you're indeed on the latest GIT commit? It should say:

    "packages": [
        {
            "name": "amabnl/amadeus-ws-client",
            "version": "dev-master",
            "source": {
                "type": "git",
                "url": "https://github.com/amabnl/amadeus-ws-client.git",
                "reference": "3a80d7d3ea53058f6c0be527daf86befe7cf4459"
            },

The "reference": "3a80d7d3ea53058f6c0be527daf86befe7cf4459" is the GIT SHA-1 hash for the commit (see https://github.com/amabnl/amadeus-ws-client/commits/master)

@fayax
Copy link
Author

fayax commented Mar 26, 2017

I have tried again, it works fine now without having to manually provide the ReceivedFrom.

@fayax fayax closed this as completed Mar 26, 2017
@DerMika
Copy link
Collaborator

DerMika commented Mar 26, 2017

Good to hear, thanks for double-checking!

@DerMika DerMika added this to the 1.3.0 milestone Mar 31, 2018
atomy pushed a commit to mlamm/amadeus-ws-client that referenced this issue Nov 26, 2018
…o master

* commit '81616253aca2bfc1c32f946486741b29bd2adc9c':
  VAN-893 service.amadeus / feeOption node is missing in Fare_MasterPricerTravelBoardSearch
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

2 participants