tourico 0.0.8.1 → 0.0.8.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +10 -8
- data/lib/tourico.rb +2 -1
- data/lib/tourico/api.rb +8 -1
- data/lib/tourico/http_service.rb +40 -0
- data/lib/tourico/version.rb +1 -1
- data/pkg/tourico-0.0.8.2.gem +0 -0
- data/vadim +0 -0
- metadata +5 -4
- data/pkg/tourico-0.0.8.1.gem +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 691f4a9375ff25d63c831ce592c23e11be534fc1
|
4
|
+
data.tar.gz: 1743d30b6dd220a9d17c8623a830aba2e49aed3c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 051754d79b20674a99cb2801625682025225a3cda4c5f8aa28c0bfcf6f455115206a1f0d77c90740549546446248b124322032b45e847b4094b7d36dd82c8d55
|
7
|
+
data.tar.gz: cab203863e5a379feb12c44472b79a13cb92473104261c1297d1bf3a8218ba0ba1ea808bb756bbd0e3ae7dd6a0e75f4f2fb6add4d4efbda42eefce2ba36083eb
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
tourico (0.0.8.
|
4
|
+
tourico (0.0.8.2)
|
5
5
|
savon (~> 2.5.0)
|
6
6
|
|
7
7
|
GEM
|
@@ -19,11 +19,13 @@ GEM
|
|
19
19
|
rubyntlm (~> 0.3.2)
|
20
20
|
macaddr (1.7.1)
|
21
21
|
systemu (~> 2.6.2)
|
22
|
-
|
23
|
-
nokogiri (1.6.
|
24
|
-
|
22
|
+
mini_portile2 (2.1.0)
|
23
|
+
nokogiri (1.6.8)
|
24
|
+
mini_portile2 (~> 2.1.0)
|
25
|
+
pkg-config (~> 1.1.7)
|
25
26
|
nori (2.4.0)
|
26
|
-
|
27
|
+
pkg-config (1.1.7)
|
28
|
+
rack (2.0.1)
|
27
29
|
rake (10.1.1)
|
28
30
|
rspec (2.14.1)
|
29
31
|
rspec-core (~> 2.14.0)
|
@@ -43,8 +45,8 @@ GEM
|
|
43
45
|
nori (~> 2.4.0)
|
44
46
|
uuid (~> 2.3.7)
|
45
47
|
wasabi (~> 3.3.0)
|
46
|
-
systemu (2.6.
|
47
|
-
uuid (2.3.
|
48
|
+
systemu (2.6.5)
|
49
|
+
uuid (2.3.8)
|
48
50
|
macaddr (~> 1.0)
|
49
51
|
wasabi (3.3.1)
|
50
52
|
httpi (~> 2.0)
|
@@ -59,4 +61,4 @@ DEPENDENCIES
|
|
59
61
|
tourico!
|
60
62
|
|
61
63
|
BUNDLED WITH
|
62
|
-
1.
|
64
|
+
1.12.5
|
data/lib/tourico.rb
CHANGED
@@ -4,13 +4,14 @@ require 'tourico/http_service'
|
|
4
4
|
|
5
5
|
module Tourico
|
6
6
|
class << self
|
7
|
-
attr_accessor :login_name, :password, :culture, :hotels_service_version, :reservations_service_version, :location_service_version,:hotel_service_link,:reservation_service_link,:sandbox, :show_logs, :proxy_url, :digest_auth, :open_timeout, :read_timeout
|
7
|
+
attr_accessor :destination_service_version, :destination_service_link, :login_name, :password, :culture, :hotels_service_version, :reservations_service_version, :location_service_version,:hotel_service_link,:reservation_service_link,:sandbox, :show_logs, :proxy_url, :digest_auth, :open_timeout, :read_timeout
|
8
8
|
|
9
9
|
# initializer with all the configuration values
|
10
10
|
def setup
|
11
11
|
self.sandbox = true
|
12
12
|
self.hotel_service_link = 'http://demo-hotelws.touricoholidays.com/HotelFlow.svc?wsdl'
|
13
13
|
self.reservation_service_link = 'http://demo-wsnew.touricoholidays.com/reservationsservice.asmx?wsdl'
|
14
|
+
self.destination_service_link = 'http://destservices.touricoholidays.com/DestinationsService.svc?wsdl'
|
14
15
|
self.show_logs = false
|
15
16
|
self.open_timeout = 2
|
16
17
|
self.read_timeout = 10
|
data/lib/tourico/api.rb
CHANGED
@@ -61,13 +61,16 @@ module Tourico
|
|
61
61
|
|
62
62
|
end
|
63
63
|
|
64
|
-
|
64
|
+
def get_hotels_by_destination(args)
|
65
|
+
services(:get_hotels_by_destination, args)
|
66
|
+
end
|
65
67
|
|
66
68
|
private
|
67
69
|
|
68
70
|
def services (action, args)
|
69
71
|
reservations_services = [:get_previous_RG, :cancel_reservation]
|
70
72
|
hotel_services = [:search_hotels,:search_hotels_by_id,:get_hotel_details_v3,:book_hotel_v3, :check_availability_and_prices,:get_cancellation_policies,:get_cancellation_fee]
|
73
|
+
destination_services = [:get_hotels_by_destination]
|
71
74
|
|
72
75
|
if reservations_services.include?(action)
|
73
76
|
return HTTPService.make_request_reservation_service(action, args)
|
@@ -77,6 +80,10 @@ module Tourico
|
|
77
80
|
return HTTPService.make_request(action, args)
|
78
81
|
end
|
79
82
|
|
83
|
+
if destination_services.include?(action)
|
84
|
+
return HTTPService.make_request_destination_service(action, args)
|
85
|
+
end
|
86
|
+
|
80
87
|
end
|
81
88
|
|
82
89
|
end
|
data/lib/tourico/http_service.rb
CHANGED
@@ -79,6 +79,46 @@ module Tourico
|
|
79
79
|
|
80
80
|
end
|
81
81
|
|
82
|
+
def make_request_destination_service(action, args, options = {})
|
83
|
+
puts 'Making destination request to Tourico'
|
84
|
+
client = Savon.client do
|
85
|
+
if Tourico.proxy_url.present?
|
86
|
+
proxy Tourico.proxy_url
|
87
|
+
end
|
88
|
+
if Tourico.digest_auth.present?
|
89
|
+
digest_auth(Tourico.digest_auth[:username], Tourico.digest_auth[:password])
|
90
|
+
end
|
91
|
+
log Tourico.show_logs
|
92
|
+
wsdl Tourico.destination_service_link
|
93
|
+
|
94
|
+
if HTTPService.apply_timeout?(action)
|
95
|
+
open_timeout Tourico.open_timeout
|
96
|
+
read_timeout Tourico.read_timeout
|
97
|
+
end
|
98
|
+
|
99
|
+
soap_header 'dat:LoginHeader' => {
|
100
|
+
'dat:username' => Tourico.login_name,
|
101
|
+
'dat:password' => Tourico.password,
|
102
|
+
'dat:culture' => Tourico.culture,
|
103
|
+
'dat:version' => Tourico.destination_service_version
|
104
|
+
}
|
105
|
+
namespaces(
|
106
|
+
'xmlns:env' => 'http://schemas.xmlsoap.org/soap/envelope/',
|
107
|
+
'xmlns:dat' => 'http://touricoholidays.com/WSDestinations/2008/08/DataContracts',
|
108
|
+
'xmlns:wsdl' => 'http://touricoholidays.com/WSDestinations/2008/08/DataContracts'
|
109
|
+
)
|
110
|
+
end
|
111
|
+
|
112
|
+
response = client.call(action, message: args)
|
113
|
+
|
114
|
+
puts 'Finished request for Tourico'
|
115
|
+
if response.success?
|
116
|
+
response.to_hash
|
117
|
+
else
|
118
|
+
nil
|
119
|
+
end
|
120
|
+
end
|
121
|
+
|
82
122
|
#apply api call timeout except for while checkout
|
83
123
|
def apply_timeout?(action)
|
84
124
|
(action.to_s == 'book_hotel_v3') ? false : true
|
data/lib/tourico/version.rb
CHANGED
Binary file
|
data/vadim
ADDED
File without changes
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tourico
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.8.
|
4
|
+
version: 0.0.8.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vitali Margolin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-07-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -70,11 +70,12 @@ files:
|
|
70
70
|
- lib/tourico/api.rb
|
71
71
|
- lib/tourico/http_service.rb
|
72
72
|
- lib/tourico/version.rb
|
73
|
-
- pkg/tourico-0.0.8.
|
73
|
+
- pkg/tourico-0.0.8.2.gem
|
74
74
|
- spec/models/api_spec.rb
|
75
75
|
- spec/spec_helper.rb
|
76
76
|
- spec/tourico_spec.rb
|
77
77
|
- tourico.gemspec
|
78
|
+
- vadim
|
78
79
|
homepage: https://github.com/vitalim/Tourico
|
79
80
|
licenses:
|
80
81
|
- MIT
|
@@ -95,7 +96,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
95
96
|
version: '0'
|
96
97
|
requirements: []
|
97
98
|
rubyforge_project:
|
98
|
-
rubygems_version: 2.
|
99
|
+
rubygems_version: 2.5.1
|
99
100
|
signing_key:
|
100
101
|
specification_version: 4
|
101
102
|
summary: Tourico gem is a ruby wrapper for Tourico API Affiliate Network
|
data/pkg/tourico-0.0.8.1.gem
DELETED
Binary file
|