Chrononaut-hostconnect 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +1 -0
- data/hostconnect.gemspec +10 -2
- data/lib/hostconnect/builders/get_booking_payment_summary_builder.rb +20 -0
- data/lib/hostconnect/builders/record_booking_payment_builder.rb +24 -0
- data/lib/hostconnect/response.rb +2 -2
- data/lib/hostconnect/responses/get_booking_payment_summary.rb +21 -0
- data/lib/hostconnect/responses/record_booking_payment.rb +4 -0
- data/lib/hostconnect/translation.rb +11 -10
- data/lib/hostconnect.rb +1 -1
- metadata +10 -2
data/CHANGELOG
CHANGED
data/hostconnect.gemspec
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hostconnect
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- "Bj\xC3\xB8rn Arild M\xC3\xA6land"
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
|
11
|
-
date: 2008-09-
|
11
|
+
date: 2008-09-15 00:00:00 +02:00
|
12
12
|
default_executable:
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
@@ -73,6 +73,7 @@ extra_rdoc_files:
|
|
73
73
|
- lib/hostconnect.rb
|
74
74
|
- lib/hostconnect/builders/agent_info_builder.rb
|
75
75
|
- lib/hostconnect/builders/pax_details_builder.rb
|
76
|
+
- lib/hostconnect/builders/record_booking_payment_builder.rb
|
76
77
|
- lib/hostconnect/builders/add_service_builder.rb
|
77
78
|
- lib/hostconnect/builders/room_config_builder.rb
|
78
79
|
- lib/hostconnect/builders/get_booking_builder.rb
|
@@ -83,6 +84,7 @@ extra_rdoc_files:
|
|
83
84
|
- lib/hostconnect/builders/suppler_info_builder.rb
|
84
85
|
- lib/hostconnect/builders/list_bookings_builder.rb
|
85
86
|
- lib/hostconnect/builders/option_info_builder.rb
|
87
|
+
- lib/hostconnect/builders/get_booking_payment_summary_builder.rb
|
86
88
|
- lib/hostconnect/builders/service_line_note_builder.rb
|
87
89
|
- lib/hostconnect/builders/ping_builder.rb
|
88
90
|
- lib/hostconnect/coercion.rb
|
@@ -94,7 +96,9 @@ extra_rdoc_files:
|
|
94
96
|
- lib/hostconnect/responses/list_bookings.rb
|
95
97
|
- lib/hostconnect/responses/get_locations.rb
|
96
98
|
- lib/hostconnect/responses/get_booking.rb
|
99
|
+
- lib/hostconnect/responses/record_booking_payment.rb
|
97
100
|
- lib/hostconnect/responses/option_info.rb
|
101
|
+
- lib/hostconnect/responses/get_booking_payment_summary.rb
|
98
102
|
- lib/hostconnect/responses/add_service.rb
|
99
103
|
- lib/hostconnect/responses/supplier_info.rb
|
100
104
|
- lib/hostconnect/responses/get_system_settings.rb
|
@@ -111,6 +115,7 @@ files:
|
|
111
115
|
- lib/hostconnect.rb
|
112
116
|
- lib/hostconnect/builders/agent_info_builder.rb
|
113
117
|
- lib/hostconnect/builders/pax_details_builder.rb
|
118
|
+
- lib/hostconnect/builders/record_booking_payment_builder.rb
|
114
119
|
- lib/hostconnect/builders/add_service_builder.rb
|
115
120
|
- lib/hostconnect/builders/room_config_builder.rb
|
116
121
|
- lib/hostconnect/builders/get_booking_builder.rb
|
@@ -121,6 +126,7 @@ files:
|
|
121
126
|
- lib/hostconnect/builders/suppler_info_builder.rb
|
122
127
|
- lib/hostconnect/builders/list_bookings_builder.rb
|
123
128
|
- lib/hostconnect/builders/option_info_builder.rb
|
129
|
+
- lib/hostconnect/builders/get_booking_payment_summary_builder.rb
|
124
130
|
- lib/hostconnect/builders/service_line_note_builder.rb
|
125
131
|
- lib/hostconnect/builders/ping_builder.rb
|
126
132
|
- lib/hostconnect/coercion.rb
|
@@ -132,7 +138,9 @@ files:
|
|
132
138
|
- lib/hostconnect/responses/list_bookings.rb
|
133
139
|
- lib/hostconnect/responses/get_locations.rb
|
134
140
|
- lib/hostconnect/responses/get_booking.rb
|
141
|
+
- lib/hostconnect/responses/record_booking_payment.rb
|
135
142
|
- lib/hostconnect/responses/option_info.rb
|
143
|
+
- lib/hostconnect/responses/get_booking_payment_summary.rb
|
136
144
|
- lib/hostconnect/responses/add_service.rb
|
137
145
|
- lib/hostconnect/responses/supplier_info.rb
|
138
146
|
- lib/hostconnect/responses/get_system_settings.rb
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module HostConnect
|
2
|
+
class GetBookingPaymentSummaryBuilder < AbstractBuilder
|
3
|
+
def initialize(options = {})
|
4
|
+
@valid_options = [ :agent_id, :password, :booking_id ].freeze
|
5
|
+
super(options)
|
6
|
+
end
|
7
|
+
|
8
|
+
def to_xml
|
9
|
+
x = bare
|
10
|
+
x.Request {
|
11
|
+
x.GetBookingPaymentSummaryRequest {
|
12
|
+
x.AgentID @agent_id
|
13
|
+
x.Password @password
|
14
|
+
x.BookingId @booking_id
|
15
|
+
}
|
16
|
+
}
|
17
|
+
x
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module HostConnect
|
2
|
+
class RecordBookingPaymentBuilder < AbstractBuilder
|
3
|
+
def initialize(options = {})
|
4
|
+
@valid_options = [ :agent_id, :password, :booking_id, :currency,
|
5
|
+
:amount, :receipt_type ].freeze
|
6
|
+
super(options)
|
7
|
+
end
|
8
|
+
|
9
|
+
def to_xml
|
10
|
+
x = bare
|
11
|
+
x.Request {
|
12
|
+
x.RecordBookingPaymentRequest {
|
13
|
+
x.AgentID @agent_id
|
14
|
+
x.Password @password
|
15
|
+
x.BookingId @booking_id
|
16
|
+
x.Currency @currency
|
17
|
+
x.Amount @amount.to_i * 100
|
18
|
+
x.ReceiptType @receipt_type
|
19
|
+
}
|
20
|
+
}
|
21
|
+
x
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
data/lib/hostconnect/response.rb
CHANGED
@@ -94,8 +94,8 @@ module HostConnect
|
|
94
94
|
# Sets all instance variables. This only works for the simple requests.
|
95
95
|
# For convenience, query methods gets defined for booleans.
|
96
96
|
def set_attrs
|
97
|
-
|
98
|
-
@data.search("/Reply/" <<
|
97
|
+
reply_name = ActiveSupport::Inflector.demodulize(self.class) << "Reply"
|
98
|
+
@data.search("/Reply/" << reply_name) do |n|
|
99
99
|
n.containers.each do |e|
|
100
100
|
var = e.name.underscore
|
101
101
|
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module HostConnect
|
2
|
+
class GetBookingPaymentSummary < AbstractResponse
|
3
|
+
private
|
4
|
+
def populate
|
5
|
+
@data.search("/Reply/GetBookingPaymentSummaryReply") do |n|
|
6
|
+
n.containers.each do |e|
|
7
|
+
var = e.name.underscore
|
8
|
+
|
9
|
+
if var == "currency"
|
10
|
+
value = Hpricot.uxs(e.innerHTML)
|
11
|
+
else
|
12
|
+
value = Coercion.price(Hpricot.uxs(e.innerHTML))
|
13
|
+
end
|
14
|
+
|
15
|
+
instance_variable_set("@#{var}", value)
|
16
|
+
self.class.class_eval "attr_reader :#{var}"
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -2,16 +2,17 @@ module HostConnect
|
|
2
2
|
# Translate to/from HostConnect codes
|
3
3
|
class Translation
|
4
4
|
GRAMMAR = {
|
5
|
-
"SG"
|
6
|
-
"TW"
|
7
|
-
"DB"
|
8
|
-
"TR"
|
9
|
-
"QD"
|
10
|
-
"CF"
|
11
|
-
"CX"
|
12
|
-
"FQ"
|
13
|
-
"IN"
|
14
|
-
"RQ"
|
5
|
+
"SG" => "Single",
|
6
|
+
"TW" => "Twin",
|
7
|
+
"DB" => "Double",
|
8
|
+
"TR" => "Triple",
|
9
|
+
"QD" => "Quad",
|
10
|
+
"CF" => "Confirmed",
|
11
|
+
"CX" => "Cancelled",
|
12
|
+
"FQ" => "FIT Quote",
|
13
|
+
"IN" => "Internet Booking",
|
14
|
+
"RQ" => "Request",
|
15
|
+
"CRCD" => "Credit Card Payment"
|
15
16
|
}
|
16
17
|
|
17
18
|
def self.translate(string)
|
data/lib/hostconnect.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: Chrononaut-hostconnect
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- "Bj\xC3\xB8rn Arild M\xC3\xA6land"
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain:
|
11
|
-
date: 2008-09-
|
11
|
+
date: 2008-09-14 15:00:00 -07:00
|
12
12
|
default_executable:
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
@@ -73,6 +73,7 @@ extra_rdoc_files:
|
|
73
73
|
- lib/hostconnect.rb
|
74
74
|
- lib/hostconnect/builders/agent_info_builder.rb
|
75
75
|
- lib/hostconnect/builders/pax_details_builder.rb
|
76
|
+
- lib/hostconnect/builders/record_booking_payment_builder.rb
|
76
77
|
- lib/hostconnect/builders/add_service_builder.rb
|
77
78
|
- lib/hostconnect/builders/room_config_builder.rb
|
78
79
|
- lib/hostconnect/builders/get_booking_builder.rb
|
@@ -83,6 +84,7 @@ extra_rdoc_files:
|
|
83
84
|
- lib/hostconnect/builders/suppler_info_builder.rb
|
84
85
|
- lib/hostconnect/builders/list_bookings_builder.rb
|
85
86
|
- lib/hostconnect/builders/option_info_builder.rb
|
87
|
+
- lib/hostconnect/builders/get_booking_payment_summary_builder.rb
|
86
88
|
- lib/hostconnect/builders/service_line_note_builder.rb
|
87
89
|
- lib/hostconnect/builders/ping_builder.rb
|
88
90
|
- lib/hostconnect/coercion.rb
|
@@ -94,7 +96,9 @@ extra_rdoc_files:
|
|
94
96
|
- lib/hostconnect/responses/list_bookings.rb
|
95
97
|
- lib/hostconnect/responses/get_locations.rb
|
96
98
|
- lib/hostconnect/responses/get_booking.rb
|
99
|
+
- lib/hostconnect/responses/record_booking_payment.rb
|
97
100
|
- lib/hostconnect/responses/option_info.rb
|
101
|
+
- lib/hostconnect/responses/get_booking_payment_summary.rb
|
98
102
|
- lib/hostconnect/responses/add_service.rb
|
99
103
|
- lib/hostconnect/responses/supplier_info.rb
|
100
104
|
- lib/hostconnect/responses/get_system_settings.rb
|
@@ -111,6 +115,7 @@ files:
|
|
111
115
|
- lib/hostconnect.rb
|
112
116
|
- lib/hostconnect/builders/agent_info_builder.rb
|
113
117
|
- lib/hostconnect/builders/pax_details_builder.rb
|
118
|
+
- lib/hostconnect/builders/record_booking_payment_builder.rb
|
114
119
|
- lib/hostconnect/builders/add_service_builder.rb
|
115
120
|
- lib/hostconnect/builders/room_config_builder.rb
|
116
121
|
- lib/hostconnect/builders/get_booking_builder.rb
|
@@ -121,6 +126,7 @@ files:
|
|
121
126
|
- lib/hostconnect/builders/suppler_info_builder.rb
|
122
127
|
- lib/hostconnect/builders/list_bookings_builder.rb
|
123
128
|
- lib/hostconnect/builders/option_info_builder.rb
|
129
|
+
- lib/hostconnect/builders/get_booking_payment_summary_builder.rb
|
124
130
|
- lib/hostconnect/builders/service_line_note_builder.rb
|
125
131
|
- lib/hostconnect/builders/ping_builder.rb
|
126
132
|
- lib/hostconnect/coercion.rb
|
@@ -132,7 +138,9 @@ files:
|
|
132
138
|
- lib/hostconnect/responses/list_bookings.rb
|
133
139
|
- lib/hostconnect/responses/get_locations.rb
|
134
140
|
- lib/hostconnect/responses/get_booking.rb
|
141
|
+
- lib/hostconnect/responses/record_booking_payment.rb
|
135
142
|
- lib/hostconnect/responses/option_info.rb
|
143
|
+
- lib/hostconnect/responses/get_booking_payment_summary.rb
|
136
144
|
- lib/hostconnect/responses/add_service.rb
|
137
145
|
- lib/hostconnect/responses/supplier_info.rb
|
138
146
|
- lib/hostconnect/responses/get_system_settings.rb
|