amabnl / amadeus-ws-client

PHP Amadeus SOAP Web Service client library
Apache License 2.0
184 stars 191 forks source link

DocIssuance_IssueTicket Error #118

Closed ahmedeltokhy closed 6 years ago

ahmedeltokhy commented 7 years ago

Hello All, I am trying to Issue ticket by the function "docIssuanceIssueTicket" but I am getting the Error "INVALID TST NUMBER", and the following the codes I used:

$opt = new AirSellFromRecommendationOptions([
    'itinerary' => [
        new Itinerary([
            'from' => $departure,
            'to' => $arrival,
            'segments' => [
                new Segment([
                    'departureDate' => \DateTime::createFromFormat('Ymd', $departure_date, new \DateTimeZone('UTC')),
                    'from' => $departure,
                    'to' => $arrival,
                    'companyCode' => $company,
                    'flightNumber' => $flight_no,
                    'bookingClass' => $class,
                    'nrOfPassengers' => $passengers_no,
                    'statusCode' => Segment::STATUS_SELL_SEGMENT,
                    'quantity' => 3
                ]),
                new Segment([
                    'departureDate' => \DateTime::createFromFormat('Ymd', $return_date, new \DateTimeZone('UTC')),
                    'from' => $arrival,
                    'to' => $departure,
                    'companyCode' => $return_company,
                    'flightNumber' => $flight_no_return,
                    'bookingClass' => $class,
                    'nrOfPassengers' => $passengers_no,
                    'statusCode' => Segment::STATUS_SELL_SEGMENT,
                    'quantity' => 3
                ])
            ],
        ])
    ]
]);
$sellResult = $client->airSellFromRecommendation($opt);

$opt = new PnrCreatePnrOptions([
    'actionCode' => PnrCreatePnrOptions::ACTION_NO_PROCESSING, //0 Do not yet save the PNR and keep in context.
    'travellers' => [
        new Traveller([
            'firstName' => 'AHMED',
            'lastName' => 'HASSAN',
            'withInfant'=>true,
            'number' => 1,
            'type' => Traveller::TRAV_TYPE_ADULT,
            'dateOfBirth' => \DateTime::createFromFormat('Y-m-d', '1987-02-04'),// \DateTime::createFromFormat('Y-m-d','1987-02-04'),
            'infant' => new Traveller([
                'firstName' => 'INFANT',
                'lastName' => 'TEST',
                'number' => 4,
                'travellerType' => Traveller::TRAV_TYPE_INFANT,
                'dateOfBirth' => \DateTime::createFromFormat('Y-m-d', '2017-07-19'),
            ])
        ]),
        new Traveller([
            'firstName' => 'WIFE',
            'lastName' => 'TEST',
            'number' => 2,
            'travellerType' => Traveller::TRAV_TYPE_ADULT,
            'dateOfBirth' => \DateTime::createFromFormat('Y-m-d', '1989-07-14'),
        ]),
        new Traveller([
            'firstName' => 'CHILD',
            'lastName' => 'TEST',
            'number' => 3,
            'type' => Traveller::TRAV_TYPE_CHILD,
            'dateOfBirth' => \DateTime::createFromFormat('Y-m-d', '2015-12-21'),
        ]),
    ],
    'elements' =>
        [
            new Contact([
                'type' => Contact::TYPE_PHONE_MOBILE,
                'value' => '+966597859955'
            ]),
            new Contact([
                'type' => Contact::TYPE_EMAIL,
                'value' => 'aaa.computerscience@gmail.com'
            ]),

            new FormOfPayment([
                'type' => FormOfPayment::TYPE_CASH
            ]),

            new Ticketing([
                'ticketMode' => Ticketing::TICKETMODE_OK,
                'date' => \DateTime::createFromFormat('Ymd', $departure_date, new \DateTimeZone('UTC'))
            ]),
            'ServiceRequest' => [new ServiceRequest([
                'type' => 'PSPT',
                'status' => ServiceRequest::STATUS_HOLD_CONFIRMED,
                'company' => $company,
                'quantity' => 1,
                'freeText' => [
                  '1111111111'//  '----04FEB87-M--AHMED-HASSAN'
                ],
                'references' => [
                    new Reference([
                        'type' => Reference::TYPE_PASSENGER_REQUEST,
                        'id' => 1
                    ])
                ]
            ]),
                new ServiceRequest([
                    'type' => 'PSPT',
                    'status' => ServiceRequest::STATUS_HOLD_CONFIRMED,
                    'company' => $company,
                    'quantity' => 1,
                    'freeText' => [
                        '22222222222'//'----14JUL89-F--WIFE-TEST'
                    ],
                    'references' => [
                        new Reference([
                            'type' => Reference::TYPE_PASSENGER_REQUEST,
                            'id' => 3
                        ])
                    ]
                ]),
                new ServiceRequest([
                    'type' => 'PSPT',
                    'status' => ServiceRequest::STATUS_HOLD_CONFIRMED,
                    'company' => $company,
                    'quantity' => 1,
                    'freeText' => [
                        '3333'//'----04FEB87-M--CHILD-TEST'
                    ],
                    'references' => [
                        new Reference([
                            'type' => Reference::TYPE_PASSENGER_REQUEST,
                            'id' => 3
                        ])
                    ]
                ]),
                new ServiceRequest([
                    'type' => 'PSPT',
                    'status' => ServiceRequest::STATUS_HOLD_CONFIRMED,
                    'company' => $company,
                    'quantity' => 1,
                    'freeText' => [
                       '444444444'
                    ],
                    'references' => [
                        new Reference([
                            'type' => Reference::TYPE_PASSENGER_REQUEST,
                            'id' => 4
                        ])
                    ]
                ])

            ]

        ]]);
