quicktravel_client 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (104) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +25 -0
  3. data/.rspec +2 -0
  4. data/.rubocop.yml +13 -0
  5. data/.ruby-version +1 -0
  6. data/.travis.yml +18 -0
  7. data/Gemfile +5 -0
  8. data/LICENSE +22 -0
  9. data/README.md +17 -0
  10. data/Rakefile +18 -0
  11. data/bootstrap/boot.rb +4 -0
  12. data/examples/example_config.rb +4 -0
  13. data/examples/login_example.rb +25 -0
  14. data/lib/extensions.rb +12 -0
  15. data/lib/quick_travel/accommodation.rb +72 -0
  16. data/lib/quick_travel/adapter.rb +283 -0
  17. data/lib/quick_travel/adapter_exception.rb +20 -0
  18. data/lib/quick_travel/address.rb +27 -0
  19. data/lib/quick_travel/adjustment.rb +8 -0
  20. data/lib/quick_travel/background_check.rb +9 -0
  21. data/lib/quick_travel/bed_configuration.rb +7 -0
  22. data/lib/quick_travel/bed_requirement.rb +7 -0
  23. data/lib/quick_travel/booking.rb +370 -0
  24. data/lib/quick_travel/cache.rb +38 -0
  25. data/lib/quick_travel/client.rb +8 -0
  26. data/lib/quick_travel/client_type.rb +6 -0
  27. data/lib/quick_travel/config.rb +26 -0
  28. data/lib/quick_travel/connection_error.rb +9 -0
  29. data/lib/quick_travel/constants.rb +16 -0
  30. data/lib/quick_travel/contact.rb +5 -0
  31. data/lib/quick_travel/country.rb +11 -0
  32. data/lib/quick_travel/credit_card.rb +12 -0
  33. data/lib/quick_travel/discounts/booking_discount.rb +18 -0
  34. data/lib/quick_travel/discounts/discount.rb +21 -0
  35. data/lib/quick_travel/discounts/discount_tree.rb +35 -0
  36. data/lib/quick_travel/discounts.rb +3 -0
  37. data/lib/quick_travel/document.rb +20 -0
  38. data/lib/quick_travel/document_group.rb +14 -0
  39. data/lib/quick_travel/encrypt.rb +13 -0
  40. data/lib/quick_travel/graphic.rb +18 -0
  41. data/lib/quick_travel/init_from_hash.rb +16 -0
  42. data/lib/quick_travel/location.rb +14 -0
  43. data/lib/quick_travel/mock.rb +41 -0
  44. data/lib/quick_travel/party.rb +49 -0
  45. data/lib/quick_travel/passenger.rb +7 -0
  46. data/lib/quick_travel/passenger_price_break.rb +8 -0
  47. data/lib/quick_travel/passenger_type.rb +21 -0
  48. data/lib/quick_travel/payment.rb +41 -0
  49. data/lib/quick_travel/payment_type.rb +37 -0
  50. data/lib/quick_travel/price.rb +14 -0
  51. data/lib/quick_travel/product.rb +165 -0
  52. data/lib/quick_travel/product_configuration.rb +134 -0
  53. data/lib/quick_travel/product_passenger_search_criteria.rb +28 -0
  54. data/lib/quick_travel/product_type.rb +28 -0
  55. data/lib/quick_travel/property.rb +99 -0
  56. data/lib/quick_travel/property_facility.rb +7 -0
  57. data/lib/quick_travel/property_type.rb +20 -0
  58. data/lib/quick_travel/region.rb +21 -0
  59. data/lib/quick_travel/reservation.rb +110 -0
  60. data/lib/quick_travel/resource.rb +50 -0
  61. data/lib/quick_travel/room_facility.rb +7 -0
  62. data/lib/quick_travel/route.rb +81 -0
  63. data/lib/quick_travel/route_stop.rb +7 -0
  64. data/lib/quick_travel/search.rb +14 -0
  65. data/lib/quick_travel/service.rb +5 -0
  66. data/lib/quick_travel/trip.rb +8 -0
  67. data/lib/quick_travel/vehicle.rb +17 -0
  68. data/lib/quick_travel/vehicle_type.rb +11 -0
  69. data/lib/quick_travel/version.rb +3 -0
  70. data/lib/quick_travel.rb +59 -0
  71. data/lib/quicktravel_client.rb +1 -0
  72. data/quicktravel_client.gemspec +37 -0
  73. data/spec/booking_spec.rb +107 -0
  74. data/spec/country_spec.rb +18 -0
  75. data/spec/credit_card_spec.rb +11 -0
  76. data/spec/discounts_spec.rb +121 -0
  77. data/spec/passenger_type_spec.rb +32 -0
  78. data/spec/payment_type_spec.rb +18 -0
  79. data/spec/product_spec.rb +82 -0
  80. data/spec/region_spec.rb +29 -0
  81. data/spec/reservation_spec.rb +50 -0
  82. data/spec/resource_spec.rb +22 -0
  83. data/spec/spec_helper.rb +77 -0
  84. data/spec/support/cassettes/booking_create.yml +50 -0
  85. data/spec/support/cassettes/booking_create_legacy.yml +50 -0
  86. data/spec/support/cassettes/booking_discounts.yml +53 -0
  87. data/spec/support/cassettes/booking_documents.yml +48 -0
  88. data/spec/support/cassettes/booking_show.yml +49 -0
  89. data/spec/support/cassettes/booking_update.yml +94 -0
  90. data/spec/support/cassettes/booking_with_discounts.yml +72 -0
  91. data/spec/support/cassettes/booking_with_documents.yml +117 -0
  92. data/spec/support/cassettes/booking_with_nested_attributes.yml +187 -0
  93. data/spec/support/cassettes/country_all.yml +127 -0
  94. data/spec/support/cassettes/create_reservation_fail.yml +47 -0
  95. data/spec/support/cassettes/create_reservation_with_booking.yml +53 -0
  96. data/spec/support/cassettes/passenger_all.yml +48 -0
  97. data/spec/support/cassettes/product_date_range_bookability.yml +118 -0
  98. data/spec/support/cassettes/product_show.yml +52 -0
  99. data/spec/support/cassettes/region_index.yml +48 -0
  100. data/spec/support/cassettes/region_show.yml +48 -0
  101. data/spec/support/cassettes/reservation_with_extra_picks.yml +165 -0
  102. data/spec/support/cassettes/resource_fare_bases.yml +97 -0
  103. data/spec/support/cassettes/resource_show.yml +50 -0
  104. metadata +421 -0
