Checkout redirection is used when you want to make the availability search requests in your own site and redirect to Onetourismo Booking Engine just for the checkout and payment.
It's pretty easy and consisted of just two steps.
Make the request as described in the API section . You'll get the available rooms of the selected hotel with the following format
{
"status": "success",
"hotelOtag": "0041428",
"results":
{
"rooms": [
{
"index": "0",
"quantity": "1",
"mealPlans": [
{
"code": "BB",
"price": "100.00",
"description": "bed_breakfast"
}],
"code": "STD",
"id": "Double Standard",
"type": "Double Standard"
},
{
"index": "0",
"quantity": "1",
"mealPlans": [
{
"code": "BB",
"price": "100.00",
"description": "bed_breakfast"
}],
"code": "STD",
"id": "Twin Standard",
"type": "Twin Standard"
}]
},
}
In this step, you could show the returned rooms in your site and let the user select one (or more).
Let's assume that client wants to continue with the first room. Now, you have to create the checkout link and redirect the user to it.
As we assumed in the previous step, user wants to make a reservation to the first room of the example. The following steps are required to redirect him to Onetourismo Bookine Enging
var rooms = [{
"adults": 2,
"childrenAges": [4,5],
"quantity": 1,
"id" : "Double Standard",
"code" : "STD",
"mealPlan" : "BB"
}]
note: If the search was about more than one type of rooms, ex: 1 with two adults and one with three , user should choose one room for each type (rooms are separated to types by index field) , and the array should contain two room objects.
var risonString = "!((adults:2,childrenAges:!(4,5),code:STD,id:'Double Standard',mealPlan:BB,quantity:1))"
http://your_onetourismo_booking_enging_url/#/checkoutRedirect/hotelOtagID/checkIn(YYYY-MM-DD)/checkOut(YYYY-MM-DD)/risonString
,so for the given example and if we assume that the booking engine url is b2c.onetourismo.com the checkout link will be
http://b2c.onetourismo.com/#/checkoutRedirect/0041428/2017-08-21/2017-08-22/!((adults:2,childrenAges:!(4,5),code:STD,id:'Double Standard',mealPlan:BB,quantity:1))