Closed stephenmorton closed 1 year ago
I seem to get stuck in migrations, is there a minimum php version this supports?
Hi, Again, thanks for a great article. I have followed part 1 and 2. Everything worked fine, except, at the very last step I got this error once submitting the flight booking page. "Client error:
POST https://test.api.amadeus.com/v1/booking/flight-orders
resulted in a400 Bad Request
response: {"errors":[{"status":400,"code":32171,"title":"MANDATORY DATA MISSING","detail":"validatingAirlineCodes needed","source" (truncated...)It seems to require a Airline code? I can't see why I am getting this error. Regards, Steve
I get this error too. Any possible fix?
Hello @stephenmorton and @chimake ,
Thanks for the feedback. I believe the endpoint requires an airline code, and you would have to get one to continue. Unfortunately, I do not know the process of getting one.
The validated airline code is parsed in the flight_offers key. See below.
$data = [ 'data' => [ 'type' => 'flight-order', 'flightOffers' => [ json_decode($request['data']) ], //'validatingAirlineCodes' => ['TP'], // fixed syntax error 'travelers' => [ [ 'id' => '1', 'dateOfBirth' => '2001-09-02', 'name' => [ 'firstName' => 'Idris Aweda', 'lastName' => 'Zubair' ], 'gender' => 'MALE', 'contact' => [ 'emailAddress' => 'zubairidrisaweda@gmail.com', 'phones' => [ [ 'deviceType' => 'MOBILE', 'countryCallingCode' => '234', 'number' => '7052053780' ] ] ], 'documents' => [ [ 'documentType' => 'PASSPORT', 'birthPlace' => 'Madrid', 'issuanceLocation' => 'Madrid', 'issuanceDate' => '2015-04-14', 'number' => '00000000', 'expiryDate' => '2025-04-14', 'issuanceCountry' => 'ES', 'validityCountry' => 'ES', 'nationality' => 'ES', 'holder' => true ] ] ] ] ] ];
I have fixed it. I changed line 17 on the price.blade.php from <input type="hidden" value="{{ json_encode($data) }}" name="data">
to <input type="hidden" value="{{ json_encode($data->flightOffers[0]) }}" name="data">
Thanks @chimake. I will close the Issue now.
cc: @stephenmorton
I have fixed it. I changed line 17 on the price.blade.php from
<input type="hidden" value="{{ json_encode($data) }}" name="data">
to<input type="hidden" value="{{ json_encode($data->flightOffers[0]) }}" name="data">
Hi, Again, thanks for a great article. I have followed part 1 and 2. Everything worked fine, except, at the very last step I got this error once submitting the flight booking page. "Client error:
POST https://test.api.amadeus.com/v1/booking/flight-orders
resulted in a400 Bad Request
response: {"errors":[{"status":400,"code":32171,"title":"MANDATORY DATA MISSING","detail":"validatingAirlineCodes needed","source" (truncated...)It seems to require a Airline code? I can't see why I am getting this error. Regards, Steve