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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fa3656de1677537f4d81a58ac2fad64b8a53a019
4
- data.tar.gz: 2f40c6871776d245b91b704106638b64b46b035a
3
+ metadata.gz: fd0f40df536dd3ade4910adde9cebabbd9e975b4
4
+ data.tar.gz: cfbe25cf809d1442cb851af314516e493b47a2e2
5
5
  SHA512:
6
- metadata.gz: 03547097b954ae753a0596631166cf9961edb22124569ed714b132b015a81079064dcba43e22d1b2b7eabccafa4ddfcd3644096ab51ce7187e016d82782d9c4b
7
- data.tar.gz: d5ad3b32f1a84d2b2182997e700ed7d1a4f7dd268a46205d7e57ebe28c9b5c84d54100ad7c6cef6ed0285727ae99abdc42c9828d92e7dd27381e312239dde265
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.6)
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.0)
23
- nokogiri (1.6.3.1)
24
- mini_portile (= 0.6.0)
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)
@@ -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' => Tourico.password,
21
- 'aut:Culture' => Tourico.culture,
22
- 'aut:Version' => Tourico.hotels_service_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' => 'http://schemas.xmlsoap.org/soap/envelope/',
26
- 'xmlns:aut' => 'http://schemas.tourico.com/webservices/authentication',
27
- 'xmlns:hot' => 'http://tourico.com/webservices/hotelv3',
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' => Tourico.culture,
55
- 'trav:version' => Tourico.reservations_service_version
60
+ 'trav:culture' => Tourico.culture,
61
+ 'trav:version' => Tourico.reservations_service_version
56
62
  }
57
63
  namespaces(
58
- 'xmlns:env' => 'http://schemas.xmlsoap.org/soap/envelope/',
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' => 'http://tourico.com/webservices/',
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
@@ -1,3 +1,3 @@
1
1
  module Tourico
2
- VERSION = '0.0.7.6'
2
+ VERSION = '0.0.7.7'
3
3
  end
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|
@@ -7,8 +7,8 @@ describe Tourico::Api do
7
7
  args = {
8
8
  'hot:request' => {
9
9
  'hot1:Destination' => 'NYC',
10
- 'hot1:CheckIn' => '2013-10-23',
11
- 'hot1:CheckOut' => '2013-10-25',
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' => '2014-08-28',
69
- 'web:dtCheckOut' => '2014-08-29'
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' => '2013-09-23',
92
- 'hot1:CheckOut' => '2013-09-25',
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' => '2013-08-26'
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' => '2014-10-23',
145
- 'hot1:CheckOut' => '2014-10-25',
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.6
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: 2014-10-22 00:00:00.000000000 Z
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.2.0
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