hostconnect 0.1.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (82) hide show
  1. data/CHANGELOG +8 -0
  2. data/MIT-LICENSE +22 -0
  3. data/README.markdown +16 -0
  4. data/Rakefile +48 -0
  5. data/hostconnect.gemspec +44 -0
  6. data/lib/hostconnect/builder.rb +50 -0
  7. data/lib/hostconnect/builders/add_service_builder.rb +60 -0
  8. data/lib/hostconnect/builders/agent_info_builder.rb +19 -0
  9. data/lib/hostconnect/builders/get_booking_builder.rb +24 -0
  10. data/lib/hostconnect/builders/get_booking_payment_summary_builder.rb +20 -0
  11. data/lib/hostconnect/builders/get_locations_builder.rb +18 -0
  12. data/lib/hostconnect/builders/get_services_builder.rb +18 -0
  13. data/lib/hostconnect/builders/get_system_settings_builder.rb +18 -0
  14. data/lib/hostconnect/builders/list_bookings_builder.rb +27 -0
  15. data/lib/hostconnect/builders/new_booking_info_builder.rb +23 -0
  16. data/lib/hostconnect/builders/option_info_builder.rb +49 -0
  17. data/lib/hostconnect/builders/pax_details_builder.rb +21 -0
  18. data/lib/hostconnect/builders/ping_builder.rb +11 -0
  19. data/lib/hostconnect/builders/record_booking_payment_builder.rb +25 -0
  20. data/lib/hostconnect/builders/room_config_builder.rb +25 -0
  21. data/lib/hostconnect/builders/service_line_note_builder.rb +17 -0
  22. data/lib/hostconnect/builders/suppler_info_builder.rb +27 -0
  23. data/lib/hostconnect/client.rb +32 -0
  24. data/lib/hostconnect/coercion.rb +50 -0
  25. data/lib/hostconnect/core_extensions/string.rb +18 -0
  26. data/lib/hostconnect/core_extensions/symbol.rb +9 -0
  27. data/lib/hostconnect/response.rb +119 -0
  28. data/lib/hostconnect/responses/add_service.rb +4 -0
  29. data/lib/hostconnect/responses/agent_info.rb +7 -0
  30. data/lib/hostconnect/responses/get_booking.rb +20 -0
  31. data/lib/hostconnect/responses/get_booking_payment_summary.rb +21 -0
  32. data/lib/hostconnect/responses/get_locations.rb +21 -0
  33. data/lib/hostconnect/responses/get_services.rb +21 -0
  34. data/lib/hostconnect/responses/get_system_settings.rb +24 -0
  35. data/lib/hostconnect/responses/list_bookings.rb +14 -0
  36. data/lib/hostconnect/responses/option_info.rb +60 -0
  37. data/lib/hostconnect/responses/ping.rb +7 -0
  38. data/lib/hostconnect/responses/record_booking_payment.rb +4 -0
  39. data/lib/hostconnect/responses/supplier_info.rb +31 -0
  40. data/lib/hostconnect/rtf_document.rb +19 -0
  41. data/lib/hostconnect/translation.rb +22 -0
  42. data/lib/hostconnect.rb +58 -0
  43. data/spec/builders/add_service_builder_spec.rb +36 -0
  44. data/spec/builders/agent_info_builder_spec.rb +13 -0
  45. data/spec/builders/get_locations_builder_spec.rb +13 -0
  46. data/spec/builders/new_booking_info_builder_spec.rb +34 -0
  47. data/spec/builders/option_info_builder_spec.rb +48 -0
  48. data/spec/builders/pax_details_builder_spec.rb +41 -0
  49. data/spec/builders/ping_builder_spec.rb +23 -0
  50. data/spec/builders/room_config_builder_spec.rb +60 -0
  51. data/spec/client_spec.rb +20 -0
  52. data/spec/coercion_spec.rb +85 -0
  53. data/spec/core_extensions_spec.rb +17 -0
  54. data/spec/fixtures/requests/add_service_request/hotel_booking.xml +42 -0
  55. data/spec/fixtures/requests/agent_info.xml +8 -0
  56. data/spec/fixtures/requests/get_locations.xml +8 -0
  57. data/spec/fixtures/requests/option_info/hotel_search.xml +11 -0
  58. data/spec/fixtures/requests/option_info/hotel_search_total_stay_price.xml +18 -0
  59. data/spec/fixtures/requests/option_info/option_number.xml +10 -0
  60. data/spec/fixtures/requests/ping.xml +5 -0
  61. data/spec/fixtures/responses/add_service.xml +11 -0
  62. data/spec/fixtures/responses/agent_info.xml +12 -0
  63. data/spec/fixtures/responses/agent_info_error.xml +7 -0
  64. data/spec/fixtures/responses/get_booking.xml +40 -0
  65. data/spec/fixtures/responses/get_locations.xml +48 -0
  66. data/spec/fixtures/responses/get_system_settings.xml +28 -0
  67. data/spec/fixtures/responses/option_info/hotel_price.xml +17 -0
  68. data/spec/fixtures/responses/option_info/hotel_search.xml +721 -0
  69. data/spec/fixtures/responses/option_info/hotel_search_with_stay_price.xml +470 -0
  70. data/spec/fixtures/responses/option_info/option_number.xml +14 -0
  71. data/spec/fixtures/responses/option_info/tours.xml +74 -0
  72. data/spec/fixtures/responses/ping.xml +8 -0
  73. data/spec/responses/add_service_spec.rb +13 -0
  74. data/spec/responses/agent_info_spec.rb +24 -0
  75. data/spec/responses/get_booking_spec.rb +33 -0
  76. data/spec/responses/get_locations_spec.rb +29 -0
  77. data/spec/responses/get_system_settings_spec.rb +21 -0
  78. data/spec/responses/option_info_spec.rb +48 -0
  79. data/spec/responses/ping_spec.rb +22 -0
  80. data/spec/spec_helper.rb +13 -0
  81. data/spec/translation_spec.rb +18 -0
  82. metadata +259 -0
