1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace DJStarCOM\BookingComSDK\Query; |
4
|
|
|
|
5
|
|
|
use DateTime; |
6
|
|
|
use DJStarCOM\BookingComSDK\Models\ProcessBooking; |
7
|
|
|
use DJStarCOM\BookingComSDK\Models\Result; |
8
|
|
|
|
9
|
|
|
class ProcessBookingQuery extends Query |
10
|
|
|
{ |
11
|
|
|
const PAY_TYPE_AMERICAN_EXPRESS = 1; |
12
|
|
|
const PAY_TYPE_VISA = 2; |
13
|
|
|
const PAY_TYPE_MASTERCARD = 3; |
14
|
|
|
const PAY_TYPE_DINERS_CLUB = 5; |
15
|
|
|
|
16
|
|
|
/** |
17
|
|
|
* @var string |
18
|
|
|
*/ |
19
|
|
|
protected static $uri = '/processBooking'; |
20
|
|
|
|
21
|
|
|
/** |
22
|
|
|
* Telephone number of the booker. |
23
|
|
|
* example value "+00000000000" |
24
|
|
|
* |
25
|
|
|
* @var array required |
26
|
|
|
*/ |
27
|
|
|
protected $booker_telephone; |
28
|
|
|
|
29
|
|
|
/** |
30
|
|
|
* Country of the booker. |
31
|
|
|
* example value "nl" |
32
|
|
|
* |
33
|
|
|
* possible values. |
34
|
|
|
* There is a long list of possible values for this parameter. |
35
|
|
|
* Please see Values for countries: |
36
|
|
|
* https://developers.booking.com/api/commercial/index.html?page_url=possible-values |
37
|
|
|
* languages, airports, currencies for the full list. |
38
|
|
|
* |
39
|
|
|
* @var string required |
40
|
|
|
*/ |
41
|
|
|
protected $booker_country; |
42
|
|
|
|
43
|
|
|
/** |
44
|
|
|
* Id of the hotel where the booked blocks are. |
45
|
|
|
* Only one id may be specified per /processBooking endpoint. |
46
|
|
|
* example value 11024 |
47
|
|
|
* |
48
|
|
|
* @var int required |
49
|
|
|
*/ |
50
|
|
|
protected $hotel_id; |
51
|
|
|
|
52
|
|
|
/** |
53
|
|
|
* The affiliate id for which this booking should be processed. |
54
|
|
|
* It may be overridden by {partner_affiliate_id}. |
55
|
|
|
* example value 000000 |
56
|
|
|
* |
57
|
|
|
* @var int required |
58
|
|
|
*/ |
59
|
|
|
protected $affiliate_id; |
60
|
|
|
|
61
|
|
|
/** |
62
|
|
|
* One or multiple block ids. One should use {block_quantities} |
63
|
|
|
* to specify the quantity of blocks per block_ids that are passed. |
64
|
|
|
* |
65
|
|
|
* example value 5555555_55555555_5_5_5 |
66
|
|
|
* depends on incremental_prices |
67
|
|
|
* |
68
|
|
|
* @var array required |
69
|
|
|
*/ |
70
|
|
|
protected $block_ids; |
71
|
|
|
|
72
|
|
|
/** |
73
|
|
|
* Booking checkin date. It may be today or within 360 days in the future. |
74
|
|
|
* example value 2018-10-11 |
75
|
|
|
* |
76
|
|
|
* @var string required |
77
|
|
|
*/ |
78
|
|
|
protected $checkin; |
79
|
|
|
|
80
|
|
|
/** |
81
|
|
|
* Booking checkout date. It may be between 1 and 30 days after the {checkin}. |
82
|
|
|
* |
83
|
|
|
* @var string required |
84
|
|
|
*/ |
85
|
|
|
protected $checkout; |
86
|
|
|
|
87
|
|
|
/** |
88
|
|
|
* Email address of the |
89
|
|
|
* example value [email protected] |
90
|
|
|
* |
91
|
|
|
* @var string required |
92
|
|
|
*/ |
93
|
|
|
protected $booker_email; |
94
|
|
|
|
95
|
|
|
/** |
96
|
|
|
* A comma-separated list of add ons, given in same order as guest_quantities. |
97
|
|
|
* Multiple add ons per item are semicolon-separated (%3B). |
98
|
|
|
* The format of one add on is ADDON_{block_id}_{addon_id}:{price}. |
99
|
|
|
* |
100
|
|
|
* @var array |
101
|
|
|
*/ |
102
|
|
|
protected $addon_prices; |
103
|
|
|
|
104
|
|
|
/** |
105
|
|
|
* The affiliate label information, that may be added to the booking during processing. |
106
|
|
|
* One can then read it back in /bookingDetails. |
107
|
|
|
* |
108
|
|
|
* @var string |
109
|
|
|
*/ |
110
|
|
|
protected $affiliate_label; |
111
|
|
|
|
112
|
|
|
/** |
113
|
|
|
* A comma-separated list of bed preferences, given in same order as room_ids or block_ids, |
114
|
|
|
* taking into account their quantities. Use 0 for no preference, |
115
|
|
|
* 1 for default or 2 for alternative. Please note that it can |
116
|
|
|
* not be guaranteed that the selected preference will be available. |
117
|
|
|
* example value 0 |
118
|
|
|
* possible values 0, 1, 2 |
119
|
|
|
* |
120
|
|
|
* @var array |
121
|
|
|
*/ |
122
|
|
|
protected $bed_preferences; |
123
|
|
|
|
124
|
|
|
/** |
125
|
|
|
* An comma-separated list of preferred bed types, given in same order |
126
|
|
|
* as room_ids or block_ids, taking into account their quantities. |
127
|
|
|
* If only one bed type is supplied, it will apply to all rooms/blocks. |
128
|
|
|
* Use 0 for no preference, 1 for single/twin beds, 2 for double beds. |
129
|
|
|
* Please note that it can not be guaranteed that the selected preference will be available. |
130
|
|
|
* example value 0 |
131
|
|
|
* possible values 0, 1, 2 |
132
|
|
|
* |
133
|
|
|
* @var array |
134
|
|
|
*/ |
135
|
|
|
protected $bedtype_preferences; |
136
|
|
|
|
137
|
|
|
/** |
138
|
|
|
* Quantities of blocks that should be booked. In case that multiple block_ids |
139
|
|
|
* are specified under {block_ids}, one number per block_id should be given |
140
|
|
|
* in this input parameter. These quantities may only be between 1 and 10. |
141
|
|
|
* They also may not exceed the available number of blocks (for all prices). |
142
|
|
|
* To determine how many rooms can be booked for each block_id, refer to number |
143
|
|
|
* of <incremental_price> field or {extras=max_rooms_in_reservation} parameter in /BlockAvailability |
144
|
|
|
* example value 1 |
145
|
|
|
* |
146
|
|
|
* @var array |
147
|
|
|
*/ |
148
|
|
|
protected $block_quantities; |
149
|
|
|
|
150
|
|
|
/** |
151
|
|
|
* Street address of the booker. To determine if the address is required, |
152
|
|
|
* use {extras=address_required} in /blockAvailability |
153
|
|
|
* example value "Herengracht 597" |
154
|
|
|
* |
155
|
|
|
* @var string |
156
|
|
|
*/ |
157
|
|
|
protected $booker_address; |
158
|
|
|
|
159
|
|
|
/** |
160
|
|
|
* City of the booker. |
161
|
|
|
* example value "Amsterdam" |
162
|
|
|
* |
163
|
|
|
* @var string |
164
|
|
|
*/ |
165
|
|
|
protected $booker_city; |
166
|
|
|
|
167
|
|
|
/** |
168
|
|
|
* Company of the booker. |
169
|
|
|
* @var string |
170
|
|
|
*/ |
171
|
|
|
protected $booker_company; |
172
|
|
|
|
173
|
|
|
/** |
174
|
|
|
* First name of the booker (up to 255 characters). |
175
|
|
|
* example value "John" |
176
|
|
|
* depends on "booker_lastname" |
177
|
|
|
* |
178
|
|
|
* @var string |
179
|
|
|
*/ |
180
|
|
|
protected $booker_firstname; |
181
|
|
|
|
182
|
|
|
/** |
183
|
|
|
* IP address of the booker. It is used to determine guest country. |
184
|
|
|
* It may be overridden by {i_am_from}. It supports the IPv4 format. |
185
|
|
|
* example value "0.0.0.0" |
186
|
|
|
* |
187
|
|
|
* @var string |
188
|
|
|
*/ |
189
|
|
|
protected $booker_ip; |
190
|
|
|
|
191
|
|
|
/** |
192
|
|
|
* Language used by the booker to make the booking. |
193
|
|
|
* example value "en" |
194
|
|
|
* |
195
|
|
|
* @var string |
196
|
|
|
*/ |
197
|
|
|
protected $booker_language; |
198
|
|
|
|
199
|
|
|
/** |
200
|
|
|
* Last name of the booker (up to 255 characters). |
201
|
|
|
* example value "Smith" |
202
|
|
|
* depends on "booker_firstname" |
203
|
|
|
* |
204
|
|
|
* @var string |
205
|
|
|
*/ |
206
|
|
|
protected $booker_lastname; |
207
|
|
|
|
208
|
|
|
/** |
209
|
|
|
* Zip code of the booker. |
210
|
|
|
* |
211
|
|
|
* @var string |
212
|
|
|
*/ |
213
|
|
|
protected $booker_zip; |
214
|
|
|
|
215
|
|
|
/** |
216
|
|
|
* Name of the credit card holder. |
217
|
|
|
* |
218
|
|
|
* @var string |
219
|
|
|
*/ |
220
|
|
|
protected $cc_cardholder; |
221
|
|
|
|
222
|
|
|
/** |
223
|
|
|
* Three digit validation code of the credit card. |
224
|
|
|
* example value "000" |
225
|
|
|
* |
226
|
|
|
* @var string |
227
|
|
|
*/ |
228
|
|
|
protected $cc_cvc; |
229
|
|
|
|
230
|
|
|
/** |
231
|
|
|
* Expiry date of the credit card. Please note that only the year and month will be used |
232
|
|
|
* and the day number will be ignored.* |
233
|
|
|
* example value "0000-00-00" |
234
|
|
|
* |
235
|
|
|
* @var string |
236
|
|
|
*/ |
237
|
|
|
protected $cc_expiration_date; |
238
|
|
|
|
239
|
|
|
/** |
240
|
|
|
* Number of the credit card. |
241
|
|
|
* example value "0000000000000000" |
242
|
|
|
* @var string |
243
|
|
|
*/ |
244
|
|
|
protected $cc_number; |
245
|
|
|
|
246
|
|
|
/** |
247
|
|
|
* Type of the credit card. It may be one of 1, 2, 3 or one of the credit card types |
248
|
|
|
* accepted by the booked hotel. Also see the /paymentTypes endpoint. |
249
|
|
|
* example value 3 |
250
|
|
|
* conflicts with cc_organisation |
251
|
|
|
* @var int |
252
|
|
|
*/ |
253
|
|
|
protected $cc_type; |
254
|
|
|
|
255
|
|
|
/** |
256
|
|
|
* Optional remarks from the guest. |
257
|
|
|
* example value "Arriving shortly after midnight." |
258
|
|
|
* |
259
|
|
|
* @var string |
260
|
|
|
*/ |
261
|
|
|
protected $comments; |
262
|
|
|
|
263
|
|
|
/** |
264
|
|
|
* Currency used for direct payments may be specified here. |
265
|
|
|
* example value "EUR" |
266
|
|
|
* possible values. There is a long list of possible values for this parameter |
267
|
|
|
* (https://developers.booking.com/api/commercial/index.html?page_url=possible-values). |
268
|
|
|
* Please see Values for countries, |
269
|
|
|
* languages, airports, currencies for the full list. |
270
|
|
|
* |
271
|
|
|
* @var string |
272
|
|
|
*/ |
273
|
|
|
protected $currency; |
274
|
|
|
|
275
|
|
|
/** |
276
|
|
|
* Specify here what extra items of the result should be included. |
277
|
|
|
* See the endpoint description for more detailed information about each extra. |
278
|
|
|
* possible values hotel_contact_info |
279
|
|
|
* |
280
|
|
|
* @var array |
281
|
|
|
*/ |
282
|
|
|
protected $extras; |
283
|
|
|
|
284
|
|
|
/** |
285
|
|
|
* Allows partners to forward the booker's user agent. This information |
286
|
|
|
* is stored into the transaction for the record. |
287
|
|
|
* example value "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:54.0) Gecko/20100101 Firefox/54.0" |
288
|
|
|
* |
289
|
|
|
* @var string |
290
|
|
|
*/ |
291
|
|
|
protected $forwarded_user_agent; |
292
|
|
|
|
293
|
|
|
/** |
294
|
|
|
* A comma-separated list of guest emails. If provided this list should be of the same length as guest_names. |
295
|
|
|
* example value "[email protected]" |
296
|
|
|
* |
297
|
|
|
* @var array |
298
|
|
|
*/ |
299
|
|
|
protected $guest_emails; |
300
|
|
|
|
301
|
|
|
/** |
302
|
|
|
* A comma-separated list of guest names. If booker_firstname and booker_lastname are used, |
303
|
|
|
* then this list should be of same size or shorter than quantity of rooms or blocks given. |
304
|
|
|
* Otherwise, the first name in {guest_names} is the name of the booker followed by guests names, |
305
|
|
|
* not longer than the quantity of rooms + 1. First is booker's name of the booker, |
306
|
|
|
* then followed by names of other guests. |
307
|
|
|
* example value "John Smith" |
308
|
|
|
* |
309
|
|
|
* @var array |
310
|
|
|
*/ |
311
|
|
|
protected $guest_names; |
312
|
|
|
|
313
|
|
|
/** |
314
|
|
|
* Quantities of guests per block, given in same order as block_ids, with block_quantities on mind. |
315
|
|
|
* This number should not exceed [hotel][block]{max_occupancy}. |
316
|
|
|
* example value "1" |
317
|
|
|
* |
318
|
|
|
* @var array |
319
|
|
|
*/ |
320
|
|
|
protected $guest_quantities; |
321
|
|
|
|
322
|
|
|
/** |
323
|
|
|
* Guests' approximate hour of arrival to the hotel on the {checkin} date. |
324
|
|
|
* Allowed values are from 0 (00:00 - 01:00) to 25 (01:00 - 02:00 (the next day)). |
325
|
|
|
* This time should be within the hotel reception hours, or will be ignored otherwise with |
326
|
|
|
* a warning appended to guestd comments. |
327
|
|
|
* example value 12 |
328
|
|
|
* possible values 0, ... , 25 |
329
|
|
|
* |
330
|
|
|
* @var string |
331
|
|
|
*/ |
332
|
|
|
protected $hour_of_arrival; |
333
|
|
|
|
334
|
|
|
/** |
335
|
|
|
* Comma-separated list of total prices for each supplied block_id, given in the same order |
336
|
|
|
* as block_ids and block_quantities. |
337
|
|
|
* example value 105.95 |
338
|
|
|
* |
339
|
|
|
* @var array |
340
|
|
|
*/ |
341
|
|
|
protected $incremental_prices; |
342
|
|
|
|
343
|
|
|
/** |
344
|
|
|
* Use this to see predictions of booker's next destinations. |
345
|
|
|
* The supplied number tells how many destinations should be showed at most. |
346
|
|
|
* example value 3 |
347
|
|
|
* |
348
|
|
|
* @var int |
349
|
|
|
*/ |
350
|
|
|
protected $next_trips; |
351
|
|
|
|
352
|
|
|
/** |
353
|
|
|
* Specify here the options for this request. See the endpoint description |
354
|
|
|
* for more detailed information about each option. |
355
|
|
|
* possible values |
356
|
|
|
* booker_mailinglist_signup, use_booker_country, front_desk_24h, |
357
|
|
|
* use_guest_quantities_for_charges, allow_past |
358
|
|
|
* |
359
|
|
|
* @var array |
360
|
|
|
*/ |
361
|
|
|
protected $options; |
362
|
|
|
|
363
|
|
|
/** |
364
|
|
|
* Unique id that identifies the request from client point of view |
365
|
|
|
* example value "00000000-0000-0000-0000-000000000000" |
366
|
|
|
* |
367
|
|
|
* @var string |
368
|
|
|
*/ |
369
|
|
|
protected $request_id; |
370
|
|
|
|
371
|
|
|
/** |
372
|
|
|
* Enable bookings on test hotels (useful for debugging). Note: don't use this setting |
373
|
|
|
* for making test bookings on live hotels! |
374
|
|
|
* example value 0 |
375
|
|
|
* possible values 0, 1 |
376
|
|
|
* |
377
|
|
|
* @var int |
378
|
|
|
*/ |
379
|
|
|
protected $show_test; |
380
|
|
|
|
381
|
|
|
/** |
382
|
|
|
* A comma-separated list of smoking preferences, given in same order as room_ids or block_ids, |
383
|
|
|
* taking into account their quantities. If only one smoking preference is supplied, |
384
|
|
|
* it applies to all rooms/blocks. Use 0 for no preference, 1 for non-smoking preferred, |
385
|
|
|
* 2 for smoking preferred. |
386
|
|
|
* Please note that it can not be guaranteed that the selected preference will be available. |
387
|
|
|
* example value 2 |
388
|
|
|
* possible values 0, 1, 2 |
389
|
|
|
* |
390
|
|
|
* @var array |
391
|
|
|
*/ |
392
|
|
|
protected $smoking_preferences; |
393
|
|
|
|
394
|
|
|
/** |
395
|
|
|
* Check all input parameters and availability without making a real reservation. This is useful for debugging, |
396
|
|
|
* all the booking steps prior to making the reservation will take place |
397
|
|
|
* The inventory won't be modified and no transaction_id will be returned. |
398
|
|
|
* example value 0 |
399
|
|
|
* possible values 0, 1 |
400
|
|
|
* |
401
|
|
|
* @var int |
402
|
|
|
*/ |
403
|
|
|
protected $test_mode; |
404
|
|
|
|
405
|
|
|
/** |
406
|
|
|
* Booker's choice of travel purpose. It may be 'business' or 'leisure'. |
407
|
|
|
* example value business |
408
|
|
|
* possible values business, leisure |
409
|
|
|
* |
410
|
|
|
* @var string |
411
|
|
|
*/ |
412
|
|
|
protected $travel_purpose; |
413
|
|
|
|
414
|
|
|
/** |
415
|
|
|
* @return array |
416
|
|
|
*/ |
417
|
|
|
public function getBookerTelephone(): array |
418
|
|
|
{ |
419
|
|
|
return $this->booker_telephone; |
420
|
|
|
} |
421
|
|
|
|
422
|
|
|
/** |
423
|
|
|
* @param array $booker_telephone |
424
|
|
|
* @return $this |
425
|
|
|
*/ |
426
|
|
|
public function setBookerTelephone(array $booker_telephone): self |
427
|
|
|
{ |
428
|
|
|
$this->booker_telephone = $booker_telephone; |
429
|
|
|
return $this; |
430
|
|
|
} |
431
|
|
|
|
432
|
|
|
/** |
433
|
|
|
* @return string |
434
|
|
|
*/ |
435
|
|
|
public function getBookerCountry(): string |
436
|
|
|
{ |
437
|
|
|
return $this->booker_country; |
438
|
|
|
} |
439
|
|
|
|
440
|
|
|
/** |
441
|
|
|
* @param string $booker_country |
442
|
|
|
* @return $this |
443
|
|
|
*/ |
444
|
|
|
public function setBookerCountry(string $booker_country): self |
445
|
|
|
{ |
446
|
|
|
$this->booker_country = $booker_country; |
447
|
|
|
return $this; |
448
|
|
|
} |
449
|
|
|
|
450
|
|
|
/** |
451
|
|
|
* @return int |
452
|
|
|
*/ |
453
|
|
|
public function getHotelId(): int |
454
|
|
|
{ |
455
|
|
|
return $this->hotel_id; |
456
|
|
|
} |
457
|
|
|
|
458
|
|
|
/** |
459
|
|
|
* @param int $hotel_id |
460
|
|
|
* @return $this |
461
|
|
|
*/ |
462
|
|
|
public function setHotelId(int $hotel_id): self |
463
|
|
|
{ |
464
|
|
|
$this->hotel_id = $hotel_id; |
465
|
|
|
return $this; |
466
|
|
|
} |
467
|
|
|
|
468
|
|
|
/** |
469
|
|
|
* @return int |
470
|
|
|
*/ |
471
|
|
|
public function getAffiliateId(): int |
472
|
|
|
{ |
473
|
|
|
return $this->affiliate_id; |
474
|
|
|
} |
475
|
|
|
|
476
|
|
|
/** |
477
|
|
|
* @param int $affiliate_id |
478
|
|
|
* @return $this |
479
|
|
|
*/ |
480
|
|
|
public function setAffiliateId(int $affiliate_id): self |
481
|
|
|
{ |
482
|
|
|
$this->affiliate_id = $affiliate_id; |
483
|
|
|
return $this; |
484
|
|
|
} |
485
|
|
|
|
486
|
|
|
/** |
487
|
|
|
* @return array |
488
|
|
|
*/ |
489
|
|
|
public function getBlockIds(): array |
490
|
|
|
{ |
491
|
|
|
return $this->block_ids; |
492
|
|
|
} |
493
|
|
|
|
494
|
|
|
/** |
495
|
|
|
* @param array $block_ids |
496
|
|
|
* @return $this |
497
|
|
|
*/ |
498
|
|
|
public function setBlockIds(array $block_ids): self |
499
|
|
|
{ |
500
|
|
|
$this->block_ids = $block_ids; |
501
|
|
|
return $this; |
502
|
|
|
} |
503
|
|
|
|
504
|
|
|
/** |
505
|
|
|
* @return string |
506
|
|
|
*/ |
507
|
|
|
public function getCheckin(): string |
508
|
|
|
{ |
509
|
|
|
return $this->checkin; |
510
|
|
|
} |
511
|
|
|
|
512
|
|
|
/** |
513
|
|
|
* @param DateTime $checkin |
514
|
|
|
* @return self |
515
|
|
|
*/ |
516
|
|
|
public function setCheckin(DateTime $checkin): self |
517
|
|
|
{ |
518
|
|
|
$this->checkin = $checkin->format('Y-m-d'); |
519
|
|
|
|
520
|
|
|
return $this; |
521
|
|
|
} |
522
|
|
|
|
523
|
|
|
/** |
524
|
|
|
* @return string |
525
|
|
|
*/ |
526
|
|
|
public function getCheckout(): string |
527
|
|
|
{ |
528
|
|
|
return $this->checkout; |
529
|
|
|
} |
530
|
|
|
|
531
|
|
|
/** |
532
|
|
|
* @param DateTime $checkout |
533
|
|
|
* @return self |
534
|
|
|
*/ |
535
|
|
|
public function setCheckout(DateTime $checkout): self |
536
|
|
|
{ |
537
|
|
|
$this->checkout = $checkout->format('Y-m-d'); |
538
|
|
|
|
539
|
|
|
return $this; |
540
|
|
|
} |
541
|
|
|
|
542
|
|
|
/** |
543
|
|
|
* @return string |
544
|
|
|
*/ |
545
|
|
|
public function getBookerEmail(): string |
546
|
|
|
{ |
547
|
|
|
return $this->booker_email; |
548
|
|
|
} |
549
|
|
|
|
550
|
|
|
/** |
551
|
|
|
* @param string $booker_email |
552
|
|
|
* @return $this |
553
|
|
|
*/ |
554
|
|
|
public function setBookerEmail(string $booker_email): self |
555
|
|
|
{ |
556
|
|
|
$this->booker_email = $booker_email; |
557
|
|
|
return $this; |
558
|
|
|
} |
559
|
|
|
|
560
|
|
|
/** |
561
|
|
|
* @return array |
562
|
|
|
*/ |
563
|
|
|
public function getAddonPrices(): array |
564
|
|
|
{ |
565
|
|
|
return $this->addon_prices; |
566
|
|
|
} |
567
|
|
|
|
568
|
|
|
/** |
569
|
|
|
* @param array $addon_prices |
570
|
|
|
* @return $this |
571
|
|
|
*/ |
572
|
|
|
public function setAddonPrices(array $addon_prices): self |
573
|
|
|
{ |
574
|
|
|
$this->addon_prices = $addon_prices; |
575
|
|
|
return $this; |
576
|
|
|
} |
577
|
|
|
|
578
|
|
|
/** |
579
|
|
|
* @return string |
580
|
|
|
*/ |
581
|
|
|
public function getAffiliateLabel(): string |
582
|
|
|
{ |
583
|
|
|
return $this->affiliate_label; |
584
|
|
|
} |
585
|
|
|
|
586
|
|
|
/** |
587
|
|
|
* @param string $affiliate_label |
588
|
|
|
* @return $this |
589
|
|
|
*/ |
590
|
|
|
public function setAffiliateLabel(string $affiliate_label): self |
591
|
|
|
{ |
592
|
|
|
$this->affiliate_label = $affiliate_label; |
593
|
|
|
return $this; |
594
|
|
|
} |
595
|
|
|
|
596
|
|
|
/** |
597
|
|
|
* @return array |
598
|
|
|
*/ |
599
|
|
|
public function getBedPreferences(): array |
600
|
|
|
{ |
601
|
|
|
return $this->bed_preferences; |
602
|
|
|
} |
603
|
|
|
|
604
|
|
|
/** |
605
|
|
|
* @param array $bed_preferences |
606
|
|
|
* @return $this |
607
|
|
|
*/ |
608
|
|
|
public function setBedPreferences(array $bed_preferences): self |
609
|
|
|
{ |
610
|
|
|
$this->bed_preferences = $bed_preferences; |
611
|
|
|
return $this; |
612
|
|
|
} |
613
|
|
|
|
614
|
|
|
/** |
615
|
|
|
* @return array |
616
|
|
|
*/ |
617
|
|
|
public function getBedtypePreferences(): array |
618
|
|
|
{ |
619
|
|
|
return $this->bedtype_preferences; |
620
|
|
|
} |
621
|
|
|
|
622
|
|
|
/** |
623
|
|
|
* @param array $bedtype_preferences |
624
|
|
|
* @return $this |
625
|
|
|
*/ |
626
|
|
|
public function setBedtypePreferences(array $bedtype_preferences): self |
627
|
|
|
{ |
628
|
|
|
$this->bedtype_preferences = $bedtype_preferences; |
629
|
|
|
return $this; |
630
|
|
|
} |
631
|
|
|
|
632
|
|
|
/** |
633
|
|
|
* @return array |
634
|
|
|
*/ |
635
|
|
|
public function getBlockQuantities(): array |
636
|
|
|
{ |
637
|
|
|
return $this->block_quantities; |
638
|
|
|
} |
639
|
|
|
|
640
|
|
|
/** |
641
|
|
|
* @param array $block_quantities |
642
|
|
|
* @return $this |
643
|
|
|
*/ |
644
|
|
|
public function setBlockQuantities(array $block_quantities): self |
645
|
|
|
{ |
646
|
|
|
$this->block_quantities = $block_quantities; |
647
|
|
|
return $this; |
648
|
|
|
} |
649
|
|
|
|
650
|
|
|
/** |
651
|
|
|
* @return string |
652
|
|
|
*/ |
653
|
|
|
public function getBookerAddress(): string |
654
|
|
|
{ |
655
|
|
|
return $this->booker_address; |
656
|
|
|
} |
657
|
|
|
|
658
|
|
|
/** |
659
|
|
|
* @param string $booker_address |
660
|
|
|
* @return $this |
661
|
|
|
*/ |
662
|
|
|
public function setBookerAddress(string $booker_address): self |
663
|
|
|
{ |
664
|
|
|
$this->booker_address = $booker_address; |
665
|
|
|
return $this; |
666
|
|
|
} |
667
|
|
|
|
668
|
|
|
/** |
669
|
|
|
* @return string |
670
|
|
|
*/ |
671
|
|
|
public function getBookerCity(): string |
672
|
|
|
{ |
673
|
|
|
return $this->booker_city; |
674
|
|
|
} |
675
|
|
|
|
676
|
|
|
/** |
677
|
|
|
* @param string $booker_city |
678
|
|
|
* @return $this |
679
|
|
|
*/ |
680
|
|
|
public function setBookerCity(string $booker_city): self |
681
|
|
|
{ |
682
|
|
|
$this->booker_city = $booker_city; |
683
|
|
|
return $this; |
684
|
|
|
} |
685
|
|
|
|
686
|
|
|
/** |
687
|
|
|
* @return string |
688
|
|
|
*/ |
689
|
|
|
public function getBookerCompany(): string |
690
|
|
|
{ |
691
|
|
|
return $this->booker_company; |
692
|
|
|
} |
693
|
|
|
|
694
|
|
|
/** |
695
|
|
|
* @param string $booker_company |
696
|
|
|
* @return $this |
697
|
|
|
*/ |
698
|
|
|
public function setBookerCompany(string $booker_company): self |
699
|
|
|
{ |
700
|
|
|
$this->booker_company = $booker_company; |
701
|
|
|
return $this; |
702
|
|
|
} |
703
|
|
|
|
704
|
|
|
/** |
705
|
|
|
* @return string |
706
|
|
|
*/ |
707
|
|
|
public function getBookerFirstname(): string |
708
|
|
|
{ |
709
|
|
|
return $this->booker_firstname; |
710
|
|
|
} |
711
|
|
|
|
712
|
|
|
/** |
713
|
|
|
* @param string $booker_firstname |
714
|
|
|
* @return $this |
715
|
|
|
*/ |
716
|
|
|
public function setBookerFirstname(string $booker_firstname): self |
717
|
|
|
{ |
718
|
|
|
$this->booker_firstname = $booker_firstname; |
719
|
|
|
return $this; |
720
|
|
|
} |
721
|
|
|
|
722
|
|
|
/** |
723
|
|
|
* @return string |
724
|
|
|
*/ |
725
|
|
|
public function getBookerIp(): string |
726
|
|
|
{ |
727
|
|
|
return $this->booker_ip; |
728
|
|
|
} |
729
|
|
|
|
730
|
|
|
/** |
731
|
|
|
* @param string $booker_ip |
732
|
|
|
* @return $this |
733
|
|
|
*/ |
734
|
|
|
public function setBookerIp(string $booker_ip): self |
735
|
|
|
{ |
736
|
|
|
$this->booker_ip = $booker_ip; |
737
|
|
|
return $this; |
738
|
|
|
} |
739
|
|
|
|
740
|
|
|
/** |
741
|
|
|
* @return string |
742
|
|
|
*/ |
743
|
|
|
public function getBookerLanguage(): string |
744
|
|
|
{ |
745
|
|
|
return $this->booker_language; |
746
|
|
|
} |
747
|
|
|
|
748
|
|
|
/** |
749
|
|
|
* @param string $booker_language |
750
|
|
|
* @return $this |
751
|
|
|
*/ |
752
|
|
|
public function setBookerLanguage(string $booker_language): self |
753
|
|
|
{ |
754
|
|
|
$this->booker_language = $booker_language; |
755
|
|
|
return $this; |
756
|
|
|
} |
757
|
|
|
|
758
|
|
|
/** |
759
|
|
|
* @return string |
760
|
|
|
*/ |
761
|
|
|
public function getBookerLastname(): string |
762
|
|
|
{ |
763
|
|
|
return $this->booker_lastname; |
764
|
|
|
} |
765
|
|
|
|
766
|
|
|
/** |
767
|
|
|
* @param string $booker_lastname |
768
|
|
|
* @return $this |
769
|
|
|
*/ |
770
|
|
|
public function setBookerLastname(string $booker_lastname): self |
771
|
|
|
{ |
772
|
|
|
$this->booker_lastname = $booker_lastname; |
773
|
|
|
return $this; |
774
|
|
|
} |
775
|
|
|
|
776
|
|
|
/** |
777
|
|
|
* @return mixed |
778
|
|
|
*/ |
779
|
|
|
public function getBookerZip() |
780
|
|
|
{ |
781
|
|
|
return $this->booker_zip; |
782
|
|
|
} |
783
|
|
|
|
784
|
|
|
/** |
785
|
|
|
* @param mixed $booker_zip |
786
|
|
|
* @return $this |
787
|
|
|
*/ |
788
|
|
|
public function setBookerZip($booker_zip): self |
789
|
|
|
{ |
790
|
|
|
$this->booker_zip = $booker_zip; |
791
|
|
|
return $this; |
792
|
|
|
} |
793
|
|
|
|
794
|
|
|
/** |
795
|
|
|
* @return string |
796
|
|
|
*/ |
797
|
|
|
public function getCcCardholder(): string |
798
|
|
|
{ |
799
|
|
|
return $this->cc_cardholder; |
800
|
|
|
} |
801
|
|
|
|
802
|
|
|
/** |
803
|
|
|
* @param string $cc_cardholder |
804
|
|
|
* @return $this |
805
|
|
|
*/ |
806
|
|
|
public function setCcCardholder(string $cc_cardholder): self |
807
|
|
|
{ |
808
|
|
|
$this->cc_cardholder = $cc_cardholder; |
809
|
|
|
return $this; |
810
|
|
|
} |
811
|
|
|
|
812
|
|
|
/** |
813
|
|
|
* @return string |
814
|
|
|
*/ |
815
|
|
|
public function getCcCvc(): string |
816
|
|
|
{ |
817
|
|
|
return $this->cc_cvc; |
818
|
|
|
} |
819
|
|
|
|
820
|
|
|
/** |
821
|
|
|
* @param string $cc_cvc |
822
|
|
|
* @return $this |
823
|
|
|
*/ |
824
|
|
|
public function setCcCvc(string $cc_cvc): self |
825
|
|
|
{ |
826
|
|
|
$this->cc_cvc = $cc_cvc; |
827
|
|
|
return $this; |
828
|
|
|
} |
829
|
|
|
|
830
|
|
|
/** |
831
|
|
|
* @return string |
832
|
|
|
*/ |
833
|
|
|
public function getCcExpirationDate(): string |
834
|
|
|
{ |
835
|
|
|
return $this->cc_expiration_date; |
836
|
|
|
} |
837
|
|
|
|
838
|
|
|
/** |
839
|
|
|
* @param DateTime $cc_expiration_date |
840
|
|
|
* @return $this |
841
|
|
|
*/ |
842
|
|
|
public function setCcExpirationDate(DateTime $cc_expiration_date): self |
843
|
|
|
{ |
844
|
|
|
$this->cc_expiration_date = $cc_expiration_date->format('Y-m-d'); |
845
|
|
|
return $this; |
846
|
|
|
} |
847
|
|
|
|
848
|
|
|
/** |
849
|
|
|
* @return string |
850
|
|
|
*/ |
851
|
|
|
public function getCcNumber(): string |
852
|
|
|
{ |
853
|
|
|
return $this->cc_number; |
854
|
|
|
} |
855
|
|
|
|
856
|
|
|
/** |
857
|
|
|
* @param string $cc_number |
858
|
|
|
* @return $this |
859
|
|
|
*/ |
860
|
|
|
public function setCcNumber(string $cc_number): self |
861
|
|
|
{ |
862
|
|
|
$this->cc_number = $cc_number; |
863
|
|
|
return $this; |
864
|
|
|
} |
865
|
|
|
|
866
|
|
|
/** |
867
|
|
|
* @return int |
868
|
|
|
*/ |
869
|
|
|
public function getCcType(): int |
870
|
|
|
{ |
871
|
|
|
return $this->cc_type; |
872
|
|
|
} |
873
|
|
|
|
874
|
|
|
/** |
875
|
|
|
* @param int $cc_type |
876
|
|
|
* @return $this |
877
|
|
|
*/ |
878
|
|
|
public function setCcType(int $cc_type): self |
879
|
|
|
{ |
880
|
|
|
$this->cc_type = $cc_type; |
881
|
|
|
return $this; |
882
|
|
|
} |
883
|
|
|
|
884
|
|
|
/** |
885
|
|
|
* @return string |
886
|
|
|
*/ |
887
|
|
|
public function getComments(): string |
888
|
|
|
{ |
889
|
|
|
return $this->comments; |
890
|
|
|
} |
891
|
|
|
|
892
|
|
|
/** |
893
|
|
|
* @param string $comments |
894
|
|
|
* @return $this |
895
|
|
|
*/ |
896
|
|
|
public function setComments(string $comments): self |
897
|
|
|
{ |
898
|
|
|
$this->comments = $comments; |
899
|
|
|
return $this; |
900
|
|
|
} |
901
|
|
|
|
902
|
|
|
/** |
903
|
|
|
* @return string |
904
|
|
|
*/ |
905
|
|
|
public function getCurrency(): string |
906
|
|
|
{ |
907
|
|
|
return $this->currency; |
908
|
|
|
} |
909
|
|
|
|
910
|
|
|
/** |
911
|
|
|
* @param string $currency |
912
|
|
|
* @return $this |
913
|
|
|
*/ |
914
|
|
|
public function setCurrency(string $currency): self |
915
|
|
|
{ |
916
|
|
|
$this->currency = $currency; |
917
|
|
|
return $this; |
918
|
|
|
} |
919
|
|
|
|
920
|
|
|
/** |
921
|
|
|
* @return array |
922
|
|
|
*/ |
923
|
|
|
public function getExtras(): array |
924
|
|
|
{ |
925
|
|
|
return $this->extras; |
926
|
|
|
} |
927
|
|
|
|
928
|
|
|
/** |
929
|
|
|
* @param array $extras |
930
|
|
|
* @return $this |
931
|
|
|
*/ |
932
|
|
|
public function setExtras(array $extras): self |
933
|
|
|
{ |
934
|
|
|
$this->extras = $extras; |
935
|
|
|
return $this; |
936
|
|
|
} |
937
|
|
|
|
938
|
|
|
/** |
939
|
|
|
* @return mixed |
940
|
|
|
*/ |
941
|
|
|
public function getForwardedUserAgent() |
942
|
|
|
{ |
943
|
|
|
return $this->forwarded_user_agent; |
944
|
|
|
} |
945
|
|
|
|
946
|
|
|
/** |
947
|
|
|
* @param mixed $forwarded_user_agent |
948
|
|
|
* @return $this |
949
|
|
|
*/ |
950
|
|
|
public function setForwardedUserAgent($forwarded_user_agent): self |
951
|
|
|
{ |
952
|
|
|
$this->forwarded_user_agent = $forwarded_user_agent; |
953
|
|
|
return $this; |
954
|
|
|
} |
955
|
|
|
|
956
|
|
|
/** |
957
|
|
|
* @return array |
958
|
|
|
*/ |
959
|
|
|
public function getGuestEmails(): array |
960
|
|
|
{ |
961
|
|
|
return $this->guest_emails; |
962
|
|
|
} |
963
|
|
|
|
964
|
|
|
/** |
965
|
|
|
* @param array $guest_emails |
966
|
|
|
* @return $this |
967
|
|
|
*/ |
968
|
|
|
public function setGuestEmails(array $guest_emails): self |
969
|
|
|
{ |
970
|
|
|
$this->guest_emails = $guest_emails; |
971
|
|
|
return $this; |
972
|
|
|
} |
973
|
|
|
|
974
|
|
|
/** |
975
|
|
|
* @return array |
976
|
|
|
*/ |
977
|
|
|
public function getGuestNames(): array |
978
|
|
|
{ |
979
|
|
|
return $this->guest_names; |
980
|
|
|
} |
981
|
|
|
|
982
|
|
|
/** |
983
|
|
|
* @param array $guest_names |
984
|
|
|
* @return $this |
985
|
|
|
*/ |
986
|
|
|
public function setGuestNames(array $guest_names): self |
987
|
|
|
{ |
988
|
|
|
$this->guest_names = $guest_names; |
989
|
|
|
return $this; |
990
|
|
|
} |
991
|
|
|
|
992
|
|
|
/** |
993
|
|
|
* @return array |
994
|
|
|
*/ |
995
|
|
|
public function getGuestQuantities(): array |
996
|
|
|
{ |
997
|
|
|
return $this->guest_quantities; |
998
|
|
|
} |
999
|
|
|
|
1000
|
|
|
/** |
1001
|
|
|
* @param array $guest_quantities |
1002
|
|
|
* @return $this |
1003
|
|
|
*/ |
1004
|
|
|
public function setGuestQuantities(array $guest_quantities): self |
1005
|
|
|
{ |
1006
|
|
|
$this->guest_quantities = $guest_quantities; |
1007
|
|
|
return $this; |
1008
|
|
|
} |
1009
|
|
|
|
1010
|
|
|
/** |
1011
|
|
|
* @return string |
1012
|
|
|
*/ |
1013
|
|
|
public function getHourOfArrival(): string |
1014
|
|
|
{ |
1015
|
|
|
return $this->hour_of_arrival; |
1016
|
|
|
} |
1017
|
|
|
|
1018
|
|
|
/** |
1019
|
|
|
* @param string $hour_of_arrival |
1020
|
|
|
* @return $this |
1021
|
|
|
*/ |
1022
|
|
|
public function setHourOfArrival(string $hour_of_arrival): self |
1023
|
|
|
{ |
1024
|
|
|
$this->hour_of_arrival = $hour_of_arrival; |
1025
|
|
|
return $this; |
1026
|
|
|
} |
1027
|
|
|
|
1028
|
|
|
/** |
1029
|
|
|
* @return array |
1030
|
|
|
*/ |
1031
|
|
|
public function getIncrementalPrices(): array |
1032
|
|
|
{ |
1033
|
|
|
return $this->incremental_prices; |
1034
|
|
|
} |
1035
|
|
|
|
1036
|
|
|
/** |
1037
|
|
|
* @param array $incremental_prices |
1038
|
|
|
* @return $this |
1039
|
|
|
*/ |
1040
|
|
|
public function setIncrementalPrices(array $incremental_prices): self |
1041
|
|
|
{ |
1042
|
|
|
$this->incremental_prices = $incremental_prices; |
1043
|
|
|
return $this; |
1044
|
|
|
} |
1045
|
|
|
|
1046
|
|
|
/** |
1047
|
|
|
* @return int |
1048
|
|
|
*/ |
1049
|
|
|
public function getNextTrips(): int |
1050
|
|
|
{ |
1051
|
|
|
return $this->next_trips; |
1052
|
|
|
} |
1053
|
|
|
|
1054
|
|
|
/** |
1055
|
|
|
* @param int $next_trips |
1056
|
|
|
* @return $this |
1057
|
|
|
*/ |
1058
|
|
|
public function setNextTrips(int $next_trips): self |
1059
|
|
|
{ |
1060
|
|
|
$this->next_trips = $next_trips; |
1061
|
|
|
return $this; |
1062
|
|
|
} |
1063
|
|
|
|
1064
|
|
|
/** |
1065
|
|
|
* @return array |
1066
|
|
|
*/ |
1067
|
|
|
public function getOptions(): array |
1068
|
|
|
{ |
1069
|
|
|
return $this->options; |
1070
|
|
|
} |
1071
|
|
|
|
1072
|
|
|
/** |
1073
|
|
|
* @param array $options |
1074
|
|
|
* @return $this |
1075
|
|
|
*/ |
1076
|
|
|
public function setOptions(array $options): self |
1077
|
|
|
{ |
1078
|
|
|
$this->options = $options; |
1079
|
|
|
return $this; |
1080
|
|
|
} |
1081
|
|
|
|
1082
|
|
|
/** |
1083
|
|
|
* @return string |
1084
|
|
|
*/ |
1085
|
|
|
public function getRequestId(): string |
1086
|
|
|
{ |
1087
|
|
|
return $this->request_id; |
1088
|
|
|
} |
1089
|
|
|
|
1090
|
|
|
/** |
1091
|
|
|
* @param string $request_id |
1092
|
|
|
* @return $this |
1093
|
|
|
*/ |
1094
|
|
|
public function setRequestId(string $request_id): self |
1095
|
|
|
{ |
1096
|
|
|
$this->request_id = $request_id; |
1097
|
|
|
return $this; |
1098
|
|
|
} |
1099
|
|
|
|
1100
|
|
|
/** |
1101
|
|
|
* @return int |
1102
|
|
|
*/ |
1103
|
|
|
public function getShowTest(): int |
1104
|
|
|
{ |
1105
|
|
|
return $this->show_test; |
1106
|
|
|
} |
1107
|
|
|
|
1108
|
|
|
/** |
1109
|
|
|
* @param int $show_test |
1110
|
|
|
* @return $this |
1111
|
|
|
*/ |
1112
|
|
|
public function setShowTest(int $show_test): self |
1113
|
|
|
{ |
1114
|
|
|
$this->show_test = $show_test; |
1115
|
|
|
return $this; |
1116
|
|
|
} |
1117
|
|
|
|
1118
|
|
|
/** |
1119
|
|
|
* @return array |
1120
|
|
|
*/ |
1121
|
|
|
public function getSmokingPreferences(): array |
1122
|
|
|
{ |
1123
|
|
|
return $this->smoking_preferences; |
1124
|
|
|
} |
1125
|
|
|
|
1126
|
|
|
/** |
1127
|
|
|
* @param array $smoking_preferences |
1128
|
|
|
* @return $this |
1129
|
|
|
*/ |
1130
|
|
|
public function setSmokingPreferences(array $smoking_preferences): self |
1131
|
|
|
{ |
1132
|
|
|
$this->smoking_preferences = $smoking_preferences; |
1133
|
|
|
return $this; |
1134
|
|
|
} |
1135
|
|
|
|
1136
|
|
|
/** |
1137
|
|
|
* @return int |
1138
|
|
|
*/ |
1139
|
|
|
public function getTestMode(): int |
1140
|
|
|
{ |
1141
|
|
|
return $this->test_mode; |
1142
|
|
|
} |
1143
|
|
|
|
1144
|
|
|
/** |
1145
|
|
|
* @param bool $test_mode |
1146
|
|
|
* @return $this |
1147
|
|
|
*/ |
1148
|
|
|
public function setTestMode(bool $test_mode): self |
1149
|
|
|
{ |
1150
|
|
|
$this->test_mode = (int)$test_mode; |
1151
|
|
|
return $this; |
1152
|
|
|
} |
1153
|
|
|
|
1154
|
|
|
/** |
1155
|
|
|
* @return string |
1156
|
|
|
*/ |
1157
|
|
|
public function getTravelPurpose(): string |
1158
|
|
|
{ |
1159
|
|
|
return $this->travel_purpose; |
1160
|
|
|
} |
1161
|
|
|
|
1162
|
|
|
/** |
1163
|
|
|
* @param string $travel_purpose |
1164
|
|
|
* @return $this |
1165
|
|
|
*/ |
1166
|
|
|
public function setTravelPurpose(string $travel_purpose): self |
1167
|
|
|
{ |
1168
|
|
|
$this->travel_purpose = $travel_purpose; |
1169
|
|
|
return $this; |
1170
|
|
|
} |
1171
|
|
|
|
1172
|
|
|
/** |
1173
|
|
|
* @return string |
1174
|
|
|
*/ |
1175
|
|
|
protected function getRequestMethod(): string |
1176
|
|
|
{ |
1177
|
|
|
return self::REQUEST_METHOD_POST; |
1178
|
|
|
} |
1179
|
|
|
|
1180
|
|
|
/** |
1181
|
|
|
* @return array |
1182
|
|
|
*/ |
1183
|
|
|
protected function getAttributeMap(): array |
1184
|
|
|
{ |
1185
|
|
|
return [ |
1186
|
|
|
/* required */ |
1187
|
|
|
'booker_telephone' => 'array', |
1188
|
|
|
'booker_country' => 'string', |
1189
|
|
|
'hotel_id' => 'integer', |
1190
|
|
|
'affiliate_id' => 'integer', |
1191
|
|
|
'block_ids' => 'array', |
1192
|
|
|
'checkin' => 'string', |
1193
|
|
|
'checkout' => 'string', |
1194
|
|
|
'booker_email' => 'string', |
1195
|
|
|
|
1196
|
|
|
/* not required */ |
1197
|
|
|
'addon_prices' => 'string', |
1198
|
|
|
'affiliate_label' => 'string', |
1199
|
|
|
'bed_preferences' => 'array', |
1200
|
|
|
'bedtype_preferences' => 'array', |
1201
|
|
|
'block_quantities' => 'array', |
1202
|
|
|
'booker_address' => 'string', |
1203
|
|
|
|
1204
|
|
|
'booker_city' => 'string', |
1205
|
|
|
'booker_company' => 'string', |
1206
|
|
|
'booker_firstname' => 'string', |
1207
|
|
|
'booker_ip' => 'string', |
1208
|
|
|
'booker_language' => 'string', |
1209
|
|
|
'booker_lastname' => 'string', |
1210
|
|
|
'booker_zip' => 'string', |
1211
|
|
|
'cc_cardholder' => 'string', |
1212
|
|
|
'cc_cvc' => 'string', |
1213
|
|
|
'cc_expiration_date' => 'string', |
1214
|
|
|
'cc_number' => 'string', |
1215
|
|
|
'cc_type' => 'string', |
1216
|
|
|
'comments' => 'string', |
1217
|
|
|
'currency' => 'string', |
1218
|
|
|
'extras' => 'array', |
1219
|
|
|
'forwarded_user_agent' => 'string', |
1220
|
|
|
'guest_emails' => 'array', |
1221
|
|
|
'guest_names' => 'array', |
1222
|
|
|
'guest_quantities' => 'array', |
1223
|
|
|
'hour_of_arrival' => 'string', |
1224
|
|
|
'incremental_prices' => 'array', |
1225
|
|
|
'next_trips' => 'integer', |
1226
|
|
|
'options' => 'array', |
1227
|
|
|
'request_id' => 'string', |
1228
|
|
|
'show_test' => 'integer', |
1229
|
|
|
'smoking_preferences' => 'array', |
1230
|
|
|
'test_mode' => 'integer', |
1231
|
|
|
'travel_purpose' => 'string', |
1232
|
|
|
]; |
1233
|
|
|
} |
1234
|
|
|
|
1235
|
|
|
/** |
1236
|
|
|
* @return bool |
1237
|
|
|
*/ |
1238
|
|
|
protected function isSecure(): bool |
1239
|
|
|
{ |
1240
|
|
|
return true; |
1241
|
|
|
} |
1242
|
|
|
|
1243
|
|
|
/** |
1244
|
|
|
* @param $data |
1245
|
|
|
* @return Result |
1246
|
|
|
*/ |
1247
|
|
|
protected function prepareResponse($data): Result |
1248
|
|
|
{ |
1249
|
|
|
$collections = new Result(); |
1250
|
|
|
|
1251
|
|
|
/** @var ProcessBooking $model */ |
1252
|
|
|
$class = $this->model(); |
1253
|
|
|
$model = new $class; |
1254
|
|
|
$model->setAttributes((array)$data); |
1255
|
|
|
|
1256
|
|
|
$collections->addItem($model, $model->getPrimaryKey()); |
1257
|
|
|
return $collections; |
1258
|
|
|
} |
1259
|
|
|
|
1260
|
|
|
/** |
1261
|
|
|
* @return string |
1262
|
|
|
*/ |
1263
|
|
|
protected function model(): string |
1264
|
|
|
{ |
1265
|
|
|
return ProcessBooking::class; |
1266
|
|
|
} |
1267
|
|
|
} |
1268
|
|
|
|