@@ -0,0 +1,49 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://0.0.0.0:8080/api/bookings/3.json?
6
+ body:
7
+ encoding: US-ASCII
8
+ string: access_key=<QT_KEY>
9
+ headers:
10
+ content-length:
11
+ - '0'
12
+ response:
13
+ status:
14
+ code: 200
15
+ message: ! 'OK '
16
+ headers:
17
+ p3p:
18
+ - CP="IDC DSP CAO COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"
19
+ content-type:
20
+ - application/json; charset=utf-8
21
+ x-ua-compatible:
22
+ - IE=Edge,chrome=1
23
+ etag:
24
+ - ! '"e46ab802351e11f08fac294ef77f5c74"'
25
+ cache-control:
26
+ - max-age=0, private, must-revalidate
27
+ x-request-id:
28
+ - 887edf25cea02eaf0683ae0720994553
29
+ x-runtime:
30
+ - '0.028099'
31
+ date:
32
+ - Thu, 28 Feb 2013 14:16:26 GMT
33
+ x-rack-cache:
34
+ - miss
35
+ server:
36
+ - WEBrick/1.3.1 (Ruby/2.1.5/2014-11-13)
37
+ content-length:
38
+ - '1908'
39
+ connection:
40
+ - close
41
+ set-cookie:
42
+ - _session_id=21a47f3f5b34001c8bfead0f5511a0ba; path=/; HttpOnly
43
+ body:
44
+ encoding: US-ASCII
45
+ string: ! '{"id":3,"state":"new","reference":"222226","public_comments":null,"internal_comments":null,"customer_contact_name":null,"customer_contact_phone":null,"customer_contact_mobile":null,"customer_contact_email":null,"currency_iso_code":"AUD","country_id":14,"post_code":null,"referral_code_id":1,"total_adjustments_in_cents":0,"pre_adjusted_gross_in_cents":0,"nett_in_cents":0,"gross_in_cents":0,"commission_in_cents":0,"balance_in_cents":0,"paid_in_cents":0,"surcharge_in_cents":0,"deposit_in_cents":0,"web_site_name":"SeaLink","promo_code":null,"insurance_offered":false,"deposit_due_on":null,"balance_due_on":null,"first_travel_date":{"_type":"Date","_value":"2013-03-01"},"last_travel_date":null,"complete":true,"reason_not_complete":null,"discardable_in":60,"inactivatable_in":10,"notices":{},"deposit_relevant":false,"passenger_ids":[],"vehicle_ids":[],"reservation_ids":[],"adjustment_ids":[],"todo_items":[],"confirmation_requests":[],"passengers_attributes":[],"vehicles_attributes":[],"reservations_attributes":[],"adjustments_attributes":[],"payments_attributes":[],"payment_types_attributes":[{"id":5,"name":"master","description":"master","payment_method":"credit_card","credit_card_brand":"MasterCard","transaction_fee":"0.0","active":true,"position":2,"surchargeable":false,"for_frequent_traveller_redemption":false,"comment_required":false,"external":true},{"id":4,"name":"visa","description":"visa","payment_method":"credit_card","credit_card_brand":"Visa","transaction_fee":"0.0","active":true,"position":3,"surchargeable":false,"for_frequent_traveller_redemption":false,"comment_required":false,"external":true},{"id":7,"name":"PayPal","description":"Payments
46
+ made via PayPal account","payment_method":"paypal","credit_card_brand":null,"transaction_fee":"0.0","active":true,"position":6,"surchargeable":false,"for_frequent_traveller_redemption":false,"comment_required":false,"external":true}]}'
47
+ http_version: '1.1'
48
+ recorded_at: Thu, 18 Dec 2014 07:33:16 GMT
49
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,94 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: put
5
+ uri: http://0.0.0.0:8080/api/bookings/3.json
6
+ body:
7
+ encoding: US-ASCII
8
+ string: booking[customer_contact_name]=John&access_key=<QT_KEY>
9
+ headers:
10
+ content-length:
11
+ - '0'
12
+ response:
13
+ status:
14
+ code: 200
15
+ message: ! 'OK '
16
+ headers:
17
+ p3p:
18
+ - CP="IDC DSP CAO COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"
19
+ content-type:
20
+ - application/json; charset=utf-8
21
+ x-ua-compatible:
22
+ - IE=Edge,chrome=1
23
+ etag:
24
+ - ! '"7363e85fe9edee6f053a4b319588c086"'
25
+ cache-control:
26
+ - max-age=0, private, must-revalidate
27
+ x-request-id:
28
+ - 958f8102631d77aa5df03dad8dd0168b
29
+ x-runtime:
30
+ - '0.342271'
31
+ date:
32
+ - Thu, 28 Feb 2013 14:16:27 GMT
33
+ x-rack-cache:
34
+ - invalidate, pass
35
+ server:
36
+ - WEBrick/1.3.1 (Ruby/2.1.5/2014-11-13)
37
+ content-length:
38
+ - '16'
39
+ connection:
40
+ - close
41
+ set-cookie:
42
+ - _session_id=101bcafdb111f07269d23e4988bf4bc2; path=/; HttpOnly
43
+ body:
44
+ encoding: US-ASCII
45
+ string: ! '{"success":true}'
46
+ http_version: '1.1'
47
+ recorded_at: Thu, 18 Dec 2014 07:33:16 GMT
48
+ - request:
49
+ method: get
50
+ uri: http://0.0.0.0:8080/api/bookings/3.json?
51
+ body:
52
+ encoding: US-ASCII
53
+ string: access_key=<QT_KEY>
54
+ headers:
55
+ content-length:
56
+ - '0'
57
+ response:
58
+ status:
59
+ code: 200
60
+ message: ! 'OK '
61
+ headers:
62
+ p3p:
63
+ - CP="IDC DSP CAO COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"
64
+ content-type:
65
+ - application/json; charset=utf-8
66
+ x-ua-compatible:
67
+ - IE=Edge,chrome=1
68
+ etag:
69
+ - ! '"44d2917ae555e3fb822366b754ac5fe2"'
70
+ cache-control:
71
+ - max-age=0, private, must-revalidate
72
+ x-request-id:
73
+ - 982eb67a8c0120e54393e5b4867395ed
74
+ x-runtime:
75
+ - '0.028250'
76
+ date:
77
+ - Thu, 28 Feb 2013 14:16:27 GMT
78
+ x-rack-cache:
79
+ - miss
80
+ server:
81
+ - WEBrick/1.3.1 (Ruby/2.1.5/2014-11-13)
82
+ content-length:
83
+ - '1910'
84
+ connection:
85
+ - close
86
+ set-cookie:
87
+ - _session_id=9d117a8940e1f11cd6a39f3600798003; path=/; HttpOnly
88
+ body:
89
+ encoding: US-ASCII
90
+ string: ! '{"id":3,"state":"new","reference":"222226","public_comments":null,"internal_comments":null,"customer_contact_name":"John","customer_contact_phone":null,"customer_contact_mobile":null,"customer_contact_email":null,"currency_iso_code":"AUD","country_id":14,"post_code":null,"referral_code_id":1,"total_adjustments_in_cents":0,"pre_adjusted_gross_in_cents":0,"nett_in_cents":0,"gross_in_cents":0,"commission_in_cents":0,"balance_in_cents":0,"paid_in_cents":0,"surcharge_in_cents":0,"deposit_in_cents":0,"web_site_name":"SeaLink","promo_code":null,"insurance_offered":false,"deposit_due_on":null,"balance_due_on":null,"first_travel_date":{"_type":"Date","_value":"2013-03-01"},"last_travel_date":null,"complete":true,"reason_not_complete":null,"discardable_in":60,"inactivatable_in":10,"notices":{},"deposit_relevant":false,"passenger_ids":[],"vehicle_ids":[],"reservation_ids":[],"adjustment_ids":[],"todo_items":[],"confirmation_requests":[],"passengers_attributes":[],"vehicles_attributes":[],"reservations_attributes":[],"adjustments_attributes":[],"payments_attributes":[],"payment_types_attributes":[{"id":5,"name":"master","description":"master","payment_method":"credit_card","credit_card_brand":"MasterCard","transaction_fee":"0.0","active":true,"position":2,"surchargeable":false,"for_frequent_traveller_redemption":false,"comment_required":false,"external":true},{"id":4,"name":"visa","description":"visa","payment_method":"credit_card","credit_card_brand":"Visa","transaction_fee":"0.0","active":true,"position":3,"surchargeable":false,"for_frequent_traveller_redemption":false,"comment_required":false,"external":true},{"id":7,"name":"PayPal","description":"Payments
91
+ made via PayPal account","payment_method":"paypal","credit_card_brand":null,"transaction_fee":"0.0","active":true,"position":6,"surchargeable":false,"for_frequent_traveller_redemption":false,"comment_required":false,"external":true}]}'
92
+ http_version: '1.1'
93
+ recorded_at: Thu, 18 Dec 2014 07:33:16 GMT
94
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,72 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://0.0.0.0:8080/api/bookings/reference/222223.json?
6
+ body:
7
+ encoding: UTF-8
8
+ string: access_key=<QT_KEY>
9
+ headers:
10
+ content-length:
11
+ - '0'
12
+ response:
13
+ status:
14
+ code: 200
15
+ message: 'OK '
16
+ headers:
17
+ p3p:
18
+ - CP="IDC DSP CAO COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"
19
+ content-type:
20
+ - application/json; charset=utf-8
21
+ x-ua-compatible:
22
+ - IE=Edge
23
+ etag:
24
+ - '"7e61bf783b86f30f5a75a859d302cdd8"'
25
+ cache-control:
26
+ - max-age=0, private, must-revalidate
27
+ x-request-id:
28
+ - db5e334cd6b1829241c6c934a8861996
29
+ x-runtime:
30
+ - '1.279564'
31
+ date:
32
+ - Wed, 25 Mar 2015 22:44:15 GMT
33
+ x-rack-cache:
34
+ - miss
35
+ server:
36
+ - WEBrick/1.3.1 (Ruby/2.1.5/2014-11-13)
37
+ content-length:
38
+ - '11713'
39
+ connection:
40
+ - close
41
+ set-cookie:
42
+ - _session_id=2b5aa99831783a9749265ded2289db3b; path=/; HttpOnly
43
+ body:
44
+ encoding: UTF-8
45
+ string: '{"id":1,"state":"new","reference":"222223","public_comments":null,"internal_comments":null,"customer_contact_name":null,"customer_contact_phone":null,"customer_contact_mobile":null,"customer_contact_email":null,"currency_iso_code":"AUD","country_id":14,"post_code":null,"referral_code_id":1,"total_adjustments_in_cents":0,"pre_adjusted_gross_in_cents":38000,"nett_in_cents":38000,"gross_in_cents":38000,"commission_in_cents":0,"balance_in_cents":38000,"paid_in_cents":0,"surcharge_in_cents":0,"deposit_in_cents":0,"web_site_name":null,"promo_code":null,"insurance_offered":false,"deposit_due_on":{"_type":"Date","_value":"2016-03-01T00:00:00+10:30"},"balance_due_on":{"_type":"Date","_value":"2016-03-01T00:00:00+10:30"},"first_travel_date":{"_type":"Date","_value":"2016-03-01"},"last_travel_date":{"_type":"Date","_value":"2016-03-02"},"complete":true,"reason_not_complete":null,"discardable_in":-1087654,"inactivatable_in":-1087704,"notices":{},"deposit_relevant":false,"passenger_ids":[1,2],"vehicle_ids":[],"reservation_ids":[1,3,2],"adjustment_ids":[],"todo_items":[],"confirmation_requests":[],"passengers_attributes":[{"id":1,"title":null,"first_name":null,"last_name":null,"passenger_type_id":1,"age":30,"gender":null,"position":1},{"id":2,"title":null,"first_name":null,"last_name":null,"passenger_type_id":1,"age":30,"gender":null,"position":2}],"vehicles_attributes":[],"reservations_attributes":[{"id":1,"booking_id":1,"description":"A
46
+ basic studio room","comment":"","active":true,"service_ids":[3,4],"resource_id":6,"quantity":null,"complete":true,"reason_not_complete":null,"enough_time_before_travel_to_edit":true,"bed_configuration":"1
47
+ x Double","product_type_id":2,"itinerary_footer":false,"fare_basis_set_id":12,"manually_priced":false,"manually_assigned_fare_basis_set":false,"has_fare_basis":true,"fare_basis_season_name":"","fare_basis_pointer_id":6,"pick_up_info":null,"drop_off_info":null,"selection_name":"Hilton
48
+ Hotel: Executive Room","product_name_underscore":"accommodation","resource_class_name_underscore":"accommodation","resource_class_name":"Accommodation","first_travel_date":{"_type":"Date","_value":"2016-03-01"},"last_travel_date":{"_type":"Date","_value":"2016-03-02"},"durational":true,"duration":2,"checkout_date":{"_type":"Date","_value":"2016-03-03"},"duration_units":"Nights","date_start_label":"In:","date_end_label":"Out:","accommodation_extra_picks":false,"has_skipped_reservation_groups":false,"editable_reservation_groups":[],"tariff_level_name":"Auto
49
+ Priced as: Rack Rate","gross_including_packaged_item_in_cents":38000,"pre_adjusted_gross_including_packaged_item_in_cents":64000,"gross_in_cents":20000,"pre_adjusted_gross_in_cents":40000,"pre_adjusted_commission_in_cents":0,"cost_in_cents":20000,"sub_items_gross_in_cents":18000,"adjustments_attributes":[{"id":6,"gross_in_cents":-20000,"creator":{"_access_ip":null,"_access_key":null,"_crypted_password":null,"_login":null,"_password":null,"_remember_token":null,"_remember_token_expires_at":null,"_salt":null,"active":true,"age":null,"business_number":null,"business_number_type":null,"created_at":"2013-03-01T00:00:02+10:30","creator_id":null,"currency_iso_code":"AUD","first_name":"administrator","gender":null,"id":1,"internal_staff":true,"internal_subdivision":false,"last_name":"administrator","name":"Administrator
50
+ Administrator","notes":null,"remember_token":null,"remember_token_expires_at":null,"salt":null,"title":null,"updated_at":"2013-03-01T00:00:03+10:30","updator_id":null},"created_at":"2013-03-01T00:40:04+10:30","description":"50%
51
+ Off","adjustable_item_type":"Reservation","adjustable_item_id":1,"automatic":true}],"rules":[{"unique_name":"Test
52
+ Discount Hilton","description":"","display_name":"Test Discount Hilton"}],"package":false,"sub_reservation_depth":0,"sub_reservations_attributes":[{"id":3,"booking_id":1,"description":"You
53
+ have declined Travel Insurance for your booking. If you wish to add Travel
54
+ Insurance to this booking, please contact the SeaLink Travel Group on 13 13
55
+ 01 prior to commencing your travels.","comment":null,"active":true,"service_ids":[7,8],"resource_id":4,"quantity":null,"complete":true,"reason_not_complete":null,"enough_time_before_travel_to_edit":true,"product_type_id":7,"itinerary_footer":true,"fare_basis_set_id":8,"manually_priced":false,"manually_assigned_fare_basis_set":false,"has_fare_basis":true,"fare_basis_season_name":"","fare_basis_pointer_id":4,"pick_up_info":null,"drop_off_info":null,"selection_name":"Travel
56
+ Insurance - Declined","product_name_underscore":"travel_insurance","resource_class_name_underscore":"insurance","resource_class_name":"Insurance","first_travel_date":{"_type":"Date","_value":"2016-03-01"},"last_travel_date":{"_type":"Date","_value":"2016-03-02"},"durational":true,"duration":2,"duration_units":"Days","date_start_label":"Start
57
+ Date:","date_end_label":"End Date:","has_skipped_reservation_groups":false,"editable_reservation_groups":[],"tariff_level_name":"Auto
58
+ Priced as: Rack Rate","gross_including_packaged_item_in_cents":12000,"pre_adjusted_gross_including_packaged_item_in_cents":12000,"gross_in_cents":12000,"pre_adjusted_gross_in_cents":12000,"pre_adjusted_commission_in_cents":0,"cost_in_cents":8000,"adjustments_attributes":[],"rules":[],"package":false,"sub_reservation_depth":1,"extra_pick":null,"child_resource":true,"pending_confirmation":false,"confirmation_request_fields":["pick_up_information","drop_off_information","vendor_pnr","notes_for_vendor","vendor_staff","note_for_inventory_type_change"],"report_reservation_changes":false,"vendor_pnr":null,"pick_up_information":null,"drop_off_information":null,"vendor_staff":null,"notes_for_vendor":null,"passenger_ids":[1,2],"passenger_splits":[{"commission_in_cents":0,"commission_percentage":"0.0","consumer_id":1,"consumer_splittable_id":3,"consumer_splittable_type":"Reservation","created_at":"2013-03-01T00:17:34+10:30","gross_in_cents":6000,"id":7,"services_deck_division_id":null,"updated_at":"2013-03-01T00:17:34+10:30"},{"commission_in_cents":0,"commission_percentage":"0.0","consumer_id":2,"consumer_splittable_id":3,"consumer_splittable_type":"Reservation","created_at":"2013-03-01T00:17:34+10:30","gross_in_cents":6000,"id":8,"services_deck_division_id":null,"updated_at":"2013-03-01T00:17:34+10:30"}],"vehicle_ids":[],"vehicle_splits":[],"consumer_grosses":{"1":6000,"2":6000}},{"id":2,"booking_id":1,"description":"QBE
59
+ Travel Insurance Policy E known as the ''Australian Cancellation and Additional
60
+ Expenses'' plan has been included into this booking. This covers you for defined
61
+ unforeseen cancellations and additional expenses. Please refer to the Product
62
+ Disclosure Statement for further information.","comment":null,"active":true,"service_ids":[5,6],"resource_id":3,"quantity":null,"complete":true,"reason_not_complete":null,"enough_time_before_travel_to_edit":true,"product_type_id":7,"itinerary_footer":true,"fare_basis_set_id":8,"manually_priced":false,"manually_assigned_fare_basis_set":false,"has_fare_basis":true,"fare_basis_season_name":"","fare_basis_pointer_id":4,"pick_up_info":null,"drop_off_info":null,"selection_name":"QBE
63
+ Travel Insurance - Policy E","product_name_underscore":"travel_insurance","resource_class_name_underscore":"insurance","resource_class_name":"Insurance","first_travel_date":{"_type":"Date","_value":"2016-03-01"},"last_travel_date":{"_type":"Date","_value":"2016-03-02"},"durational":true,"duration":2,"duration_units":"Days","date_start_label":"Start
64
+ Date:","date_end_label":"End Date:","has_skipped_reservation_groups":false,"editable_reservation_groups":[],"tariff_level_name":"Auto
65
+ Priced as: Rack Rate","gross_including_packaged_item_in_cents":6000,"pre_adjusted_gross_including_packaged_item_in_cents":12000,"gross_in_cents":6000,"pre_adjusted_gross_in_cents":12000,"pre_adjusted_commission_in_cents":0,"cost_in_cents":8000,"adjustments_attributes":[{"id":5,"gross_in_cents":-6000,"creator":{"_access_ip":null,"_access_key":null,"_crypted_password":null,"_login":null,"_password":null,"_remember_token":null,"_remember_token_expires_at":null,"_salt":null,"active":true,"age":null,"business_number":null,"business_number_type":null,"created_at":"2013-03-01T00:00:02+10:30","creator_id":null,"currency_iso_code":"AUD","first_name":"administrator","gender":null,"id":1,"internal_staff":true,"internal_subdivision":false,"last_name":"administrator","name":"Administrator
66
+ Administrator","notes":null,"remember_token":null,"remember_token_expires_at":null,"salt":null,"title":null,"updated_at":"2013-03-01T00:00:03+10:30","updator_id":null},"created_at":"2013-03-01T00:40:04+10:30","description":"50%
67
+ Off","adjustable_item_type":"Reservation","adjustable_item_id":2,"automatic":true}],"rules":[{"unique_name":"QBE
68
+ Get Me","description":"","display_name":"QBE Get Me"}],"package":false,"sub_reservation_depth":1,"extra_pick":null,"child_resource":true,"pending_confirmation":false,"confirmation_request_fields":["pick_up_information","drop_off_information","vendor_pnr","notes_for_vendor","vendor_staff","note_for_inventory_type_change"],"report_reservation_changes":false,"vendor_pnr":null,"pick_up_information":null,"drop_off_information":null,"vendor_staff":null,"notes_for_vendor":null,"passenger_ids":[1,2],"passenger_splits":[{"commission_in_cents":0,"commission_percentage":"0.0","consumer_id":1,"consumer_splittable_id":2,"consumer_splittable_type":"Reservation","created_at":"2013-03-01T00:11:08+10:30","gross_in_cents":6000,"id":3,"services_deck_division_id":null,"updated_at":"2013-03-01T00:11:08+10:30"},{"commission_in_cents":0,"commission_percentage":"0.0","consumer_id":2,"consumer_splittable_id":2,"consumer_splittable_type":"Reservation","created_at":"2013-03-01T00:11:08+10:30","gross_in_cents":6000,"id":4,"services_deck_division_id":null,"updated_at":"2013-03-01T00:11:08+10:30"}],"vehicle_ids":[],"vehicle_splits":[],"consumer_grosses":{"1":3000,"2":3000}}],"extra_pick":null,"child_resource":null,"pending_confirmation":false,"confirmation_request_fields":[],"report_reservation_changes":false,"vendor_pnr":null,"pick_up_information":null,"drop_off_information":null,"vendor_staff":null,"notes_for_vendor":null,"passenger_ids":[1,2],"passenger_splits":[{"commission_in_cents":0,"commission_percentage":"0.0","consumer_id":1,"consumer_splittable_id":1,"consumer_splittable_type":"Reservation","created_at":"2013-03-01T00:08:00+10:30","gross_in_cents":0,"id":1,"services_deck_division_id":null,"updated_at":"2013-03-01T00:08:00+10:30"},{"commission_in_cents":0,"commission_percentage":"0.0","consumer_id":2,"consumer_splittable_id":1,"consumer_splittable_type":"Reservation","created_at":"2013-03-01T00:08:00+10:30","gross_in_cents":0,"id":2,"services_deck_division_id":null,"updated_at":"2013-03-01T00:08:00+10:30"}],"vehicle_ids":[],"vehicle_splits":[],"consumer_grosses":{"1":0,"2":0}}],"adjustments_attributes":[],"payments_attributes":[],"payment_types_attributes":[{"id":5,"name":"master","description":"master","payment_method":"credit_card","credit_card_brand":"MasterCard","transaction_fee":"0.0","active":true,"position":2,"surchargeable":false,"for_frequent_traveller_redemption":false,"comment_required":false,"external":true},{"id":4,"name":"visa","description":"visa","payment_method":"credit_card","credit_card_brand":"Visa","transaction_fee":"0.0","active":true,"position":3,"surchargeable":false,"for_frequent_traveller_redemption":false,"comment_required":false,"external":true},{"id":7,"name":"PayPal","description":"Payments
69
+ made via PayPal account","payment_method":"paypal","credit_card_brand":null,"transaction_fee":"0.0","active":true,"position":6,"surchargeable":false,"for_frequent_traveller_redemption":false,"comment_required":false,"external":true}]}'
70
+ http_version: '1.1'
71
+ recorded_at: Wed, 25 Mar 2015 22:44:15 GMT
72
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,117 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://0.0.0.0:8080/api/bookings/1.json?
6
+ body:
7
+ encoding: US-ASCII
8
+ string: access_key=<QT_KEY>
9
+ headers:
10
+ content-length:
11
+ - '0'
12
+ response:
13
+ status:
14
+ code: 200
15
+ message: ! 'OK '
16
+ headers:
17
+ p3p:
18
+ - CP="IDC DSP CAO COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"
19
+ content-type:
20
+ - application/json; charset=utf-8
21
+ x-ua-compatible:
22
+ - IE=Edge,chrome=1
23
+ etag:
24
+ - ! '"979f11e6024532d965e0b8281488f134"'
25
+ cache-control:
26
+ - max-age=0, private, must-revalidate
27
+ x-request-id:
28
+ - 843b269e235cf88c2b29901b8ae25c85
29
+ x-runtime:
30
+ - '0.128731'
31
+ date:
32
+ - Thu, 28 Feb 2013 14:20:59 GMT
33
+ x-rack-cache:
34
+ - miss
35
+ server:
36
+ - WEBrick/1.3.1 (Ruby/2.1.5/2014-11-13)
37
+ content-length:
38
+ - '11694'
39
+ connection:
40
+ - close
41
+ set-cookie:
42
+ - _session_id=27e1d1ad1683ee7e4955e0f7384f1de2; path=/; HttpOnly
43
+ body:
44
+ encoding: US-ASCII
45
+ string: ! '{"id":1,"state":"new","reference":"222223","public_comments":null,"internal_comments":null,"customer_contact_name":null,"customer_contact_phone":null,"customer_contact_mobile":null,"customer_contact_email":null,"currency_iso_code":"AUD","country_id":14,"post_code":null,"referral_code_id":1,"total_adjustments_in_cents":0,"pre_adjusted_gross_in_cents":38000,"nett_in_cents":38000,"gross_in_cents":38000,"commission_in_cents":0,"balance_in_cents":38000,"paid_in_cents":0,"surcharge_in_cents":0,"deposit_in_cents":0,"web_site_name":null,"promo_code":null,"insurance_offered":false,"deposit_due_on":{"_type":"Date","_value":"2016-03-01T00:00:00+10:30"},"balance_due_on":{"_type":"Date","_value":"2016-03-01T00:00:00+10:30"},"first_travel_date":{"_type":"Date","_value":"2016-03-01"},"last_travel_date":{"_type":"Date","_value":"2016-03-02"},"complete":true,"reason_not_complete":null,"discardable_in":50,"inactivatable_in":0,"notices":{},"deposit_relevant":false,"passenger_ids":[1,2],"vehicle_ids":[],"reservation_ids":[1,3,2],"adjustment_ids":[],"todo_items":[],"confirmation_requests":[],"passengers_attributes":[{"id":1,"title":null,"first_name":null,"last_name":null,"passenger_type_id":1,"age":30,"gender":null,"position":1},{"id":2,"title":null,"first_name":null,"last_name":null,"passenger_type_id":1,"age":30,"gender":null,"position":2}],"vehicles_attributes":[],"reservations_attributes":[{"id":1,"booking_id":1,"description":"A
46
+ basic studio room","comment":"","active":true,"service_ids":[3,4],"resource_id":6,"quantity":null,"complete":true,"reason_not_complete":null,"enough_time_before_travel_to_edit":true,"bed_configuration":"1
47
+ x Double","product_type_id":2,"itinerary_footer":false,"fare_basis_set_id":12,"manually_priced":false,"manually_assigned_fare_basis_set":false,"has_fare_basis":true,"fare_basis_season_name":"","fare_basis_pointer_id":6,"pick_up_info":null,"drop_off_info":null,"selection_name":"Hilton
48
+ Hotel: Executive Room","product_name_underscore":"accommodation","resource_class_name_underscore":"accommodation","resource_class_name":"Accommodation","first_travel_date":{"_type":"Date","_value":"2016-03-01"},"last_travel_date":{"_type":"Date","_value":"2016-03-02"},"durational":true,"duration":2,"checkout_date":{"_type":"Date","_value":"2016-03-03"},"duration_units":"Nights","date_start_label":"In:","date_end_label":"Out:","accommodation_extra_picks":false,"has_skipped_reservation_groups":false,"editable_reservation_groups":[],"tariff_level_name":"Auto
49
+ Priced as: Rack Rate","gross_including_packaged_item_in_cents":38000,"pre_adjusted_gross_including_packaged_item_in_cents":64000,"gross_in_cents":20000,"pre_adjusted_gross_in_cents":40000,"pre_adjusted_commission_in_cents":0,"cost_in_cents":20000,"sub_items_gross_in_cents":18000,"adjustments_attributes":[{"id":6,"gross_in_cents":-20000,"creator":{"_access_ip":null,"_access_key":null,"_crypted_password":null,"_login":null,"_password":null,"_remember_token":null,"_remember_token_expires_at":null,"_salt":null,"active":true,"age":null,"business_number":null,"business_number_type":null,"created_at":"2013-03-01T00:00:02+10:30","creator_id":null,"currency_iso_code":"AUD","first_name":"administrator","gender":null,"id":1,"internal_staff":true,"internal_subdivision":false,"last_name":"administrator","name":"Administrator
50
+ Administrator","notes":null,"remember_token":null,"remember_token_expires_at":null,"salt":null,"title":null,"updated_at":"2013-03-01T00:00:03+10:30","updator_id":null},"created_at":"2013-03-01T00:40:04+10:30","description":"50%
51
+ Off","adjustable_item_type":"Reservation","adjustable_item_id":1,"automatic":true}],"rules":[{"unique_name":"Test
52
+ Discount Hilton","description":"","display_name":"Test Discount Hilton"}],"package":false,"sub_reservation_depth":0,"sub_reservations_attributes":[{"id":3,"booking_id":1,"description":"You
53
+ have declined Travel Insurance for your booking. If you wish to add Travel
54
+ Insurance to this booking, please contact the SeaLink Travel Group on 13 13
55
+ 01 prior to commencing your travels.","comment":null,"active":true,"service_ids":[7,8],"resource_id":4,"quantity":null,"complete":true,"reason_not_complete":null,"enough_time_before_travel_to_edit":true,"product_type_id":7,"itinerary_footer":true,"fare_basis_set_id":8,"manually_priced":false,"manually_assigned_fare_basis_set":false,"has_fare_basis":true,"fare_basis_season_name":"","fare_basis_pointer_id":4,"pick_up_info":null,"drop_off_info":null,"selection_name":"Travel
56
+ Insurance - Declined","product_name_underscore":"travel_insurance","resource_class_name_underscore":"insurance","resource_class_name":"Insurance","first_travel_date":{"_type":"Date","_value":"2016-03-01"},"last_travel_date":{"_type":"Date","_value":"2016-03-02"},"durational":true,"duration":2,"duration_units":"Days","date_start_label":"Start
57
+ Date:","date_end_label":"End Date:","has_skipped_reservation_groups":false,"editable_reservation_groups":[],"tariff_level_name":"Auto
58
+ Priced as: Rack Rate","gross_including_packaged_item_in_cents":12000,"pre_adjusted_gross_including_packaged_item_in_cents":12000,"gross_in_cents":12000,"pre_adjusted_gross_in_cents":12000,"pre_adjusted_commission_in_cents":0,"cost_in_cents":8000,"adjustments_attributes":[],"rules":[],"package":false,"sub_reservation_depth":1,"extra_pick":null,"child_resource":true,"pending_confirmation":false,"confirmation_request_fields":["pick_up_information","drop_off_information","vendor_pnr","notes_for_vendor","vendor_staff","note_for_inventory_type_change"],"report_reservation_changes":false,"vendor_pnr":null,"pickup_information":null,"dropoff_information":null,"vendor_staff":null,"notes_for_vendor":null,"passenger_ids":[1,2],"passenger_splits":[{"commission_in_cents":0,"commission_percentage":"0.0","consumer_id":1,"consumer_splittable_id":3,"consumer_splittable_type":"Reservation","created_at":"2013-03-01T00:17:34+10:30","gross_in_cents":6000,"id":7,"services_deck_division_id":null,"updated_at":"2013-03-01T00:17:34+10:30"},{"commission_in_cents":0,"commission_percentage":"0.0","consumer_id":2,"consumer_splittable_id":3,"consumer_splittable_type":"Reservation","created_at":"2013-03-01T00:17:34+10:30","gross_in_cents":6000,"id":8,"services_deck_division_id":null,"updated_at":"2013-03-01T00:17:34+10:30"}],"vehicle_ids":[],"vehicle_splits":[],"consumer_grosses":{"1":6000,"2":6000}},{"id":2,"booking_id":1,"description":"QBE
59
+ Travel Insurance Policy E known as the ''Australian Cancellation and Additional
60
+ Expenses'' plan has been included into this booking. This covers you for defined
61
+ unforeseen cancellations and additional expenses. Please refer to the Product
62
+ Disclosure Statement for further information.","comment":null,"active":true,"service_ids":[5,6],"resource_id":3,"quantity":null,"complete":true,"reason_not_complete":null,"enough_time_before_travel_to_edit":true,"product_type_id":7,"itinerary_footer":true,"fare_basis_set_id":8,"manually_priced":false,"manually_assigned_fare_basis_set":false,"has_fare_basis":true,"fare_basis_season_name":"","fare_basis_pointer_id":4,"pick_up_info":null,"drop_off_info":null,"selection_name":"QBE
63
+ Travel Insurance - Policy E","product_name_underscore":"travel_insurance","resource_class_name_underscore":"insurance","resource_class_name":"Insurance","first_travel_date":{"_type":"Date","_value":"2016-03-01"},"last_travel_date":{"_type":"Date","_value":"2016-03-02"},"durational":true,"duration":2,"duration_units":"Days","date_start_label":"Start
64
+ Date:","date_end_label":"End Date:","has_skipped_reservation_groups":false,"editable_reservation_groups":[],"tariff_level_name":"Auto
65
+ Priced as: Rack Rate","gross_including_packaged_item_in_cents":6000,"pre_adjusted_gross_including_packaged_item_in_cents":12000,"gross_in_cents":6000,"pre_adjusted_gross_in_cents":12000,"pre_adjusted_commission_in_cents":0,"cost_in_cents":8000,"adjustments_attributes":[{"id":5,"gross_in_cents":-6000,"creator":{"_access_ip":null,"_access_key":null,"_crypted_password":null,"_login":null,"_password":null,"_remember_token":null,"_remember_token_expires_at":null,"_salt":null,"active":true,"age":null,"business_number":null,"business_number_type":null,"created_at":"2013-03-01T00:00:02+10:30","creator_id":null,"currency_iso_code":"AUD","first_name":"administrator","gender":null,"id":1,"internal_staff":true,"internal_subdivision":false,"last_name":"administrator","name":"Administrator
66
+ Administrator","notes":null,"remember_token":null,"remember_token_expires_at":null,"salt":null,"title":null,"updated_at":"2013-03-01T00:00:03+10:30","updator_id":null},"created_at":"2013-03-01T00:40:04+10:30","description":"50%
67
+ Off","adjustable_item_type":"Reservation","adjustable_item_id":2,"automatic":true}],"rules":[{"unique_name":"QBE
68
+ Get Me","description":"","display_name":"QBE Get Me"}],"package":false,"sub_reservation_depth":1,"extra_pick":null,"child_resource":true,"pending_confirmation":false,"confirmation_request_fields":["pick_up_information","drop_off_information","vendor_pnr","notes_for_vendor","vendor_staff","note_for_inventory_type_change"],"report_reservation_changes":false,"vendor_pnr":null,"pickup_information":null,"dropoff_information":null,"vendor_staff":null,"notes_for_vendor":null,"passenger_ids":[1,2],"passenger_splits":[{"commission_in_cents":0,"commission_percentage":"0.0","consumer_id":1,"consumer_splittable_id":2,"consumer_splittable_type":"Reservation","created_at":"2013-03-01T00:11:08+10:30","gross_in_cents":6000,"id":3,"services_deck_division_id":null,"updated_at":"2013-03-01T00:11:08+10:30"},{"commission_in_cents":0,"commission_percentage":"0.0","consumer_id":2,"consumer_splittable_id":2,"consumer_splittable_type":"Reservation","created_at":"2013-03-01T00:11:08+10:30","gross_in_cents":6000,"id":4,"services_deck_division_id":null,"updated_at":"2013-03-01T00:11:08+10:30"}],"vehicle_ids":[],"vehicle_splits":[],"consumer_grosses":{"1":3000,"2":3000}}],"extra_pick":null,"child_resource":null,"pending_confirmation":false,"confirmation_request_fields":[],"report_reservation_changes":false,"vendor_pnr":null,"pickup_information":null,"dropoff_information":null,"vendor_staff":null,"notes_for_vendor":null,"passenger_ids":[1,2],"passenger_splits":[{"commission_in_cents":0,"commission_percentage":"0.0","consumer_id":1,"consumer_splittable_id":1,"consumer_splittable_type":"Reservation","created_at":"2013-03-01T00:08:00+10:30","gross_in_cents":0,"id":1,"services_deck_division_id":null,"updated_at":"2013-03-01T00:08:00+10:30"},{"commission_in_cents":0,"commission_percentage":"0.0","consumer_id":2,"consumer_splittable_id":1,"consumer_splittable_type":"Reservation","created_at":"2013-03-01T00:08:00+10:30","gross_in_cents":0,"id":2,"services_deck_division_id":null,"updated_at":"2013-03-01T00:08:00+10:30"}],"vehicle_ids":[],"vehicle_splits":[],"consumer_grosses":{"1":0,"2":0}}],"adjustments_attributes":[],"payments_attributes":[],"payment_types_attributes":[{"id":5,"name":"master","description":"master","payment_method":"credit_card","credit_card_brand":"MasterCard","transaction_fee":"0.0","active":true,"position":2,"surchargeable":false,"for_frequent_traveller_redemption":false,"comment_required":false,"external":true},{"id":4,"name":"visa","description":"visa","payment_method":"credit_card","credit_card_brand":"Visa","transaction_fee":"0.0","active":true,"position":3,"surchargeable":false,"for_frequent_traveller_redemption":false,"comment_required":false,"external":true},{"id":7,"name":"PayPal","description":"Payments
69
+ made via PayPal account","payment_method":"paypal","credit_card_brand":null,"transaction_fee":"0.0","active":true,"position":6,"surchargeable":false,"for_frequent_traveller_redemption":false,"comment_required":false,"external":true}]}'
70
+ http_version: '1.1'
71
+ recorded_at: Thu, 18 Dec 2014 07:37:48 GMT
72
+ - request:
73
+ method: get
74
+ uri: http://0.0.0.0:8080/api/bookings/1/documents.json?last_group=true&regenerate=false
75
+ body:
76
+ encoding: US-ASCII
77
+ string: access_key=<QT_KEY>
78
+ headers:
79
+ content-length:
80
+ - '0'
81
+ response:
82
+ status:
83
+ code: 200
84
+ message: ! 'OK '
85
+ headers:
86
+ p3p:
87
+ - CP="IDC DSP CAO COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"
88
+ content-type:
89
+ - application/json; charset=utf-8
90
+ x-ua-compatible:
91
+ - IE=Edge,chrome=1
92
+ etag:
93
+ - ! '"877efa1d49e3e645f3aa1d836e4ee620"'
94
+ cache-control:
95
+ - max-age=0, private, must-revalidate
96
+ x-request-id:
97
+ - d0aeb7bb3e6bb5b030ede5cfe6ca2c91
98
+ x-runtime:
99
+ - '0.019773'
100
+ date:
101
+ - Thu, 28 Feb 2013 14:20:59 GMT
102
+ x-rack-cache:
103
+ - miss
104
+ server:
105
+ - WEBrick/1.3.1 (Ruby/2.1.5/2014-11-13)
106
+ content-length:
107
+ - '51'
108
+ connection:
109
+ - close
110
+ set-cookie:
111
+ - _session_id=363eae498e13e14167f4e17b6bc7d532; path=/; HttpOnly
112
+ body:
113
+ encoding: US-ASCII
114
+ string: ! '[{"id":1,"name":"Invoice Document","booking_id":1}]'
115
+ http_version: '1.1'
116
+ recorded_at: Thu, 18 Dec 2014 07:37:48 GMT
117
+ recorded_with: VCR 2.9.3