@@ -0,0 +1,470 @@
1
+ <?xml version="1.0" encoding="ISO-8859-1"?>
2
+ <!DOCTYPE Reply SYSTEM "http://217.206.100.98:8080/iComNew205/hostConnect_2_05_006.dtd">
3
+ <Reply>
4
+ <OptionInfoReply>
5
+ <Option>
6
+ <Opt>LONACHOINKCSTDBEB</Opt>
7
+ <OptionNumber>15</OptionNumber>
8
+ <OptGeneral>
9
+ <SupplierId>11</SupplierId>
10
+ <SupplierName>Holiday Inn Kings Cross</SupplierName>
11
+ <Description>Bed &amp; Full English Breakfast</Description>
12
+ <Comment>Standard Room</Comment>
13
+ <Locality>KGX</Locality>
14
+ <LocalityDescription>Kings Cross</LocalityDescription>
15
+ <Class>3*</Class>
16
+ <ClassDescription>3 Star</ClassDescription>
17
+ <SType>Y</SType>
18
+ <SCU>Night</SCU>
19
+ <MinSCU>1</MinSCU>
20
+ <MaxSCU>99</MaxSCU>
21
+ <OptExtras>
22
+ <OptExtra>
23
+ <SequenceNumber>1</SequenceNumber>
24
+ <Description>Porterage</Description>
25
+ <IsPricePerPerson>Y</IsPricePerPerson>
26
+ </OptExtra>
27
+ </OptExtras>
28
+ <VoucherName>Holiday Inn Kings Cross</VoucherName>
29
+ <Address1>21 Fleet St</Address1>
30
+ <Address2>London</Address2>
31
+ <Address3></Address3>
32
+ <Address4></Address4>
33
+ <Address5></Address5>
34
+ <PostCode>W1 4TG</PostCode>
35
+ <Single_Avail>Y</Single_Avail>
36
+ <Single_Ad_Max>1</Single_Ad_Max>
37
+ <Twin_Avail>Y</Twin_Avail>
38
+ <Twin_Ad_Max>2</Twin_Ad_Max>
39
+ <Double_Avail>Y</Double_Avail>
40
+ <Double_Ad_Max>2</Double_Ad_Max>
41
+ <Triple_Avail>Y</Triple_Avail>
42
+ <Triple_Ad_Max>3</Triple_Ad_Max>
43
+ <Quad_Avail>N</Quad_Avail>
44
+ <InfantsAllowed>Y</InfantsAllowed>
45
+ <Infant_From>0</Infant_From>
46
+ <Infant_To>3</Infant_To>
47
+ <ChildrenAllowed>Y</ChildrenAllowed>
48
+ <Child_From>4</Child_From>
49
+ <Child_To>12</Child_To>
50
+ <AdultsAllowed>Y</AdultsAllowed>
51
+ <Adult_From>13</Adult_From>
52
+ <Adult_To>99</Adult_To>
53
+ <ButtonName>Accommodation</ButtonName>
54
+ </OptGeneral>
55
+ <OptStayResults>
56
+ <Availability>RQ</Availability>
57
+ <Currency>GBP</Currency>
58
+ <TotalPrice>67200</TotalPrice>
59
+ <RateName>Standard</RateName>
60
+ <RateText>Standard</RateText>
61
+ </OptStayResults>
62
+ </Option>
63
+ <Option>
64
+ <Opt>LONACHOINKCROOMON</Opt>
65
+ <OptionNumber>14</OptionNumber>
66
+ <OptGeneral>
67
+ <SupplierId>11</SupplierId>
68
+ <SupplierName>Holiday Inn Kings Cross</SupplierName>
69
+ <Description>Room Only</Description>
70
+ <Comment>Standard Room</Comment>
71
+ <Locality>KGX</Locality>
72
+ <LocalityDescription>Kings Cross</LocalityDescription>
73
+ <Class>3*</Class>
74
+ <ClassDescription>3 Star</ClassDescription>
75
+ <SType>Y</SType>
76
+ <SCU>Night</SCU>
77
+ <MinSCU>1</MinSCU>
78
+ <MaxSCU>99</MaxSCU>
79
+ <OptExtras>
80
+ <OptExtra>
81
+ <SequenceNumber>1</SequenceNumber>
82
+ <Description>Porterage</Description>
83
+ <IsPricePerPerson>Y</IsPricePerPerson>
84
+ </OptExtra>
85
+ </OptExtras>
86
+ <VoucherName>Holiday Inn Kings Cross</VoucherName>
87
+ <Address1>21 Fleet St</Address1>
88
+ <Address2>London</Address2>
89
+ <Address3></Address3>
90
+ <Address4></Address4>
91
+ <Address5></Address5>
92
+ <PostCode>W1 4TG</PostCode>
93
+ <Single_Avail>Y</Single_Avail>
94
+ <Single_Ad_Max>1</Single_Ad_Max>
95
+ <Twin_Avail>Y</Twin_Avail>
96
+ <Twin_Ad_Max>2</Twin_Ad_Max>
97
+ <Double_Avail>Y</Double_Avail>
98
+ <Double_Ad_Max>2</Double_Ad_Max>
99
+ <Triple_Avail>Y</Triple_Avail>
100
+ <Triple_Ad_Max>3</Triple_Ad_Max>
101
+ <Quad_Avail>N</Quad_Avail>
102
+ <InfantsAllowed>Y</InfantsAllowed>
103
+ <Infant_From>0</Infant_From>
104
+ <Infant_To>3</Infant_To>
105
+ <ChildrenAllowed>Y</ChildrenAllowed>
106
+ <Child_From>4</Child_From>
107
+ <Child_To>12</Child_To>
108
+ <AdultsAllowed>Y</AdultsAllowed>
109
+ <Adult_From>13</Adult_From>
110
+ <Adult_To>99</Adult_To>
111
+ <ButtonName>Accommodation</ButtonName>
112
+ </OptGeneral>
113
+ <OptStayResults>
114
+ <Availability>RQ</Availability>
115
+ <Currency>GBP</Currency>
116
+ <TotalPrice>48000</TotalPrice>
117
+ <RateName>Standard</RateName>
118
+ <RateText>Standard</RateText>
119
+ </OptStayResults>
120
+ </Option>
121
+ <Option>
122
+ <Opt>LONACHOINKCSTDBCB</Opt>
123
+ <OptionNumber>13</OptionNumber>
124
+ <OptGeneral>
125
+ <SupplierId>11</SupplierId>
126
+ <SupplierName>Holiday Inn Kings Cross</SupplierName>
127
+ <Description>Bed &amp; Continental Breakfast</Description>
128
+ <Comment>Standard Room</Comment>
129
+ <Locality>KGX</Locality>
130
+ <LocalityDescription>Kings Cross</LocalityDescription>
131
+ <Class>3*</Class>
132
+ <ClassDescription>3 Star</ClassDescription>
133
+ <SType>Y</SType>
134
+ <SCU>Night</SCU>
135
+ <MinSCU>1</MinSCU>
136
+ <MaxSCU>99</MaxSCU>
137
+ <OptExtras>
138
+ <OptExtra>
139
+ <SequenceNumber>1</SequenceNumber>
140
+ <Description>Porterage</Description>
141
+ <IsPricePerPerson>Y</IsPricePerPerson>
142
+ </OptExtra>
143
+ </OptExtras>
144
+ <VoucherName>Holiday Inn Kings Cross</VoucherName>
145
+ <Address1>21 Fleet St</Address1>
146
+ <Address2>London</Address2>
147
+ <Address3></Address3>
148
+ <Address4></Address4>
149
+ <Address5></Address5>
150
+ <PostCode>W1 4TG</PostCode>
151
+ <Single_Avail>Y</Single_Avail>
152
+ <Single_Ad_Max>1</Single_Ad_Max>
153
+ <Twin_Avail>Y</Twin_Avail>
154
+ <Twin_Ad_Max>2</Twin_Ad_Max>
155
+ <Double_Avail>Y</Double_Avail>
156
+ <Double_Ad_Max>2</Double_Ad_Max>
157
+ <Triple_Avail>Y</Triple_Avail>
158
+ <Triple_Ad_Max>3</Triple_Ad_Max>
159
+ <Quad_Avail>N</Quad_Avail>
160
+ <InfantsAllowed>Y</InfantsAllowed>
161
+ <Infant_From>0</Infant_From>
162
+ <Infant_To>3</Infant_To>
163
+ <ChildrenAllowed>Y</ChildrenAllowed>
164
+ <Child_From>4</Child_From>
165
+ <Child_To>12</Child_To>
166
+ <AdultsAllowed>Y</AdultsAllowed>
167
+ <Adult_From>13</Adult_From>
168
+ <Adult_To>99</Adult_To>
169
+ <ButtonName>Accommodation</ButtonName>
170
+ </OptGeneral>
171
+ <OptStayResults>
172
+ <Availability>RQ</Availability>
173
+ <Currency>GBP</Currency>
174
+ <TotalPrice>57600</TotalPrice>
175
+ <RateName>Standard</RateName>
176
+ <RateText>Standard</RateText>
177
+ </OptStayResults>
178
+ </Option>
179
+ <Option>
180
+ <Opt>LONACBAILONSTDFUB</Opt>
181
+ <OptionNumber>12</OptionNumber>
182
+ <OptGeneral>
183
+ <SupplierId>10</SupplierId>
184
+ <SupplierName>Baileys London</SupplierName>
185
+ <Description>Full Board</Description>
186
+ <Comment>Standard Room</Comment>
187
+ <Locality>PAD</Locality>
188
+ <LocalityDescription>Paddington</LocalityDescription>
189
+ <Class>4*</Class>
190
+ <ClassDescription>4 Star</ClassDescription>
191
+ <SType>Y</SType>
192
+ <SCU>Night</SCU>
193
+ <MinSCU>1</MinSCU>
194
+ <MaxSCU>99</MaxSCU>
195
+ <OptExtras>
196
+ <OptExtra>
197
+ <SequenceNumber>1</SequenceNumber>
198
+ <Description>Porterage</Description>
199
+ <IsPricePerPerson>Y</IsPricePerPerson>
200
+ </OptExtra>
201
+ </OptExtras>
202
+ <VoucherName>Baileys London</VoucherName>
203
+ <Address1>21 Fleet St</Address1>
204
+ <Address2>London</Address2>
205
+ <Address3></Address3>
206
+ <Address4></Address4>
207
+ <Address5></Address5>
208
+ <PostCode>W1 4TG</PostCode>
209
+ <Single_Avail>Y</Single_Avail>
210
+ <Single_Ad_Max>1</Single_Ad_Max>
211
+ <Twin_Avail>Y</Twin_Avail>
212
+ <Twin_Ad_Max>2</Twin_Ad_Max>
213
+ <Double_Avail>Y</Double_Avail>
214
+ <Double_Ad_Max>2</Double_Ad_Max>
215
+ <Triple_Avail>Y</Triple_Avail>
216
+ <Triple_Ad_Max>3</Triple_Ad_Max>
217
+ <Quad_Avail>N</Quad_Avail>
218
+ <InfantsAllowed>Y</InfantsAllowed>
219
+ <Infant_From>0</Infant_From>
220
+ <Infant_To>3</Infant_To>
221
+ <ChildrenAllowed>Y</ChildrenAllowed>
222
+ <Child_From>4</Child_From>
223
+ <Child_To>12</Child_To>
224
+ <AdultsAllowed>Y</AdultsAllowed>
225
+ <Adult_From>13</Adult_From>
226
+ <Adult_To>99</Adult_To>
227
+ <ButtonName>Accommodation</ButtonName>
228
+ </OptGeneral>
229
+ <OptStayResults>
230
+ <Availability>RQ</Availability>
231
+ <Currency>GBP</Currency>
232
+ <TotalPrice>124800</TotalPrice>
233
+ <RateName>Standard</RateName>
234
+ <RateText>Standard</RateText>
235
+ </OptStayResults>
236
+ </Option>
237
+ <Option>
238
+ <Opt>LONACBAILONSTDBCB</Opt>
239
+ <OptionNumber>10</OptionNumber>
240
+ <OptGeneral>
241
+ <SupplierId>10</SupplierId>
242
+ <SupplierName>Baileys London</SupplierName>
243
+ <Description>Bed &amp; Continental Breakfast</Description>
244
+ <Comment>Standard Room</Comment>
245
+ <Locality>PAD</Locality>
246
+ <LocalityDescription>Paddington</LocalityDescription>
247
+ <Class>4*</Class>
248
+ <ClassDescription>4 Star</ClassDescription>
249
+ <SType>Y</SType>
250
+ <SCU>Night</SCU>
251
+ <MinSCU>1</MinSCU>
252
+ <MaxSCU>99</MaxSCU>
253
+ <OptExtras>
254
+ <OptExtra>
255
+ <SequenceNumber>1</SequenceNumber>
256
+ <Description>Porterage</Description>
257
+ <IsPricePerPerson>Y</IsPricePerPerson>
258
+ </OptExtra>
259
+ </OptExtras>
260
+ <VoucherName>Baileys London</VoucherName>
261
+ <Address1>21 Fleet St</Address1>
262
+ <Address2>London</Address2>
263
+ <Address3></Address3>
264
+ <Address4></Address4>
265
+ <Address5></Address5>
266
+ <PostCode>W1 4TG</PostCode>
267
+ <Single_Avail>Y</Single_Avail>
268
+ <Single_Ad_Max>1</Single_Ad_Max>
269
+ <Twin_Avail>Y</Twin_Avail>
270
+ <Twin_Ad_Max>2</Twin_Ad_Max>
271
+ <Double_Avail>Y</Double_Avail>
272
+ <Double_Ad_Max>2</Double_Ad_Max>
273
+ <Triple_Avail>Y</Triple_Avail>
274
+ <Triple_Ad_Max>3</Triple_Ad_Max>
275
+ <Quad_Avail>N</Quad_Avail>
276
+ <InfantsAllowed>Y</InfantsAllowed>
277
+ <Infant_From>0</Infant_From>
278
+ <Infant_To>3</Infant_To>
279
+ <ChildrenAllowed>Y</ChildrenAllowed>
280
+ <Child_From>4</Child_From>
281
+ <Child_To>12</Child_To>
282
+ <AdultsAllowed>Y</AdultsAllowed>
283
+ <Adult_From>13</Adult_From>
284
+ <Adult_To>99</Adult_To>
285
+ <ButtonName>Accommodation</ButtonName>
286
+ </OptGeneral>
287
+ <OptStayResults>
288
+ <Availability>RQ</Availability>
289
+ <Currency>GBP</Currency>
290
+ <TotalPrice>98400</TotalPrice>
291
+ <RateName>Midweek</RateName>
292
+ <RateText>Mon-Fri</RateText>
293
+ </OptStayResults>
294
+ </Option>
295
+ <Option>
296
+ <Opt>LONACCUMLONSUITE </Opt>
297
+ <OptionNumber>9</OptionNumber>
298
+ <OptGeneral>
299
+ <SupplierId>1</SupplierId>
300
+ <SupplierName>Cumberland Hotel</SupplierName>
301
+ <Description>Bed &amp; Continental Breakfast</Description>
302
+ <Comment>Suite</Comment>
303
+ <Locality>PAD</Locality>
304
+ <LocalityDescription>Paddington</LocalityDescription>
305
+ <Class>4*</Class>
306
+ <ClassDescription>4 Star</ClassDescription>
307
+ <SType>Y</SType>
308
+ <SCU>Night</SCU>
309
+ <MinSCU>1</MinSCU>
310
+ <MaxSCU>99</MaxSCU>
311
+ <OptExtras>
312
+ <OptExtra>
313
+ <SequenceNumber>1</SequenceNumber>
314
+ <Description>Porterage</Description>
315
+ <IsPricePerPerson>Y</IsPricePerPerson>
316
+ </OptExtra>
317
+ </OptExtras>
318
+ <VoucherName>Cumberland Hotel</VoucherName>
319
+ <Address1>21 Fleet St</Address1>
320
+ <Address2>London</Address2>
321
+ <Address3></Address3>
322
+ <Address4></Address4>
323
+ <Address5></Address5>
324
+ <PostCode>W1 4TG</PostCode>
325
+ <Single_Avail>Y</Single_Avail>
326
+ <Single_Ad_Max>1</Single_Ad_Max>
327
+ <Twin_Avail>Y</Twin_Avail>
328
+ <Twin_Ad_Max>2</Twin_Ad_Max>
329
+ <Double_Avail>Y</Double_Avail>
330
+ <Double_Ad_Max>2</Double_Ad_Max>
331
+ <Triple_Avail>Y</Triple_Avail>
332
+ <Triple_Ad_Max>3</Triple_Ad_Max>
333
+ <Quad_Avail>N</Quad_Avail>
334
+ <InfantsAllowed>Y</InfantsAllowed>
335
+ <Infant_From>0</Infant_From>
336
+ <Infant_To>3</Infant_To>
337
+ <ChildrenAllowed>Y</ChildrenAllowed>
338
+ <Child_From>4</Child_From>
339
+ <Child_To>12</Child_To>
340
+ <AdultsAllowed>Y</AdultsAllowed>
341
+ <Adult_From>13</Adult_From>
342
+ <Adult_To>99</Adult_To>
343
+ <ButtonName>Accommodation</ButtonName>
344
+ </OptGeneral>
345
+ <OptStayResults>
346
+ <Availability>RQ</Availability>
347
+ <Currency>GBP</Currency>
348
+ <TotalPrice>105600</TotalPrice>
349
+ <RateName>Standard</RateName>
350
+ <RateText>Standard</RateText>
351
+ </OptStayResults>
352
+ </Option>
353
+ <Option>
354
+ <Opt>LONACCUMLONROOMON</Opt>
355
+ <OptionNumber>8</OptionNumber>
356
+ <OptGeneral>
357
+ <SupplierId>1</SupplierId>
358
+ <SupplierName>Cumberland Hotel</SupplierName>
359
+ <Description>Room Only</Description>
360
+ <Comment>Standard Room</Comment>
361
+ <Locality>PAD</Locality>
362
+ <LocalityDescription>Paddington</LocalityDescription>
363
+ <Class>4*</Class>
364
+ <ClassDescription>4 Star</ClassDescription>
365
+ <SType>Y</SType>
366
+ <SCU>Night</SCU>
367
+ <MinSCU>1</MinSCU>
368
+ <MaxSCU>99</MaxSCU>
369
+ <OptExtras>
370
+ <OptExtra>
371
+ <SequenceNumber>1</SequenceNumber>
372
+ <Description>Porterage</Description>
373
+ <IsPricePerPerson>Y</IsPricePerPerson>
374
+ </OptExtra>
375
+ </OptExtras>
376
+ <VoucherName>Cumberland Hotel</VoucherName>
377
+ <Address1>21 Fleet St</Address1>
378
+ <Address2>London</Address2>
379
+ <Address3></Address3>
380
+ <Address4></Address4>
381
+ <Address5></Address5>
382
+ <PostCode>W1 4TG</PostCode>
383
+ <Single_Avail>Y</Single_Avail>
384
+ <Single_Ad_Max>1</Single_Ad_Max>
385
+ <Twin_Avail>Y</Twin_Avail>
386
+ <Twin_Ad_Max>2</Twin_Ad_Max>
387
+ <Double_Avail>Y</Double_Avail>
388
+ <Double_Ad_Max>2</Double_Ad_Max>
389
+ <Triple_Avail>Y</Triple_Avail>
390
+ <Triple_Ad_Max>3</Triple_Ad_Max>
391
+ <Quad_Avail>N</Quad_Avail>
392
+ <InfantsAllowed>Y</InfantsAllowed>
393
+ <Infant_From>0</Infant_From>
394
+ <Infant_To>3</Infant_To>
395
+ <ChildrenAllowed>Y</ChildrenAllowed>
396
+ <Child_From>4</Child_From>
397
+ <Child_To>12</Child_To>
398
+ <AdultsAllowed>Y</AdultsAllowed>
399
+ <Adult_From>13</Adult_From>
400
+ <Adult_To>99</Adult_To>
401
+ <ButtonName>Accommodation</ButtonName>
402
+ </OptGeneral>
403
+ <OptStayResults>
404
+ <Availability>RQ</Availability>
405
+ <Currency>GBP</Currency>
406
+ <TotalPrice>57600</TotalPrice>
407
+ <RateName>Standard</RateName>
408
+ <RateText>Standard</RateText>
409
+ </OptStayResults>
410
+ </Option>
411
+ <Option>
412
+ <Opt>LONACCUMLONSTDBCB</Opt>
413
+ <OptionNumber>1</OptionNumber>
414
+ <OptGeneral>
415
+ <SupplierId>1</SupplierId>
416
+ <SupplierName>Cumberland Hotel</SupplierName>
417
+ <Description>Bed &amp; Continental Breakfast</Description>
418
+ <Comment>Standard Room</Comment>
419
+ <Locality>PAD</Locality>
420
+ <LocalityDescription>Paddington</LocalityDescription>
421
+ <Class>4*</Class>
422
+ <ClassDescription>4 Star</ClassDescription>
423
+ <SType>Y</SType>
424
+ <SCU>Night</SCU>
425
+ <MinSCU>1</MinSCU>
426
+ <MaxSCU>99</MaxSCU>
427
+ <OptExtras>
428
+ <OptExtra>
429
+ <SequenceNumber>1</SequenceNumber>
430
+ <Description>Porterage</Description>
431
+ <IsPricePerPerson>Y</IsPricePerPerson>
432
+ </OptExtra>
433
+ </OptExtras>
434
+ <VoucherName>Cumberland Hotel</VoucherName>
435
+ <Address1>21 Fleet St</Address1>
436
+ <Address2>London</Address2>
437
+ <Address3></Address3>
438
+ <Address4></Address4>
439
+ <Address5></Address5>
440
+ <PostCode>W1 4TG</PostCode>
441
+ <Single_Avail>Y</Single_Avail>
442
+ <Single_Ad_Max>1</Single_Ad_Max>
443
+ <Twin_Avail>Y</Twin_Avail>
444
+ <Twin_Ad_Max>2</Twin_Ad_Max>
445
+ <Double_Avail>Y</Double_Avail>
446
+ <Double_Ad_Max>2</Double_Ad_Max>
447
+ <Triple_Avail>Y</Triple_Avail>
448
+ <Triple_Ad_Max>3</Triple_Ad_Max>
449
+ <Quad_Avail>N</Quad_Avail>
450
+ <InfantsAllowed>Y</InfantsAllowed>
451
+ <Infant_From>0</Infant_From>
452
+ <Infant_To>3</Infant_To>
453
+ <ChildrenAllowed>Y</ChildrenAllowed>
454
+ <Child_From>4</Child_From>
455
+ <Child_To>12</Child_To>
456
+ <AdultsAllowed>Y</AdultsAllowed>
457
+ <Adult_From>13</Adult_From>
458
+ <Adult_To>99</Adult_To>
459
+ <ButtonName>Accommodation</ButtonName>
460
+ </OptGeneral>
461
+ <OptStayResults>
462
+ <Availability>RQ</Availability>
463
+ <Currency>GBP</Currency>
464
+ <TotalPrice>67200</TotalPrice>
465
+ <RateName>Standard</RateName>
466
+ <RateText>Standard</RateText>
467
+ </OptStayResults>
468
+ </Option>
469
+ </OptionInfoReply>
470
+ </Reply>
@@ -0,0 +1,14 @@
1
+ <?xml version="1.0" encoding="ISO-8859-1"?>
2
+ <!DOCTYPE Reply SYSTEM "http://217.206.100.98:8080/iComNew205/hostConnect_2_05_006.dtd">
3
+ <Reply>
4
+ <OptionInfoReply>
5
+ <Option>
6
+ <Opt>LONACBAILONSTDBCB</Opt>
7
+ <OptionNumber>10</OptionNumber>
8
+ </Option>
9
+ <Option>
10
+ <Opt>LONACHOINKCSTDBEB</Opt>
11
+ <OptionNumber>15</OptionNumber>
12
+ </Option>
13
+ </OptionInfoReply>
14
+ </Reply>
@@ -0,0 +1,74 @@
1
+ <?xml version="1.0" encoding="ISO-8859-1"?>
2
+ <!DOCTYPE Reply SYSTEM "http://www.tourplan.com/support/connector/hostConnect_2_04_170.dtd">
3
+ <Reply>
4
+ <OptionInfoReply>
5
+ <Option>
6
+ <Opt>OSLRTASFIPA10002O</Opt>
7
+ <OptionNumber>5624</OptionNumber>
8
+ <OptGeneral>
9
+ <SupplierId>2773</SupplierId>
10
+ <SupplierName>Authentic Scandinavia Tours</SupplierName>
11
+ <Description>Norway in a Nutshell</Description>
12
+ <Comment>Cat2/Start Oslo</Comment>
13
+ <Locality>FIT</Locality>
14
+ <LocalityDescription>Round-trips</LocalityDescription>
15
+ <Periods>5</Periods>
16
+ <SType>P</SType>
17
+ <VoucherName>Authentic Scandinavia Tours</VoucherName>
18
+ <Address1></Address1>
19
+ <Address2></Address2>
20
+ <Address3></Address3>
21
+ <Address4></Address4>
22
+ <Address5></Address5>
23
+ <PostCode></PostCode>
24
+ <Single_Avail>Y</Single_Avail>
25
+ <Single_Ad_Max>1</Single_Ad_Max>
26
+ <Twin_Avail>Y</Twin_Avail>
27
+ <Twin_Ad_Max>2</Twin_Ad_Max>
28
+ <Double_Avail>Y</Double_Avail>
29
+ <Double_Ad_Max>2</Double_Ad_Max>
30
+ <Triple_Avail>Y</Triple_Avail>
31
+ <Triple_Ad_Max>3</Triple_Ad_Max>
32
+ <Quad_Avail>Y</Quad_Avail>
33
+ <Quad_Ad_Max>4</Quad_Ad_Max>
34
+ <InfantsAllowed>Y</InfantsAllowed>
35
+ <ChildrenAllowed>Y</ChildrenAllowed>
36
+ <AdultsAllowed>Y</AdultsAllowed>
37
+ </OptGeneral>
38
+ </Option>
39
+ <Option>
40
+ <Opt>OSLRTASFIPA10001O</Opt>
41
+ <OptionNumber>5614</OptionNumber>
42
+ <OptGeneral>
43
+ <SupplierId>2773</SupplierId>
44
+ <SupplierName>Authentic Scandinavia Tours</SupplierName>
45
+ <Description>Norway in a Nutshell</Description>
46
+ <Comment>Cat1/Start Oslo</Comment>
47
+ <Locality>FIT</Locality>
48
+ <LocalityDescription>Round-trips</LocalityDescription>
49
+ <Periods>5</Periods>
50
+ <SType>P</SType>
51
+ <VoucherName>Authentic Scandinavia Tours</VoucherName>
52
+ <Address1></Address1>
53
+ <Address2></Address2>
54
+ <Address3></Address3>
55
+ <Address4></Address4>
56
+ <Address5></Address5>
57
+ <PostCode></PostCode>
58
+ <Single_Avail>Y</Single_Avail>
59
+ <Single_Ad_Max>1</Single_Ad_Max>
60
+ <Twin_Avail>Y</Twin_Avail>
61
+ <Twin_Ad_Max>2</Twin_Ad_Max>
62
+ <Double_Avail>Y</Double_Avail>
63
+ <Double_Ad_Max>2</Double_Ad_Max>
64
+ <Triple_Avail>Y</Triple_Avail>
65
+ <Triple_Ad_Max>3</Triple_Ad_Max>
66
+ <Quad_Avail>Y</Quad_Avail>
67
+ <Quad_Ad_Max>4</Quad_Ad_Max>
68
+ <InfantsAllowed>Y</InfantsAllowed>
69
+ <ChildrenAllowed>Y</ChildrenAllowed>
70
+ <AdultsAllowed>Y</AdultsAllowed>
71
+ </OptGeneral>
72
+ </Option>
73
+ </OptionInfoReply>
74
+ </Reply>
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="ISO-8859-1"?>
2
+ <!DOCTYPE Reply SYSTEM "http://217.206.100.98:8080/iComNew205/hostConnect_2_05_006.dtd">
3
+ <Reply>
4
+ <PingReply>
5
+ <Version>2.05.048</Version>
6
+ <Backend>iS</Backend>
7
+ </PingReply>
8
+ </Reply>
@@ -0,0 +1,13 @@
1
+ require File.dirname(__FILE__) + "/../spec_helper"
2
+
3
+ describe HostConnect::AddService do
4
+ it "should contain service data" do
5
+ @response = File.read("./spec/fixtures/responses/add_service.xml")
6
+ add_service = AddService.new(@response)
7
+ add_service.booking_id.should == 6050
8
+ add_service.ref.should == "ASIN100101"
9
+ add_service.service_line_id.should == 55418
10
+ add_service.sequence_number.should == 10
11
+ add_service.status.should == "RQ"
12
+ end
13
+ end
@@ -0,0 +1,24 @@
1
+ require File.dirname(__FILE__) + "/../spec_helper"
2
+
3
+ describe HostConnect::AgentInfo do
4
+ before(:each) do
5
+ @response = File.read("./spec/fixtures/responses/agent_info.xml")
6
+ end
7
+
8
+ it "should return an object with attributes set from the response" do
9
+ agent = AgentInfo.new(@response)
10
+ agent.currency.should == "GBP"
11
+ agent.email.should be_nil
12
+ agent.name.should == "European Tours & Travel"
13
+ agent.price_codes.should == "2ST"
14
+ agent.is_sub_login?.should be_false
15
+ agent.has_booking_rights?.should be_false
16
+ agent.has_booking_rights.should be_false
17
+ end
18
+
19
+ it "should raise error on incorrect login/pass" do
20
+ error = File.read("./spec/fixtures/responses/agent_info_error.xml")
21
+ lambda { AgentInfo.new(error) }.should raise_error(ArgumentError,
22
+ "1051 SCN EURTAT (Agent not found (or wrong password given).)")
23
+ end
24
+ end
@@ -0,0 +1,33 @@
1
+ require File.dirname(__FILE__) + "/../spec_helper"
2
+
3
+ describe HostConnect::GetLocations do
4
+ before(:each) do
5
+ response = File.read("./spec/fixtures/responses/get_booking.xml")
6
+ @booking = GetBooking.new(response)
7
+ end
8
+
9
+ it "should return an object with attributes set from the response" do
10
+ @booking.booking_id.should == 6051
11
+ @booking.ref.should == "ASIN100102"
12
+ @booking.booking_update_count.should == 61
13
+ @booking.name.should == "Jessop Mr/Mrs"
14
+ @booking.qb.should == "B"
15
+ @booking.email.should == "Test av kontaktinfo"
16
+ @booking.travel_date.should be_an_instance_of Date
17
+ @booking.travel_date.to_s.should == "2008-10-08"
18
+ @booking.entered_date.to_s.should == "2008-07-30"
19
+ @booking.booking_status.should == "Internet Booking"
20
+ @booking.should_not be_read_only
21
+ @booking.is_internet_booking?.should be_true
22
+ @booking.currency.should == "EUR"
23
+ @booking.total_price.should == 1318
24
+ end
25
+
26
+ it "should include an array with service lines" do
27
+ @booking.services.size.should == 1
28
+ @service = @booking.services[0]
29
+ @service.service_line_id.should == 55440
30
+ @service.service_line_update_count.should == 3
31
+ @service.opt.should == "OSLRTASFIPA10001O"
32
+ end
33
+ end
@@ -0,0 +1,29 @@
1
+ require File.dirname(__FILE__) + "/../spec_helper"
2
+
3
+ describe HostConnect::GetLocations do
4
+ before(:each) do
5
+ response = File.read("./spec/fixtures/responses/get_locations.xml")
6
+ @locations = GetLocations.new(response)
7
+ end
8
+
9
+ it "should return an object with attributes set from the response" do
10
+ @locations.size.should == 10
11
+ @locations.first.code.should == "AAA"
12
+ @locations.first.name.should == "Andorra"
13
+ @locations.last.code.should == "PAR"
14
+ @locations.last.name.should == "Paris"
15
+ end
16
+
17
+ it "should act like an array" do
18
+ @locations[0].should == @locations.first
19
+ end
20
+
21
+ it "should be enumerable" do
22
+ i = 0
23
+ @locations.each do |location|
24
+ location.code.size.should == 3
25
+ i += 1
26
+ end
27
+ i.should == 10
28
+ end
29
+ end