gillbus 0.11.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (95) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +22 -0
  3. data/.ruby-version +1 -0
  4. data/Gemfile +10 -0
  5. data/Guardfile +29 -0
  6. data/LICENSE.txt +22 -0
  7. data/README.md +140 -0
  8. data/Rakefile +9 -0
  9. data/gillbus.gemspec +31 -0
  10. data/lib/gillbus/base_request.rb +99 -0
  11. data/lib/gillbus/base_response.rb +43 -0
  12. data/lib/gillbus/buy_booking.rb +74 -0
  13. data/lib/gillbus/buy_tickets.rb +36 -0
  14. data/lib/gillbus/cancel_order.rb +55 -0
  15. data/lib/gillbus/drivers/faraday_response_file_logger.rb +19 -0
  16. data/lib/gillbus/find_order.rb +37 -0
  17. data/lib/gillbus/get_all_cities.rb +24 -0
  18. data/lib/gillbus/get_cities.rb +34 -0
  19. data/lib/gillbus/get_countries.rb +24 -0
  20. data/lib/gillbus/get_dates_new.rb +35 -0
  21. data/lib/gillbus/get_order_status.rb +28 -0
  22. data/lib/gillbus/get_order_ticket.rb +62 -0
  23. data/lib/gillbus/get_required_fields.rb +32 -0
  24. data/lib/gillbus/get_time_table.rb +33 -0
  25. data/lib/gillbus/get_trip_seats.rb +61 -0
  26. data/lib/gillbus/get_trips.rb +13 -0
  27. data/lib/gillbus/helpers/fields.rb +47 -0
  28. data/lib/gillbus/helpers/parser.rb +100 -0
  29. data/lib/gillbus/helpers/update_attrs.rb +15 -0
  30. data/lib/gillbus/lock_seats.rb +82 -0
  31. data/lib/gillbus/logout.rb +19 -0
  32. data/lib/gillbus/parse_error.rb +11 -0
  33. data/lib/gillbus/reserve_tickets.rb +13 -0
  34. data/lib/gillbus/search_trips.rb +96 -0
  35. data/lib/gillbus/session_login.rb +32 -0
  36. data/lib/gillbus/structs/commission.rb +54 -0
  37. data/lib/gillbus/structs/item.rb +14 -0
  38. data/lib/gillbus/structs/passenger_discount.rb +37 -0
  39. data/lib/gillbus/structs/point.rb +38 -0
  40. data/lib/gillbus/structs/return_cause.rb +23 -0
  41. data/lib/gillbus/structs/seat.rb +38 -0
  42. data/lib/gillbus/structs/segment.rb +161 -0
  43. data/lib/gillbus/structs/tariff.rb +59 -0
  44. data/lib/gillbus/structs/ticket.rb +285 -0
  45. data/lib/gillbus/structs/timetable_segment.rb +51 -0
  46. data/lib/gillbus/structs/timetable_trip.rb +77 -0
  47. data/lib/gillbus/structs/trip.rb +164 -0
  48. data/lib/gillbus/tickets_booking.rb +182 -0
  49. data/lib/gillbus/unlock_seats.rb +15 -0
  50. data/lib/gillbus/version.rb +3 -0
  51. data/lib/gillbus.rb +86 -0
  52. data/script/example_booking.rb +82 -0
  53. data/script/example_booking_with_segments.rb +90 -0
  54. data/script/example_canceling_booking.rb +67 -0
  55. data/script/example_canceling_reservation.rb +69 -0
  56. data/script/example_reservation.rb +88 -0
  57. data/test/buy_booking_test.rb +32 -0
  58. data/test/buy_tickets_test.rb +12 -0
  59. data/test/cancel_order_test.rb +12 -0
  60. data/test/error_test.rb +31 -0
  61. data/test/find_order_test.rb +24 -0
  62. data/test/get_cities_test.rb +12 -0
  63. data/test/get_countries_test.rb +12 -0
  64. data/test/get_dates_new_test.rb +12 -0
  65. data/test/get_order_ticket_test.rb +12 -0
  66. data/test/get_time_table_test.rb +21 -0
  67. data/test/get_trip_seats_test.rb +40 -0
  68. data/test/lock_seats_test.rb +70 -0
  69. data/test/reserve_tickets_test.rb +22 -0
  70. data/test/responses/buyBooking.xml +9 -0
  71. data/test/responses/buyTickets.xml +7 -0
  72. data/test/responses/cancelOrder.xml +8 -0
  73. data/test/responses/error.xml +1 -0
  74. data/test/responses/findOrder.xml +296 -0
  75. data/test/responses/getCities.xml +266 -0
  76. data/test/responses/getCountries.xml +90 -0
  77. data/test/responses/getOrderTicket.xml +3 -0
  78. data/test/responses/getTimeTable.xml +81 -0
  79. data/test/responses/getTripSeats-one-empty-segment.xml +562 -0
  80. data/test/responses/getTripSeats-segments.xml +1052 -0
  81. data/test/responses/getTripSeats.xml +492 -0
  82. data/test/responses/lockSeats.xml +23 -0
  83. data/test/responses/reserveTickets.xml +76 -0
  84. data/test/responses/searchTrips-empty.xml +3 -0
  85. data/test/responses/searchTrips-prod.xml +193 -0
  86. data/test/responses/searchTrips-segments-roundtrip.xml +15812 -0
  87. data/test/responses/searchTrips-segments.xml +808 -0
  88. data/test/responses/sessionLogin.xml +3 -0
  89. data/test/responses/ticketsBooking.xml +75 -0
  90. data/test/responses/very_empty.xml +1 -0
  91. data/test/search_trips_test.rb +71 -0
  92. data/test/session_login_test.rb +12 -0
  93. data/test/test_helper.rb +3 -0
  94. data/test/tickets_booking_test.rb +16 -0
  95. metadata +303 -0
