{"action":"opened","issue":{"url":"https://api.github.com/repos/hotelbeds-sdk/hotel-api-sdk-php/issues/34","repository_url":"https://api.github.com/repos/hotelbeds-sdk/hotel-api-sdk-php","labels_url":"https://api.github.com/repos/hotelbeds-sdk/hotel-api-sdk-php/issues/34/labels{/name}","comments_url":"https://api.github.com/repos/hotelbeds-sdk/hotel-api-sdk-php/issues/34/comments","events_url":"https://api.github.com/repos/hotelbeds-sdk/hotel-api-sdk-php/issues/34/events","html_url":"https://github.com/hotelbeds-sdk/hotel-api-sdk-php/issues/34","id":171106731,"number":34,"title":"Bug? The distribution of paxes is not correct. ","user":{"login":"globatum","id":6818139,"avatar_url":"https://avatars.githubusercontent.com/u/6818139?v=3","gravatar_id":"","url":"https://api.github.com/users/globatum","html_url":"https://github.com/globatum","followers_url":"https://api.github.com/users/globatum/followers","following_url":"https://api.github.com/users/globatum/following{/other_user}","gists_url":"https://api.github.com/users/globatum/gists{/gist_id}","starred_url":"https://api.github.com/users/globatum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/globatum/subscriptions","organizations_url":"https://api.github.com/users/globatum/orgs","repos_url":"https://api.github.com/users/globatum/repos","events_url":"https://api.github.com/users/globatum/events{/privacy}","received_events_url":"https://api.github.com/users/globatum/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-08-15T04:32:30Z","updated_at":"2016-08-15T04:32:30Z","closed_at":null,"body":"I conduct a search for two rooms with one adult in each room. I hard code the PAX information as such in testAvailRQ\r\n\r\n```\r\n$p = [ new Pax(Pax::AD, 30, \"Miquel\", \"Fiol\", 1), new Pax(Pax::AD, 30, \"Margalida\", \"Soberats\", 2)];\r\n\t\t$occupancy->paxes =$p;\r\n\t\t$rqData->occupancies = [ $occupancy ];\r\n        return $this->apiClient->Availability($rqData);\r\n```\r\n\r\nat bookingconfirm I reenter the PAX info\r\n\r\n```\r\n$bookingRoom = new \\hotelbeds\\hotel_api_sdk\\model\\BookingRoom($rateKey);\r\n\t\t\t$p = [ new Pax(Pax::AD, 30, \"Miquel\", \"Fiol\", 1), new Pax(Pax::AD, 30, \"Margalida\", \"Soberats\", 2)];\r\n\t\t\t   $bookingRoom->paxes = $p;\r\n\t\t\t   $bookRooms[] = $bookingRoom;\r\n\r\n\t\t\t// Check all bookable rooms are inserted for confirmation.\r\n\r\n\t\t\t$rqBookingConfirm->rooms = $bookRooms;\r\n\r\n\t\t\t// Define payment data for booking confirmation\r\n\t\t\t$rqBookingConfirm->clientReference = \"PHP_TEST_2\";\r\n```\r\n\r\nI get the error\r\n\r\n```\r\nBad Request: Invalid data. Error at property rooms: The distribution of paxes is not correct. The number of adults specified in the paxes do not match with the requested ones {\"holder\":{\"name\":\"Tomeu TEST\",\"surname\":\"Capo TEST\"},\"language\":\"CAS\",\"rooms\":[{\"rateKey\":\"20160823|20160827|W|256|169264|DBL.GR|BAR-ALL|RO||2~2~0||N@A3D0F593A1C54A049FD946BD88D22482\",\"paxes\":[{\"age\":30,\"type\":\"AD\",\"roomId\":1,\"name\":\"Miquel\",\"surname\":\"Fiol\"},{\"age\":30,\"type\":\"AD\",\"roomId\":2,\"name\":\"Margalida\",\"surname\":\"Soberats\"}]}],\"clientReference\":\"PHP_TEST_2\"}\r\n```\r\n\r\nIsn't that odd?\r\nHere is the response coming in from the api regarding checkout info before booking\r\n\r\n```\r\n{ \"hotel\": \"Fremont Hotel And Casino\", \"destination\": \"Las Vegas - NV\", \"checkIn\": \"2016-08-23\", \"checkOut\": \"2016-08-27\", \"code\": 169264, \"roomName\": \"DOUBLE GUEST ROOM\", \"roomCode\": \"DBL.GR\", \"rateKey\": \"20160823|20160827|W|256|169264|DBL.GR|BAR-ALL|RO||2~2~0||N@A3D0F593A1C54A049FD946BD88D22482\", \"rooms\": 2, \"roomPrice\": \"494.88\", \"roomTax\": \"13.00\", \"adults\": 2, \"children\": 0, \"boardName\": \"ROOM ONLY\", \"rateType\": \"BOOKABLE\", \"rateClass\": \"NOR\", \"cancellationPolicy\": [ { \"amount\": \"86.52\", \"from\": \"2016-08-19T23:59:00-07:00\" } ], \"currency\": \"USD\" }\r\n```\r\n\r\nnotice it says two rooms...two adults..which is what I provided for the search and for the checkout.\r\n\r\nHere is how I get the bookingconfirm to work\r\n\r\n```\r\n$bookingRoom = new \\hotelbeds\\hotel_api_sdk\\model\\BookingRoom($rateKey);\r\n\t\t\t$p = [ new Pax(Pax::AD, 30, \"Miquel\", \"Fiol\", 1), new Pax(Pax::AD, 30, \"Margalida\", \"Soberats\", 2), new Pax(Pax::AD, 30, \"Miquel\", \"Fiol\", 1), new Pax(Pax::AD, 30, \"Margalida\", \"Soberats\", 2)];\r\n\t\t\t   $bookingRoom->paxes = $p;\r\n\t\t\t   $bookRooms[] = $bookingRoom;\r\n\r\n\t\t\t// Check all bookable rooms are inserted for confirmation.\r\n\r\n\t\t\t$rqBookingConfirm->rooms = $bookRooms;\r\n\r\n\t\t\t// Define payment data for booking confirmation\r\n\t\t\t$rqBookingConfirm->clientReference = \"PHP_TEST_2\";\r\n```\r\n\r\nI have to DOUBLE the PAX info in order for the booking confirm to go through....proof below\r\n\r\n```\r\nhotelbeds\\hotel_api_sdk\\messages\\BookingConfirmRS Object\r\n(\r\n    [responseData:hotelbeds\\hotel_api_sdk\\messages\\ApiResponse:private] => Array\r\n        (\r\n            [auditData] => Array\r\n                (\r\n                    [processTime] => 2602\r\n                    [timestamp] => 2016-08-15 06:31:59.913\r\n                    [requestHost] => 108.45.65.61\r\n                    [serverId] => sa3RKSJACHXE79K.env\r\n                    [environment] => [int]\r\n                    [release] => 129c1f34c5b867e8347d45a262ca0628048eb1b0\r\n                    [internal] => smjz6tve6yxspb9nfwzutdja|UK|null|null|null|null|0|0|0|N||null|null|null|null|null||||1\r\n                )\r\n\r\n            [booking] => hotelbeds\\hotel_api_sdk\\model\\Booking Object\r\n                (\r\n                    [validFields:protected] => Array\r\n                        (\r\n                            [reference] => string\r\n                            [creationDate] => string\r\n                            [totalAmount] => float\r\n                            [currency] => string\r\n                            [status] => string\r\n                            [holder] => array\r\n                            [commisionVAT] => float\r\n                            [remark] => string\r\n                            [hotel] => array\r\n                        )\r\n\r\n                    [fields:protected] => Array\r\n                        (\r\n                            [reference] => 256-2541602\r\n                            [clientReference] => PHP_TEST_2\r\n                            [creationDate] => 2016-08-15\r\n                            [status] => CONFIRMED\r\n                            [modificationPolicies] => Array\r\n                                (\r\n                                    [cancellation] => 1\r\n                                    [modification] => 1\r\n                                )\r\n\r\n                            [holder] => Array\r\n                                (\r\n                                    [name] => TOMEU TEST\r\n                                    [surname] => CAPO TEST\r\n                                )\r\n\r\n                            [hotel] => Array\r\n                                (\r\n                                    [checkIn] => 2016-08-23\r\n                                    [checkOut] => 2016-08-27\r\n                                    [code] => 169264\r\n                                    [name] => Fremont Hotel And Casino\r\n                                    [categoryCode] => 3EST\r\n                                    [categoryName] => 3 ESTRELLAS\r\n                                    [destinationCode] => LVS\r\n                                    [destinationName] => Las Vegas - NV\r\n                                    [zoneCode] => 2\r\n                                    [zoneName] => Fremont Street - Downtown\r\n                                    [latitude] => 36.17100848\r\n                                    [longitude] => -115.1438293\r\n                                    [rooms] => Array\r\n                                        (\r\n                                            [0] => Array\r\n                                                (\r\n                                                    [status] => CONFIRMED\r\n                                                    [id] => 1\r\n                                                    [code] => DBL.GR\r\n                                                    [name] => DOBLE GUEST ROOM\r\n                                                    [paxes] => Array\r\n                                                        (\r\n                                                            [0] => Array\r\n                                                                (\r\n                                                                    [roomId] => 1\r\n                                                                    [type] => AD\r\n                                                                    [age] => 30\r\n                                                                    [name] => Miquel\r\n                                                                    [surname] => Fiol\r\n                                                                )\r\n\r\n                                                            [1] => Array\r\n                                                                (\r\n                                                                    [roomId] => 1\r\n                                                                    [type] => AD\r\n                                                                    [age] => 30\r\n                                                                    [name] => Miquel\r\n                                                                    [surname] => Fiol\r\n                                                                )\r\n\r\n                                                            [2] => Array\r\n                                                                (\r\n                                                                    [roomId] => 2\r\n                                                                    [type] => AD\r\n                                                                    [age] => 30\r\n                                                                    [name] => Margalida\r\n                                                                    [surname] => Soberats\r\n                                                                )\r\n\r\n                                                            [3] => Array\r\n                                                                (\r\n                                                                    [roomId] => 2\r\n                                                                    [type] => AD\r\n                                                                    [age] => 30\r\n                                                                    [name] => Margalida\r\n                                                                    [surname] => Soberats\r\n                                                                )\r\n\r\n                                                        )\r\n\r\n                                                    [rates] => Array\r\n                                                        (\r\n                                                            [0] => Array\r\n                                                                (\r\n                                                                    [rateClass] => NOR\r\n                                                                    [net] => 494.82\r\n                                                                    [rateComments] => Hora de entrada 15:00 â€“ 00:00. . - The person whose name is on the reservation must be at least 21 years of age to check in.\r\n********************************************************************************************************\r\nBooking Dates April 15 thru Sept 8\r\nStay Dates: May 2 thru Sept 8\r\nOffer: 20% off prevailing rates, $10 food & beverage credit\r\n  per room, per night stayed\r\nRestrictions:  \r\nBlackouts FR: 5/4-8   5/13-14   5/27-29   6/18-20\r\n************************************************************************************************\r\n                                                                    [paymentType] => AT_WEB\r\n                                                                    [packaging] => \r\n                                                                    [boardCode] => RO\r\n                                                                    [boardName] => SOLO HABITACIÃ“N\r\n                                                                    [cancellationPolicies] => Array\r\n                                                                        (\r\n                                                                            [0] => Array\r\n                                                                                (\r\n                                                                                    [amount] => 86.50\r\n                                                                                    [from] => 2016-08-19T23:59:00-07:00\r\n                                                                                )\r\n\r\n                                                                        )\r\n\r\n                                                                    [rateBreakDown] => Array\r\n                                                                        (\r\n                                                                            [rateDiscounts] => Array\r\n                                                                                (\r\n                                                                                    [0] => Array\r\n                                                                                        (\r\n                                                                                            [code] => EBD\r\n                                                                                            [name] => RESERVA ANTICIPADA\r\n                                                                                            [amount] => -123.74\r\n                                                                                        )\r\n\r\n                                                                                )\r\n\r\n                                                                        )\r\n\r\n                                                                    [rooms] => 2\r\n                                                                )\r\n\r\n                                                        )\r\n\r\n                                                )\r\n\r\n                                        )\r\n\r\n                                    [totalNet] => 494.82\r\n                                    [currency] => USD\r\n                                    [supplier] => Array\r\n                                        (\r\n                                            [name] => HOTELBEDS USA\r\n                                            [vatNumber] => 592952685\r\n                                        )\r\n\r\n                                )\r\n\r\n                            [totalNet] => 494.82\r\n                            [pendingAmount] => 494.82\r\n                            [currency] => USD\r\n                        )\r\n\r\n                )\r\n\r\n        )\r\n\r\n)\r\n```\r\n\r\nIs this a bug? What could I be doing wrong?"}}
{"actor":{"display_login":"globatum"}}