-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #216 from amadeus4dev/HotelBookingV2
Added Hotel booking v2
- Loading branch information
Showing
6 changed files
with
87 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/** | ||
* A namespaced client for the | ||
* `/v2/booking/hotel-orders` endpoints | ||
* | ||
* Access via the {@link Amadeus} object | ||
* | ||
* ```js | ||
* let amadeus = new Amadeus(); | ||
* amadeus.booking.hotelOrders; | ||
* ``` | ||
* | ||
* @param {Client} client | ||
*/ | ||
class HotelOrders { | ||
constructor(client) { | ||
this.client = client; | ||
} | ||
|
||
/** | ||
* To book the offer retrieved from Hotel Search API. | ||
* | ||
* @param {Object} params | ||
* @return {Promise.<Response,ResponseError>} a Promise | ||
* | ||
* To book the hotel offer with ID 'XXX' with guests, travel agents and payment info | ||
* | ||
* ```js | ||
* amadeus.booking.hotelOrders.post( | ||
* JSON.stringfy({ | ||
* 'data': { | ||
* 'type': 'hotel-order', | ||
* 'guests': [], | ||
* 'travelAgent': {}, | ||
* 'roomAssociations': [], | ||
* 'payment': {} | ||
* }}) | ||
*) | ||
* ``` | ||
*/ | ||
post(params = {}) { | ||
|
||
return this.client.post('/v2/booking/hotel-orders', params); | ||
} | ||
} | ||
|
||
export default HotelOrders; |