$createdPnr = $client->pnrCreatePnr($opt);
$pricingResponse = $client->farePricePnrWithBookingClass(
    new FarePricePnrWithBookingClassOptions([
        'overrideOptions' => [
            FarePricePnrWithBookingClassOptions::OVERRIDE_RETURN_LOWEST
        ],

    ])
);

$createTstResponse = $client->ticketCreateTSTFromPricing(
    new TicketCreateTstFromPricingOptions([
        'pricings' => [
            new Pricing([
                'tstNumber' => 1,
                'passengerReferences'=>[1,2]
            ]),
            new Pricing([
                'tstNumber' => 2,
                'passengerReferences'=>[3]
            ]),
            new Pricing([
                'tstNumber' => 3,
                'passengerReferences'=>[4]
            ]),
        ]
    ])
);

$pnrReply_end = $client->pnrAddMultiElements(
    new PnrAddMultiElementsOptions([
        'actionCode' => PnrAddMultiElementsOptions::ACTION_END_TRANSACT_RETRIEVE,
    ])
);
$issueTicketResponse = $client->docIssuanceIssueTicket(
    new DocIssuanceIssueTicketOptions([
        'options' => [
            DocIssuanceIssueTicketOptions::OPTION_ETICKET,
            DocIssuanceIssueTicketOptions::OPTION_RETRIEVE_PNR
        ],
        'tsts' => [1,2,3]
    ])
);
DerMika commented 7 years ago

That's a question for Amadeus Support, not for me. There could be many reasons why you're getting this error, all of which are beyond the scope of this library.

ahmedeltokhy commented 7 years ago

ok thanks, i will contact Amadeus support, shall I leave the ticket open till I find the solution to write it?

DerMika commented 7 years ago

Sure, that's fine. Maybe the answer will help other people.

DerMika commented 6 years ago

Did you get a response from Amadeus yet?

DerMika commented 6 years ago

Closing due to lack of feedback

mhrahul commented 6 years ago

@ahmedeltokhy did you solved the problem?