@@ -0,0 +1,32 @@
1
+ require "test_helper"
2
+
3
+ class BuyBookingTest < Minitest::Test
4
+
5
+ def response
6
+ Gillbus::BuyBooking::Response.parse_string(File.read('test/responses/buyBooking.xml'))
7
+ end
8
+
9
+ def test_request
10
+ # TODO: Добавить тесты и имплементацию для всех данных что есть в доке
11
+ request = Gillbus::BuyBooking::Request.new(
12
+ payment_method: Gillbus::BuyBooking::Request::METHOD_NOCASH,
13
+ ticket_count: 2,
14
+ ticket_numbers: ["123456", "654321"],
15
+ order_ids: ["53ec1fc6-e42a-42b2-b94f-1d5b47466526", "53ec1fc6-e42a-42b2-b94f-1d5b47466526"]
16
+ )
17
+ assert_equal({
18
+ paymentMethod: 3,
19
+ ticketCount: 2,
20
+ ticketNumber0: "123456",
21
+ ticketNumber1: "654321",
22
+ orderId0: "53ec1fc6-e42a-42b2-b94f-1d5b47466526",
23
+ orderId1: "53ec1fc6-e42a-42b2-b94f-1d5b47466526",
24
+ }, request.params)
25
+ end
26
+
27
+ def test_response
28
+ assert response.ticket.confirmation
29
+ assert_equal [123456, 654321], response.ticket.position_numbers
30
+ end
31
+
32
+ end
@@ -0,0 +1,12 @@
1
+ require "test_helper"
2
+
3
+ class BuyTicketsTest < Minitest::Test
4
+
5
+ def buy_tickets
6
+ Gillbus::BuyTickets::Response.parse_string(File.read('test/responses/buyTickets.xml'))
7
+ end
8
+
9
+ def test_buy_tickets
10
+ assert buy_tickets.ticket.confirmation
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ require "test_helper"
2
+
3
+ class CancelOrderTest < Minitest::Test
4
+
5
+ def cancel_order
6
+ Gillbus::CancelOrder::Response.parse_string(File.read('test/responses/cancelOrder.xml'))
7
+ end
8
+
9
+ def test_cancel_order
10
+ assert cancel_order.order_cancel.confirmation
11
+ end
12
+ end
@@ -0,0 +1,31 @@
1
+ require 'test_helper'
2
+
3
+ class ErrorTest < Minitest::Test
4
+
5
+ def error_response
6
+ Gillbus::SessionLogin::Response.parse_string(File.read('test/responses/error.xml'))
7
+ end
8
+
9
+ def malformed_response
10
+ Gillbus::SessionLogin::Response.parse_string('not an xml')
11
+ end
12
+
13
+ def malformed_response_2
14
+ Gillbus::SessionLogin::Response.parse_string('<NOTDATA></NOTDATA>')
15
+ end
16
+
17
+ def test_errorness
18
+ assert error_response.error?
19
+ assert_equal 4, error_response.error_code
20
+ assert_equal "Session not created error!", error_response.error_message
21
+ end
22
+
23
+ def test_malformed_errorness
24
+ assert malformed_response.error?
25
+ end
26
+
27
+ def test_malformed_2_errorness
28
+ assert malformed_response_2.error?
29
+ end
30
+
31
+ end
@@ -0,0 +1,24 @@
1
+ require 'test_helper'
2
+
3
+ class FindOrderTest < Minitest::Test
4
+
5
+ def find_order
6
+ Gillbus::FindOrder::Response.parse_string(File.read('test/responses/findOrder.xml'))
7
+ end
8
+
9
+ def test_number
10
+ assert_equal("14482", find_order.tickets.first.ticket_number)
11
+ end
12
+
13
+ def test_total
14
+ assert_equal(Money.new(20_46, 'UAH'), find_order.tickets.first.total_amount)
15
+ end
16
+
17
+ def test_status
18
+ assert_equal(:ticketed, find_order.tickets.first.ticket_status)
19
+ end
20
+
21
+ def test_return_causes
22
+ assert_equal(Money.new(20_38, 'UAH'), find_order.tickets.first.return_causes.first.approximate_amount)
23
+ end
24
+ end
@@ -0,0 +1,12 @@
1
+ require 'test_helper'
2
+
3
+ class GetCitiesTest < Minitest::Test
4
+
5
+ def get_cities
6
+ Gillbus::GetCities::Response.parse_string(File.read('test/responses/getCities.xml'))
7
+ end
8
+
9
+ def test_cities
10
+ assert_equal( 'Афины', get_cities.cities.first.name)
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ require 'test_helper'
2
+
3
+ class GetCountriesTest < Minitest::Test
4
+
5
+ def get_countries
6
+ Gillbus::GetCountries::Response.parse_string(File.read('test/responses/getCountries.xml'))
7
+ end
8
+
9
+ def test_countries
10
+ assert_equal( "Австрия", get_countries.countries.first.name)
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ require 'test_helper'
2
+
3
+ class GetDatesNewTest < Minitest::Test
4
+
5
+ def get_dates_new_empty
6
+ Gillbus::GetDatesNew::Response.parse_string(File.read('test/responses/very_empty.xml'))
7
+ end
8
+
9
+ def test_empty_response
10
+ assert_equal [], get_dates_new_empty.items
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ require 'test_helper'
2
+
3
+ class GetOrderTicketTest < Minitest::Test
4
+
5
+ def get_order_ticket
6
+ Gillbus::GetOrderTicket::Response.parse_string(File.read('test/responses/getOrderTicket.xml'))
7
+ end
8
+
9
+ def test_ticket
10
+ assert_equal( "base64 string", get_order_ticket.ticket)
11
+ end
12
+ end
@@ -0,0 +1,21 @@
1
+ require 'test_helper'
2
+
3
+ class GetTimeTableTest < Minitest::Test
4
+
5
+ def get_time_table
6
+ Gillbus::GetTimeTable::Response.parse_string(File.read('test/responses/getTimeTable.xml'))
7
+ end
8
+
9
+ def test_response
10
+ first_trip, second_trip = get_time_table.trips
11
+
12
+ assert first_trip.segments.size > 0
13
+ # assert_equal [1, 6], first_trip.days_of_week
14
+ assert_equal [:sunday, :friday], first_trip.days_of_week
15
+
16
+ # { :monday => 0, :tuesday => 1, :wednesday => 2, :thursday => 3, :friday => 4, :saturday => 5, :sunday => 6 }
17
+
18
+ assert second_trip.dates.size > 0
19
+ assert Date, second_trip.dates.first.class
20
+ end
21
+ end
@@ -0,0 +1,40 @@
1
+ require 'test_helper'
2
+
3
+ class GetTripSeatsTest < Minitest::Test
4
+
5
+ def get_trip_seats
6
+ Gillbus::GetTripSeats::Response.parse_string(File.read('test/responses/getTripSeats.xml'))
7
+ end
8
+
9
+ def get_trip_seats_with_segments
10
+ Gillbus::GetTripSeats::Response.parse_string(File.read('test/responses/getTripSeats-segments.xml'))
11
+ end
12
+
13
+ def get_trip_seats_with_one_empty_segment
14
+ Gillbus::GetTripSeats::Response.parse_string(File.read('test/responses/getTripSeats-one-empty-segment.xml'))
15
+ end
16
+
17
+ def test_seats
18
+ seats = get_trip_seats.seats
19
+ max_x = seats.map(&:x).max
20
+ max_y = seats.map(&:y).max
21
+ assert_equal( 70, seats.size )
22
+ assert_equal( 4, max_y )
23
+ assert_equal( 13, max_x )
24
+ end
25
+
26
+ def test_seats_with_segments
27
+ segments = get_trip_seats_with_segments.segments
28
+ assert_equal 2, segments.size
29
+ assert_equal [0, 1], segments.keys
30
+ assert_equal 70, segments.values.first.size
31
+ end
32
+
33
+ def test_seats_with_one_segment_without_seatmap
34
+ segments = get_trip_seats_with_one_empty_segment.segments
35
+ assert_equal 2, segments.size
36
+ assert_equal [0, 1], segments.keys
37
+ assert [], segments[0]
38
+ assert_equal 80, segments[1].size
39
+ end
40
+ end
@@ -0,0 +1,70 @@
1
+ require 'test_helper'
2
+
3
+ class LockSeatsRequestTest < Minitest::Test
4
+ def test_lock_params
5
+ request = Gillbus::LockSeats::Request.new(
6
+ trip_id: "2457369573939592570",
7
+ )
8
+ assert_equal({
9
+ tripId: "2457369573939592570",
10
+ }, request.params)
11
+ end
12
+
13
+ def test_lock_params_with_seats
14
+ request = Gillbus::LockSeats::Request.new(
15
+ trip_id: "2457369573939592570",
16
+ seat_ids: ["12", "13"],
17
+ )
18
+ assert_equal({
19
+ tripId: "2457369573939592570",
20
+ seatId0: "12",
21
+ seatId1: "13",
22
+ }, request.params)
23
+ end
24
+
25
+ def test_lock_params_with_back_seats
26
+ request = Gillbus::LockSeats::Request.new(
27
+ trip_id: "2457369573939592570",
28
+ seat_ids: ["12", "13"],
29
+ back_seat_ids: ["14", "15"],
30
+ )
31
+ assert_equal({
32
+ tripId: "2457369573939592570",
33
+ seatId0: "12",
34
+ seatId1: "13",
35
+ backSeatId0: "14",
36
+ backSeatId1: "15",
37
+ }, request.params)
38
+ end
39
+
40
+ def test_lock_params_with_segments_seats
41
+ request = Gillbus::LockSeats::Request.new(
42
+ trip_id: "2457369573939592570",
43
+ segments_seat_ids: {
44
+ 0 => ["12", "13"],
45
+ 1 => ["14", "15"],
46
+ }
47
+ )
48
+ assert_equal({
49
+ tripId: "2457369573939592570",
50
+ segment0seatId0: "12",
51
+ segment0seatId1: "13",
52
+ segment1seatId0: "14",
53
+ segment1seatId1: "15",
54
+ }, request.params)
55
+ end
56
+ end
57
+
58
+ class LockSeatsResponseTest < Minitest::Test
59
+ def lock_seats
60
+ Gillbus::LockSeats::Response.parse_string(File.read('test/responses/lockSeats.xml'))
61
+ end
62
+
63
+ def test_lock_seats
64
+ assert_equal( 899, lock_seats.time_limit)
65
+ end
66
+
67
+ def test_dictionary
68
+ assert_equal true, lock_seats.dictionary[:mail]
69
+ end
70
+ end
@@ -0,0 +1,22 @@
1
+ require 'test_helper'
2
+ require 'pry'
3
+
4
+ class ReserveTicketsTest < Minitest::Test
5
+
6
+ def reserve_tickets
7
+ Gillbus::ReserveTickets::Response.parse_string(File.read('test/responses/reserveTickets.xml'))
8
+ end
9
+
10
+ def test_number
11
+ assert_equal("8472", reserve_tickets.tickets.first.ticket_number)
12
+ end
13
+
14
+ def test_total
15
+ assert_equal(Money.new(110_00, "UAH"), reserve_tickets.tickets.first.total_amount)
16
+ end
17
+
18
+ def test_date_to_pay
19
+ assert_equal(DateTime.new(2013, 5, 22, 20, 30, 0, '+3'), reserve_tickets.tickets.first.date_to_pay)
20
+ end
21
+
22
+ end
@@ -0,0 +1,9 @@
1
+ <DATA>
2
+ <TICKET>
3
+ <ORDER_ID>7894846</ORDER_ID>
4
+ <CONFIRMATION>Y</CONFIRMATION>
5
+ <DATE>15.09.2011 12:53:05</DATE>
6
+ <POSITION_NUMBER>123456</POSITION_NUMBER>
7
+ <POSITION_NUMBER>654321</POSITION_NUMBER>
8
+ </TICKET>
9
+ </DATA>
@@ -0,0 +1,7 @@
1
+ <DATA>
2
+ <TICKET>
3
+ <ORDER_ID>7894846</ORDER_ID>
4
+ <CONFIRMATION>Y</CONFIRMATION>
5
+ <DATE>15.09.2011 12:53:05</DATE>
6
+ </TICKET>
7
+ </DATA>
@@ -0,0 +1,8 @@
1
+ <DATA>
2
+ <ORDER_CANCEL>
3
+ <NUMBER>14144</NUMBER>
4
+ <REASON>test</REASON>
5
+ <CONFIRMATION>Y</CONFIRMATION>
6
+ <DATE>21.02.2013 08:36:05</DATE>
7
+ </ORDER_CANCEL>
8
+ </DATA>
@@ -0,0 +1 @@
1
+ <DATA><MESSAGE><CODE>4</CODE><TEXT>Session not created error!</TEXT></MESSAGE></DATA>
@@ -0,0 +1,296 @@
1
+ <DATA>
2
+ <TICKET>
3
+ <TICKET_NUMBER>14482</TICKET_NUMBER>
4
+ <SYSTEM_NUMBER>14482</SYSTEM_NUMBER>
5
+ <ORDER_NUMBER>29581</ORDER_NUMBER>
6
+ <ORDER_ID>exampleorder_554</ORDER_ID>
7
+ <TICKET_STATUS>2</TICKET_STATUS>
8
+ <IS_BAGGAGE>false</IS_BAGGAGE>
9
+ <POLICY_NUMBER/>
10
+ <EXCHANGE_BLANK>false</EXCHANGE_BLANK>
11
+ <ENABLE_CHANGE_TRIP_DATE>true</ENABLE_CHANGE_TRIP_DATE>
12
+ <PASSENGER_FULL_NAME>Трофименко А.</PASSENGER_FULL_NAME>
13
+ <PASSENGER_FIRST_NAME>Алексей</PASSENGER_FIRST_NAME>
14
+ <PASSENGER_LAST_NAME>Трофименко</PASSENGER_LAST_NAME>
15
+ <PASSENGER_BIRTHDAY/>
16
+ <PASSENGER_STUDENT_TICKET/>
17
+ <PASSENGER_PHONE/>
18
+ <PASSENGER_PASSPORT/>
19
+ <AGENT_NAME>ДЕМ Для Агентств</AGENT_NAME>
20
+ <AGENT_PHONE>+00(044)496-08-00</AGENT_PHONE>
21
+ <CARRIER_NAME>ДЕМ Для Агентств</CARRIER_NAME>
22
+ <CARRIER_PHONE>+00(044)496-08-00</CARRIER_PHONE>
23
+ <BUS_MODEL>R Neoplan9</BUS_MODEL>
24
+ <CARRIAGE_NUMBER/>
25
+ <NUMBER_SEAT>33C</NUMBER_SEAT>
26
+ <TRIP_NUMBER>КийОдесса</TRIP_NUMBER>
27
+ <TRIP_MODE>1</TRIP_MODE>
28
+ <INTERNATIONAL_TRIP>false</INTERNATIONAL_TRIP>
29
+ <START_CITY>Киев</START_CITY>
30
+ <START_DATE>15.12.2014</START_DATE>
31
+ <START_TIME>08:00</START_TIME>
32
+ <END_CITY>Одесса</END_CITY>
33
+ <END_TIME>15:20</END_TIME>
34
+ <TYPE_TARIFF_NAME>Y</TYPE_TARIFF_NAME>
35
+ <TYPE_TARIFF_FULL_NAME>Базовый тариф</TYPE_TARIFF_FULL_NAME>
36
+ <TYPE_TARIFF_DESCRIPTION>Базовый тариф стоимости проезда одного пассажира в одном направлении.</TYPE_TARIFF_DESCRIPTION>
37
+ <TARIFF>0.31</TARIFF>
38
+ <TARIFF_VAT>0.09</TARIFF_VAT>
39
+ <FOREIGN_TARIFF>0</FOREIGN_TARIFF>
40
+ <FOREIGN_TARIFF_VAT>0</FOREIGN_TARIFF_VAT>
41
+ <NOTE/>
42
+ <BARCODE>АГН000014482АГН</BARCODE>
43
+ <END_DATE>15.12.2014</END_DATE>
44
+ <STATION_NAME/>
45
+ <STATION_END_NAME/>
46
+ <INSURANCE_NAME>Страховая Компания</INSURANCE_NAME>
47
+ <INSURANCE_PHONE/>
48
+ <AGENT_REG>35389109</AGENT_REG>
49
+ <CARRIER_REG>35389109</CARRIER_REG>
50
+ <INSURANCE_REG>0000000000</INSURANCE_REG>
51
+ <TOTAL_TARIFF>0.31</TOTAL_TARIFF>
52
+ <TOTAL_TARIFF_IN_CURRENCY>0.31</TOTAL_TARIFF_IN_CURRENCY>
53
+ <TOTAL_TARIFF_VAT>0.09</TOTAL_TARIFF_VAT>
54
+ <TOTAL_TARIFF_VAT_IN_CURRENCY>0.09</TOTAL_TARIFF_VAT_IN_CURRENCY>
55
+ <TARIFF_CUR_CODE>UAH</TARIFF_CUR_CODE>
56
+ <TARIFF_CUR_RATE/>
57
+ <TOTAL_AMOUNT>20.46</TOTAL_AMOUNT>
58
+ <TOTAL_AMOUNT_VAT>3.43</TOTAL_AMOUNT_VAT>
59
+ <SALE_CUR_CODE>UAH</SALE_CUR_CODE>
60
+ <CUSTOMER_NAME/>
61
+ <CUSTOMER_PHONE/>
62
+ <CUSTOMER_ADDRESS/>
63
+ <AGENT_ADDRESS>г Киев, ул Якіра, д 13-б</AGENT_ADDRESS>
64
+ <CARRIER_ADDRESS>г Киев, ул Якіра, д 13-б</CARRIER_ADDRESS>
65
+ <STATION_ADDRESS/>
66
+ <STATION_END_ADDRESS/>
67
+ <INSURANCE_ADDRESS>г Москва, ул 123</INSURANCE_ADDRESS>
68
+ <AGENT_CODE>АГН</AGENT_CODE>
69
+ <AGENT_CITY>Киев</AGENT_CITY>
70
+ <CARRIER_CODE>АГН</CARRIER_CODE>
71
+ <BEGIN_AVIACODE>IEV</BEGIN_AVIACODE>
72
+ <END_AVIACODE>ODS</END_AVIACODE>
73
+ <XT>0.06</XT>
74
+ <XT_VAT>0.01</XT_VAT>
75
+ <RETURN_CAUSE>
76
+ <ID>9865925BC03335F0E040A8C063037E33</ID>
77
+ <APPROXIMATE_AMOUNT>20.38</APPROXIMATE_AMOUNT>
78
+ <CAUSE>Добровільно за 10 хвилин до відправлення рейсу</CAUSE>
79
+ </RETURN_CAUSE>
80
+ <RETURN_CAUSE>
81
+ <ID>9865925BC03B35F0E040A8C063037E33</ID>
82
+ <APPROXIMATE_AMOUNT>20.34</APPROXIMATE_AMOUNT>
83
+ <CAUSE>Добровільно за час менше ніж 10 хвилин до відправлення рейсу</CAUSE>
84
+ </RETURN_CAUSE>
85
+ <RETURN_CAUSE>
86
+ <ID>9865925BC04335F0E040A8C063037E33</ID>
87
+ <APPROXIMATE_AMOUNT>20.06</APPROXIMATE_AMOUNT>
88
+ <CAUSE>Добровільно, через 3 години після відправлення рейсу</CAUSE>
89
+ </RETURN_CAUSE>
90
+ <RETURN_CAUSE>
91
+ <ID>9865925BC04B35F0E040A8C063037E33</ID>
92
+ <APPROXIMATE_AMOUNT>20.46</APPROXIMATE_AMOUNT>
93
+ <CAUSE>Примусово, відміна рейсу, нижчий клас автобусу</CAUSE>
94
+ </RETURN_CAUSE>
95
+ <RETURN_CAUSE>
96
+ <ID>9865925BC05335F0E040A8C063037E33</ID>
97
+ <APPROXIMATE_AMOUNT>20.46</APPROXIMATE_AMOUNT>
98
+ <CAUSE>Обєктивні причини, хвороба, нещасний випадок</CAUSE>
99
+ </RETURN_CAUSE>
100
+ <RETURN_CAUSE>
101
+ <ID>9865925BC05B35F0E040A8C063037E33</ID>
102
+ <APPROXIMATE_AMOUNT>20.46</APPROXIMATE_AMOUNT>
103
+ <CAUSE>Добровільно за 24 години до відправлення рейсу</CAUSE>
104
+ </RETURN_CAUSE>
105
+ <RETURN_CAUSE>
106
+ <ID>9865925BC06335F0E040A8C063037E33</ID>
107
+ <APPROXIMATE_AMOUNT>20.41</APPROXIMATE_AMOUNT>
108
+ <CAUSE>Добровільно за 2 години до відправлення рейсу</CAUSE>
109
+ </RETURN_CAUSE>
110
+ <RETURN_CAUSE>
111
+ <ID>FDAE2B8415FC3F2FE040A8C0630226E4</ID>
112
+ <APPROXIMATE_AMOUNT>20.46</APPROXIMATE_AMOUNT>
113
+ <CAUSE>Принудительно. Отмена рейса</CAUSE>
114
+ </RETURN_CAUSE>
115
+ <COMMISSION>
116
+ <TYPE>2</TYPE>
117
+ <CODE>YS</CODE>
118
+ <DESCRIPTION>Страховой сбор</DESCRIPTION>
119
+ <VALUE>0.06</VALUE>
120
+ <VAT>0.01</VAT>
121
+ <CURRENCY>UAH</CURRENCY>
122
+ <RATE>0</RATE>
123
+ <VALUE_IN_CURRENCY>0.05</VALUE_IN_CURRENCY>
124
+ <VAT_IN_CURRENCY>0.01</VAT_IN_CURRENCY>
125
+ </COMMISSION>
126
+ <COMMISSION>
127
+ <TYPE>6</TYPE>
128
+ <CODE>XP3</CODE>
129
+ <DESCRIPTION>Сервисный сбор</DESCRIPTION>
130
+ <VALUE>20</VALUE>
131
+ <VAT>3.33</VAT>
132
+ <CURRENCY>UAH</CURRENCY>
133
+ <RATE>0</RATE>
134
+ <VALUE_IN_CURRENCY>16.67</VALUE_IN_CURRENCY>
135
+ <VAT_IN_CURRENCY>3.33</VAT_IN_CURRENCY>
136
+ </COMMISSION>
137
+ <COMMISSION>
138
+ <TYPE>-2</TYPE>
139
+ <CODE>XT</CODE>
140
+ <DESCRIPTION>Сумма других сборов</DESCRIPTION>
141
+ <VALUE>0.06</VALUE>
142
+ <VAT>0.01</VAT>
143
+ <CURRENCY>UAH</CURRENCY>
144
+ <RATE>0</RATE>
145
+ <VALUE_IN_CURRENCY>0.05</VALUE_IN_CURRENCY>
146
+ <VAT_IN_CURRENCY>0.01</VAT_IN_CURRENCY>
147
+ </COMMISSION>
148
+ </TICKET>
149
+ <TICKET>
150
+ <TICKET_NUMBER>14483</TICKET_NUMBER>
151
+ <SYSTEM_NUMBER>14483</SYSTEM_NUMBER>
152
+ <ORDER_NUMBER>29581</ORDER_NUMBER>
153
+ <ORDER_ID>exampleorder_554</ORDER_ID>
154
+ <TICKET_STATUS>2</TICKET_STATUS>
155
+ <IS_BAGGAGE>false</IS_BAGGAGE>
156
+ <POLICY_NUMBER/>
157
+ <EXCHANGE_BLANK>false</EXCHANGE_BLANK>
158
+ <ENABLE_CHANGE_TRIP_DATE>true</ENABLE_CHANGE_TRIP_DATE>
159
+ <PASSENGER_FULL_NAME>Чуйкина А.</PASSENGER_FULL_NAME>
160
+ <PASSENGER_FIRST_NAME>Анна</PASSENGER_FIRST_NAME>
161
+ <PASSENGER_LAST_NAME>Чуйкина</PASSENGER_LAST_NAME>
162
+ <PASSENGER_BIRTHDAY/>
163
+ <PASSENGER_STUDENT_TICKET/>
164
+ <PASSENGER_PHONE/>
165
+ <PASSENGER_PASSPORT/>
166
+ <AGENT_NAME>ДЕМ Для Агентств</AGENT_NAME>
167
+ <AGENT_PHONE>+00(044)496-08-00</AGENT_PHONE>
168
+ <CARRIER_NAME>ДЕМ Для Агентств</CARRIER_NAME>
169
+ <CARRIER_PHONE>+00(044)496-08-00</CARRIER_PHONE>
170
+ <BUS_MODEL>R Neoplan9</BUS_MODEL>
171
+ <CARRIAGE_NUMBER/>
172
+ <NUMBER_SEAT>37</NUMBER_SEAT>
173
+ <TRIP_NUMBER>КийОдесса</TRIP_NUMBER>
174
+ <TRIP_MODE>1</TRIP_MODE>
175
+ <INTERNATIONAL_TRIP>false</INTERNATIONAL_TRIP>
176
+ <START_CITY>Киев</START_CITY>
177
+ <START_DATE>15.12.2014</START_DATE>
178
+ <START_TIME>08:00</START_TIME>
179
+ <END_CITY>Одесса</END_CITY>
180
+ <END_TIME>15:20</END_TIME>
181
+ <TYPE_TARIFF_NAME>Y</TYPE_TARIFF_NAME>
182
+ <TYPE_TARIFF_FULL_NAME>Базовый тариф</TYPE_TARIFF_FULL_NAME>
183
+ <TYPE_TARIFF_DESCRIPTION>Базовый тариф стоимости проезда одного пассажира в одном направлении.</TYPE_TARIFF_DESCRIPTION>
184
+ <TARIFF>0.31</TARIFF>
185
+ <TARIFF_VAT>0.09</TARIFF_VAT>
186
+ <FOREIGN_TARIFF>0</FOREIGN_TARIFF>
187
+ <FOREIGN_TARIFF_VAT>0</FOREIGN_TARIFF_VAT>
188
+ <NOTE/>
189
+ <BARCODE>АГН000014483АГН</BARCODE>
190
+ <END_DATE>15.12.2014</END_DATE>
191
+ <STATION_NAME/>
192
+ <STATION_END_NAME/>
193
+ <INSURANCE_NAME>Страховая Компания</INSURANCE_NAME>
194
+ <INSURANCE_PHONE/>
195
+ <AGENT_REG>35389109</AGENT_REG>
196
+ <CARRIER_REG>35389109</CARRIER_REG>
197
+ <INSURANCE_REG>0000000000</INSURANCE_REG>
198
+ <TOTAL_TARIFF>0.31</TOTAL_TARIFF>
199
+ <TOTAL_TARIFF_IN_CURRENCY>0.31</TOTAL_TARIFF_IN_CURRENCY>
200
+ <TOTAL_TARIFF_VAT>0.09</TOTAL_TARIFF_VAT>
201
+ <TOTAL_TARIFF_VAT_IN_CURRENCY>0.09</TOTAL_TARIFF_VAT_IN_CURRENCY>
202
+ <TARIFF_CUR_CODE>UAH</TARIFF_CUR_CODE>
203
+ <TARIFF_CUR_RATE/>
204
+ <TOTAL_AMOUNT>20.46</TOTAL_AMOUNT>
205
+ <TOTAL_AMOUNT_VAT>3.43</TOTAL_AMOUNT_VAT>
206
+ <SALE_CUR_CODE>UAH</SALE_CUR_CODE>
207
+ <CUSTOMER_NAME/>
208
+ <CUSTOMER_PHONE/>
209
+ <CUSTOMER_ADDRESS/>
210
+ <AGENT_ADDRESS>г Киев, ул Якіра, д 13-б</AGENT_ADDRESS>
211
+ <CARRIER_ADDRESS>г Киев, ул Якіра, д 13-б</CARRIER_ADDRESS>
212
+ <STATION_ADDRESS/>
213
+ <STATION_END_ADDRESS/>
214
+ <INSURANCE_ADDRESS>г Москва, ул 123</INSURANCE_ADDRESS>
215
+ <AGENT_CODE>АГН</AGENT_CODE>
216
+ <AGENT_CITY>Киев</AGENT_CITY>
217
+ <CARRIER_CODE>АГН</CARRIER_CODE>
218
+ <BEGIN_AVIACODE>IEV</BEGIN_AVIACODE>
219
+ <END_AVIACODE>ODS</END_AVIACODE>
220
+ <XT>0.06</XT>
221
+ <XT_VAT>0.01</XT_VAT>
222
+ <RETURN_CAUSE>
223
+ <ID>9865925BC03335F0E040A8C063037E33</ID>
224
+ <APPROXIMATE_AMOUNT>20.38</APPROXIMATE_AMOUNT>
225
+ <CAUSE>Добровільно за 10 хвилин до відправлення рейсу</CAUSE>
226
+ </RETURN_CAUSE>
227
+ <RETURN_CAUSE>
228
+ <ID>9865925BC03B35F0E040A8C063037E33</ID>
229
+ <APPROXIMATE_AMOUNT>20.34</APPROXIMATE_AMOUNT>
230
+ <CAUSE>Добровільно за час менше ніж 10 хвилин до відправлення рейсу</CAUSE>
231
+ </RETURN_CAUSE>
232
+ <RETURN_CAUSE>
233
+ <ID>9865925BC04335F0E040A8C063037E33</ID>
234
+ <APPROXIMATE_AMOUNT>20.06</APPROXIMATE_AMOUNT>
235
+ <CAUSE>Добровільно, через 3 години після відправлення рейсу</CAUSE>
236
+ </RETURN_CAUSE>
237
+ <RETURN_CAUSE>
238
+ <ID>9865925BC04B35F0E040A8C063037E33</ID>
239
+ <APPROXIMATE_AMOUNT>20.46</APPROXIMATE_AMOUNT>
240
+ <CAUSE>Примусово, відміна рейсу, нижчий клас автобусу</CAUSE>
241
+ </RETURN_CAUSE>
242
+ <RETURN_CAUSE>
243
+ <ID>9865925BC05335F0E040A8C063037E33</ID>
244
+ <APPROXIMATE_AMOUNT>20.46</APPROXIMATE_AMOUNT>
245
+ <CAUSE>Обєктивні причини, хвороба, нещасний випадок</CAUSE>
246
+ </RETURN_CAUSE>
247
+ <RETURN_CAUSE>
248
+ <ID>9865925BC05B35F0E040A8C063037E33</ID>
249
+ <APPROXIMATE_AMOUNT>20.46</APPROXIMATE_AMOUNT>
250
+ <CAUSE>Добровільно за 24 години до відправлення рейсу</CAUSE>
251
+ </RETURN_CAUSE>
252
+ <RETURN_CAUSE>
253
+ <ID>9865925BC06335F0E040A8C063037E33</ID>
254
+ <APPROXIMATE_AMOUNT>20.41</APPROXIMATE_AMOUNT>
255
+ <CAUSE>Добровільно за 2 години до відправлення рейсу</CAUSE>
256
+ </RETURN_CAUSE>
257
+ <RETURN_CAUSE>
258
+ <ID>FDAE2B8415FC3F2FE040A8C0630226E4</ID>
259
+ <APPROXIMATE_AMOUNT>20.46</APPROXIMATE_AMOUNT>
260
+ <CAUSE>Принудительно. Отмена рейса</CAUSE>
261
+ </RETURN_CAUSE>
262
+ <COMMISSION>
263
+ <TYPE>2</TYPE>
264
+ <CODE>YS</CODE>
265
+ <DESCRIPTION>Страховой сбор</DESCRIPTION>
266
+ <VALUE>0.06</VALUE>
267
+ <VAT>0.01</VAT>
268
+ <CURRENCY>UAH</CURRENCY>
269
+ <RATE>0</RATE>
270
+ <VALUE_IN_CURRENCY>0.05</VALUE_IN_CURRENCY>
271
+ <VAT_IN_CURRENCY>0.01</VAT_IN_CURRENCY>
272
+ </COMMISSION>
273
+ <COMMISSION>
274
+ <TYPE>6</TYPE>
275
+ <CODE>XP3</CODE>
276
+ <DESCRIPTION>Сервисный сбор</DESCRIPTION>
277
+ <VALUE>20</VALUE>
278
+ <VAT>3.33</VAT>
279
+ <CURRENCY>UAH</CURRENCY>
280
+ <RATE>0</RATE>
281
+ <VALUE_IN_CURRENCY>16.67</VALUE_IN_CURRENCY>
282
+ <VAT_IN_CURRENCY>3.33</VAT_IN_CURRENCY>
283
+ </COMMISSION>
284
+ <COMMISSION>
285
+ <TYPE>-2</TYPE>
286
+ <CODE>XT</CODE>
287
+ <DESCRIPTION>Сумма других сборов</DESCRIPTION>
288
+ <VALUE>0.06</VALUE>
289
+ <VAT>0.01</VAT>
290
+ <CURRENCY>UAH</CURRENCY>
291
+ <RATE>0</RATE>
292
+ <VALUE_IN_CURRENCY>0.05</VALUE_IN_CURRENCY>
293
+ <VAT_IN_CURRENCY>0.01</VAT_IN_CURRENCY>
294
+ </COMMISSION>
295
+ </TICKET>
296
+ </DATA>