tourico 0.0.7.6 → 0.0.7.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +4 -4
- data/lib/tourico/http_service.rb +22 -10
- data/lib/tourico/version.rb +1 -1
- data/lib/tourico.rb +3 -1
- data/spec/models/api_spec.rb +9 -9
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fd0f40df536dd3ade4910adde9cebabbd9e975b4
|
4
|
+
data.tar.gz: cfbe25cf809d1442cb851af314516e493b47a2e2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b76a5165ca3983ab0845d9320b5ce79bcc7a0bbc0e154c810247a63de359d8ff862052c87771f86be1b2a8ce143b9a008ba141afa1984202a32e7660ae8f42af
|
7
|
+
data.tar.gz: 9e0e5add321945d86641221c4959489b09e161a932a22fb1da5a4ed739d1ebfe5139934f562dd6707bcb825bc93c13fe231e62e333dd67ad2b7dd9159b1bc0d1
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
tourico (0.0.7.
|
4
|
+
tourico (0.0.7.7)
|
5
5
|
savon (~> 2.5.0)
|
6
6
|
|
7
7
|
GEM
|
@@ -19,9 +19,9 @@ GEM
|
|
19
19
|
rubyntlm (~> 0.3.2)
|
20
20
|
macaddr (1.7.1)
|
21
21
|
systemu (~> 2.6.2)
|
22
|
-
mini_portile (0.6.
|
23
|
-
nokogiri (1.6.
|
24
|
-
mini_portile (
|
22
|
+
mini_portile (0.6.1)
|
23
|
+
nokogiri (1.6.5)
|
24
|
+
mini_portile (~> 0.6.0)
|
25
25
|
nori (2.4.0)
|
26
26
|
rack (1.5.2)
|
27
27
|
rake (10.1.1)
|
data/lib/tourico/http_service.rb
CHANGED
@@ -15,16 +15,22 @@ module Tourico
|
|
15
15
|
end
|
16
16
|
log Tourico.show_logs
|
17
17
|
wsdl Tourico.hotel_service_link
|
18
|
+
|
19
|
+
if HTTPService.apply_timeout?(action)
|
20
|
+
open_timeout Tourico.open_timeout
|
21
|
+
read_timeout Tourico.read_timeout
|
22
|
+
end
|
23
|
+
|
18
24
|
soap_header 'aut:AuthenticationHeader' => {
|
19
25
|
'aut:LoginName' => Tourico.login_name,
|
20
|
-
'aut:Password'
|
21
|
-
'aut:Culture'
|
22
|
-
'aut:Version'
|
26
|
+
'aut:Password' => Tourico.password,
|
27
|
+
'aut:Culture' => Tourico.culture,
|
28
|
+
'aut:Version' => Tourico.hotels_service_version
|
23
29
|
}
|
24
30
|
namespaces(
|
25
|
-
'xmlns:env'
|
26
|
-
'xmlns:aut'
|
27
|
-
'xmlns:hot'
|
31
|
+
'xmlns:env' => 'http://schemas.xmlsoap.org/soap/envelope/',
|
32
|
+
'xmlns:aut' => 'http://schemas.tourico.com/webservices/authentication',
|
33
|
+
'xmlns:hot' => 'http://tourico.com/webservices/hotelv3',
|
28
34
|
'xmlns:wsdl' => 'http://tourico.com/webservices/hotelv3',
|
29
35
|
'xmlns:hot1' => 'http://schemas.tourico.com/webservices/hotelv3')
|
30
36
|
end
|
@@ -51,14 +57,14 @@ module Tourico
|
|
51
57
|
soap_header 'web:LoginHeader' => {
|
52
58
|
'trav:username' => Tourico.login_name,
|
53
59
|
'trav:password' => Tourico.password,
|
54
|
-
'trav:culture'
|
55
|
-
'trav:version'
|
60
|
+
'trav:culture' => Tourico.culture,
|
61
|
+
'trav:version' => Tourico.reservations_service_version
|
56
62
|
}
|
57
63
|
namespaces(
|
58
|
-
'xmlns:env'
|
64
|
+
'xmlns:env' => 'http://schemas.xmlsoap.org/soap/envelope/',
|
59
65
|
'xmlns:web' => 'http://tourico.com/webservices/',
|
60
66
|
'xmlns:hot' => 'http://tourico.com/webservices/',
|
61
|
-
'xmlns:wsdl'
|
67
|
+
'xmlns:wsdl' => 'http://tourico.com/webservices/',
|
62
68
|
'xmlns:trav' => 'http://tourico.com/travelservices/')
|
63
69
|
end
|
64
70
|
|
@@ -68,6 +74,12 @@ module Tourico
|
|
68
74
|
response.to_hash
|
69
75
|
|
70
76
|
end
|
77
|
+
|
78
|
+
#apply api call timeout except for while checkout
|
79
|
+
def apply_timeout?(action)
|
80
|
+
(action.to_s == 'book_hotel_v3') ? false : true
|
81
|
+
end
|
82
|
+
|
71
83
|
end
|
72
84
|
end
|
73
85
|
end
|
data/lib/tourico/version.rb
CHANGED
data/lib/tourico.rb
CHANGED
@@ -4,7 +4,7 @@ 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
|
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
|
8
8
|
|
9
9
|
# initializer with all the configuration values
|
10
10
|
def setup
|
@@ -12,6 +12,8 @@ module Tourico
|
|
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
14
|
self.show_logs = false
|
15
|
+
self.open_timeout = 1
|
16
|
+
self.read_timeout = 10
|
15
17
|
yield self
|
16
18
|
|
17
19
|
# Savon.configure do|config|
|
data/spec/models/api_spec.rb
CHANGED
@@ -7,8 +7,8 @@ describe Tourico::Api do
|
|
7
7
|
args = {
|
8
8
|
'hot:request' => {
|
9
9
|
'hot1:Destination' => 'NYC',
|
10
|
-
'hot1:CheckIn' => '
|
11
|
-
'hot1:CheckOut' => '
|
10
|
+
'hot1:CheckIn' => (DateTime.now + 1.day).strftime('%Y-%m-%d'),
|
11
|
+
'hot1:CheckOut' => (DateTime.now + 3.day).strftime('%Y-%m-%d'),
|
12
12
|
'hot1:RoomsInformation' => {
|
13
13
|
'hot1:RoomInfo' => {
|
14
14
|
'hot1:AdultNum' => '2',
|
@@ -65,8 +65,8 @@ describe Tourico::Api do
|
|
65
65
|
#'web:nResID' => '',
|
66
66
|
'web:hotelId' =>'2210',
|
67
67
|
'web:hotelRoomTypeId' => '5437',
|
68
|
-
'web:dtCheckIn' => '
|
69
|
-
'web:dtCheckOut' => '
|
68
|
+
'web:dtCheckIn' => (DateTime.now + 1.day).strftime('%Y-%m-%d'),
|
69
|
+
'web:dtCheckOut' => (DateTime.now + 2.day).strftime('%Y-%m-%d')
|
70
70
|
}
|
71
71
|
|
72
72
|
api.get_cancellation_policy(args).should_not be_nil
|
@@ -88,8 +88,8 @@ describe Tourico::Api do
|
|
88
88
|
'hot1:RecordLocatorId' => '0',
|
89
89
|
'hot1:HotelId' => '1215560',
|
90
90
|
'hot1:HotelRoomTypeId' => '1973855',
|
91
|
-
'hot1:CheckIn' => '
|
92
|
-
'hot1:CheckOut' => '
|
91
|
+
'hot1:CheckIn' => (DateTime.now + 1.day).strftime('%Y-%m-%d'),
|
92
|
+
'hot1:CheckOut' => (DateTime.now + 3.day).strftime('%Y-%m-%d'),
|
93
93
|
'hot1:RoomsInfo' => {
|
94
94
|
'hot1:RoomReserveInfo' => {
|
95
95
|
'hot1:RoomId' => '1',
|
@@ -126,7 +126,7 @@ describe Tourico::Api do
|
|
126
126
|
api = Tourico::Api.new
|
127
127
|
args = {
|
128
128
|
'web:nResID' => '37434386',
|
129
|
-
'web:clxDate' => '
|
129
|
+
'web:clxDate' => (DateTime.now + 1.day).strftime('%Y-%m-%d')
|
130
130
|
}
|
131
131
|
|
132
132
|
api.get_cancellation_fee_for_reservation(args).should_not be_nil
|
@@ -141,8 +141,8 @@ describe Tourico::Api do
|
|
141
141
|
'hot1:HotelIdInfo' => '',
|
142
142
|
:attributes! => {'hot1:HotelIdInfo' => {'id' => '1215560'}}
|
143
143
|
},
|
144
|
-
'hot1:CheckIn' => '
|
145
|
-
'hot1:CheckOut' => '
|
144
|
+
'hot1:CheckIn' => (DateTime.now + 1.day).strftime('%Y-%m-%d'),
|
145
|
+
'hot1:CheckOut' => (DateTime.now + 3.day).strftime('%Y-%m-%d'),
|
146
146
|
'hot1:RoomsInformation' => {
|
147
147
|
'hot1:RoomInfo' => {
|
148
148
|
'hot1:AdultNum' => '2',
|
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.7.
|
4
|
+
version: 0.0.7.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vitali Margolin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-01-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -94,7 +94,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
94
94
|
version: '0'
|
95
95
|
requirements: []
|
96
96
|
rubyforge_project:
|
97
|
-
rubygems_version: 2.
|
97
|
+
rubygems_version: 2.4.5
|
98
98
|
signing_key:
|
99
99
|
specification_version: 4
|
100
100
|
summary: Tourico gem is a ruby wrapper for Tourico API Affiliate Network
|