resonline 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +22 -0
- data/Gemfile +6 -0
- data/LICENSE.txt +22 -0
- data/README.md +44 -0
- data/Rakefile +2 -0
- data/lib/resonline/configuration.rb +28 -0
- data/lib/resonline/constants.rb +10 -0
- data/lib/resonline/error_messages.rb +11 -0
- data/lib/resonline/inventory.rb +84 -0
- data/lib/resonline/service.rb +78 -0
- data/lib/resonline/transformation.rb +94 -0
- data/lib/resonline/version.rb +3 -0
- data/lib/resonline.rb +8 -0
- data/resonline.gemspec +23 -0
- metadata +86 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA1:
|
|
3
|
+
metadata.gz: 297514306d6e71c05e51021dbf25541fd2032a6c
|
|
4
|
+
data.tar.gz: 63cd8de633115d677c1c9be76da3c4d363373ece
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: b7b2a7cb2b5eaba6b1c143c3073b09e9b130244373a7fa66680e2f22962e7918f887d8807dcab21382a22ce7be5ea3894ac8baad545622caf2783ab0d83e804d
|
|
7
|
+
data.tar.gz: 7c712f490b790a89898a9fc68617ca4a7bee2e27d265c28d74dcee6657cb4d4555f82d6bdf8207c5e35a7cdffd0837f71231ff8f4e66820784c2f63e6331b5e3
|
data/.gitignore
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
*.gem
|
|
2
|
+
*.rbc
|
|
3
|
+
.bundle
|
|
4
|
+
.config
|
|
5
|
+
.yardoc
|
|
6
|
+
Gemfile.lock
|
|
7
|
+
InstalledFiles
|
|
8
|
+
_yardoc
|
|
9
|
+
coverage
|
|
10
|
+
doc/
|
|
11
|
+
lib/bundler/man
|
|
12
|
+
pkg
|
|
13
|
+
rdoc
|
|
14
|
+
spec/reports
|
|
15
|
+
test/tmp
|
|
16
|
+
test/version_tmp
|
|
17
|
+
tmp
|
|
18
|
+
*.bundle
|
|
19
|
+
*.so
|
|
20
|
+
*.o
|
|
21
|
+
*.a
|
|
22
|
+
mkmf.log
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
Copyright (c) 2014 Rijaludin Muhsin
|
|
2
|
+
|
|
3
|
+
MIT License
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
6
|
+
a copy of this software and associated documentation files (the
|
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
11
|
+
the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be
|
|
14
|
+
included in all copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Resonline
|
|
2
|
+
|
|
3
|
+
This gem created according to resonline documentation http://api-pvt.resonline.com.au/direct/2.0/documentation/
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
Add this line to your application's Gemfile:
|
|
8
|
+
|
|
9
|
+
gem 'resonline'
|
|
10
|
+
|
|
11
|
+
And then execute:
|
|
12
|
+
|
|
13
|
+
$ bundle
|
|
14
|
+
|
|
15
|
+
Or install it yourself as:
|
|
16
|
+
|
|
17
|
+
$ gem install resonline
|
|
18
|
+
|
|
19
|
+
## Usage
|
|
20
|
+
|
|
21
|
+
NOTE: Still in development
|
|
22
|
+
|
|
23
|
+
Implemented method:
|
|
24
|
+
|
|
25
|
+
- `Resonline::Inventory.get_rate_packages`
|
|
26
|
+
- `Resonline::Inventory.get_inventory(start_date, end_date, rate_package_ids = [])`
|
|
27
|
+
- `Resonline::Service.get_hotel_rooms`
|
|
28
|
+
- `Resonline::Service.get_hotel_rate_package_deals(rate_package_id)`
|
|
29
|
+
- `Resonline::Transformation.get_availability(room_id, start_date, end_date)`
|
|
30
|
+
- `Resonline::Transformation.set_availability(room_id, start_date, end_date, number_available)`
|
|
31
|
+
|
|
32
|
+
## Configuration
|
|
33
|
+
|
|
34
|
+
Add an initializer e.g config/initializers/resonline.rb
|
|
35
|
+
|
|
36
|
+
```ruby
|
|
37
|
+
Resonline.configure do |config|
|
|
38
|
+
config.cm_username = 'Username for login to channel manager'
|
|
39
|
+
config.cm_password = 'Password for login to channel manager'
|
|
40
|
+
config.username = 'Username to access SOAP'
|
|
41
|
+
config.password = 'Password to access SOAP'
|
|
42
|
+
config.hotel_id = 'Hotel id connected to your account'
|
|
43
|
+
end
|
|
44
|
+
```
|
data/Rakefile
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
module Resonline
|
|
2
|
+
class Configuration
|
|
3
|
+
attr_accessor :cm_username, :cm_password, :username, :password, :hotel_id
|
|
4
|
+
end
|
|
5
|
+
|
|
6
|
+
class << self
|
|
7
|
+
attr_accessor :configuration
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
# Configure Resonline someplace sensible,
|
|
11
|
+
# like config/initializers/resonline.rb
|
|
12
|
+
#
|
|
13
|
+
# @example
|
|
14
|
+
# Resonline.configure do |config|
|
|
15
|
+
# config.cm_username = 'your channel manager username'
|
|
16
|
+
# config.cm_password = 'your channel manager password'
|
|
17
|
+
# config.username = 'your username'
|
|
18
|
+
# config.password = 'your password'
|
|
19
|
+
# end
|
|
20
|
+
|
|
21
|
+
def self.configuration
|
|
22
|
+
@configuration ||= Configuration.new
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def self.configure
|
|
26
|
+
yield(configuration)
|
|
27
|
+
end
|
|
28
|
+
end
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
module Resonline
|
|
2
|
+
SOAPPrefixUrl = 'https://api-pvt.resonline.com.au/direct/2.0/services/'
|
|
3
|
+
SOAPNamespaces = {
|
|
4
|
+
namespaces: {
|
|
5
|
+
"xmlns:soapenv" => "http://schemas.xmlsoap.org/soap/envelope/",
|
|
6
|
+
"xmlns:ns" => "http://cm.schema.com/direct/2.0/",
|
|
7
|
+
"xmlns:ns1" => "http://cm.schema.com/api-core/2.0/"
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
end
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
module Resonline
|
|
2
|
+
module Inventory
|
|
3
|
+
def self.soap_options
|
|
4
|
+
options = Resonline::SOAPNamespaces.merge({
|
|
5
|
+
endpoint: "#{Resonline::SOAPPrefixUrl}InventoryService.svc",
|
|
6
|
+
wsdl: "#{Resonline::SOAPPrefixUrl}InventoryService.svc?wsdl=wsdl0"
|
|
7
|
+
})
|
|
8
|
+
options
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def self.get_rate_packages
|
|
12
|
+
client = Savon.client(soap_options)
|
|
13
|
+
xml = '
|
|
14
|
+
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://cm.schema.com/direct/2.0/" xmlns:ns1="http://cm.schema.com/api-core/2.0/">
|
|
15
|
+
<soapenv:Header/>
|
|
16
|
+
<soapenv:Body>
|
|
17
|
+
<ns:GetRatePackages>
|
|
18
|
+
<!--Optional:-->
|
|
19
|
+
<ns:request>
|
|
20
|
+
<ns1:ChannelManagerUsername>' + Resonline.configuration.cm_username + '</ns1:ChannelManagerUsername>
|
|
21
|
+
<ns1:ChannelManagerPassword>' + Resonline.configuration.cm_password + '</ns1:ChannelManagerPassword>
|
|
22
|
+
<!--Optional:-->
|
|
23
|
+
<ns1:Username>' + Resonline.configuration.username + '</ns1:Username>
|
|
24
|
+
<!--Optional:-->
|
|
25
|
+
<ns1:Password>' + Resonline.configuration.password + '</ns1:Password>
|
|
26
|
+
<!--Optional:-->
|
|
27
|
+
<ns1:HotelId>' + Resonline.configuration.hotel_id.to_s + '</ns1:HotelId>
|
|
28
|
+
<!--Optional:-->
|
|
29
|
+
</ns:request>
|
|
30
|
+
</ns:GetRatePackages>
|
|
31
|
+
</soapenv:Body>
|
|
32
|
+
</soapenv:Envelope>'
|
|
33
|
+
response = client.call(:get_rate_packages, xml: xml)
|
|
34
|
+
if response.success?
|
|
35
|
+
return response.body[:get_rate_packages_response][:get_rate_packages_result]
|
|
36
|
+
else
|
|
37
|
+
return Resonline::ErrorMessages.failed_response(response)
|
|
38
|
+
end
|
|
39
|
+
rescue Exception => e
|
|
40
|
+
return Resonline::ErrorMessages.exception(e)
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
def self.get_inventory(start_date, end_date, rate_package_ids = [])
|
|
44
|
+
client = Savon.client(soap_options)
|
|
45
|
+
xml = '
|
|
46
|
+
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://cm.schema.com/direct/2.0/" xmlns:ns1="http://cm.schema.com/api-core/2.0/">
|
|
47
|
+
<soapenv:Header/>
|
|
48
|
+
<soapenv:Body>
|
|
49
|
+
<ns:GetInventory>
|
|
50
|
+
<!--Optional:-->
|
|
51
|
+
<ns:request>
|
|
52
|
+
<ns1:ChannelManagerUsername>' + Resonline.configuration.cm_username + '</ns1:ChannelManagerUsername>
|
|
53
|
+
<ns1:ChannelManagerPassword>' + Resonline.configuration.cm_password + '</ns1:ChannelManagerPassword>
|
|
54
|
+
<!--Optional:-->
|
|
55
|
+
<ns1:Username>' + Resonline.configuration.username + '</ns1:Username>
|
|
56
|
+
<!--Optional:-->
|
|
57
|
+
<ns1:Password>' + Resonline.configuration.password + '</ns1:Password>
|
|
58
|
+
<!--Optional:-->
|
|
59
|
+
<ns1:HotelId>' + Resonline.configuration.hotel_id.to_s + '</ns1:HotelId>
|
|
60
|
+
<!--Optional:-->
|
|
61
|
+
|
|
62
|
+
<!--Optional:-->
|
|
63
|
+
<ns:EndDate>' + end_date.xmlschema + '</ns:EndDate>
|
|
64
|
+
<ns:RatePackages>
|
|
65
|
+
<!--Zero or more repetitions:-->' + rate_package_ids.map { |id| "<ns:RatePackageId>#{id}</ns:RatePackageId>" }.join('') + '
|
|
66
|
+
</ns:RatePackages>
|
|
67
|
+
<!--Optional:-->
|
|
68
|
+
<ns:StartDate>' + start_date.xmlschema + '</ns:StartDate>
|
|
69
|
+
</ns:request>
|
|
70
|
+
</ns:GetInventory>
|
|
71
|
+
</soapenv:Body>
|
|
72
|
+
</soapenv:Envelope>'
|
|
73
|
+
response = client.call(:get_inventory, xml: xml)
|
|
74
|
+
if response.success?
|
|
75
|
+
return response.body[:get_inventory_response][:get_inventory_result]
|
|
76
|
+
else
|
|
77
|
+
return Resonline::ErrorMessages.failed_response(response)
|
|
78
|
+
end
|
|
79
|
+
rescue Exception => e
|
|
80
|
+
return Resonline::ErrorMessages.exception(e)
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
end
|
|
84
|
+
end
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
module Resonline
|
|
2
|
+
module Service
|
|
3
|
+
def self.soap_options
|
|
4
|
+
options = Resonline::SOAPNamespaces.merge({
|
|
5
|
+
endpoint: "#{Resonline::SOAPPrefixUrl}ContentService.svc",
|
|
6
|
+
wsdl: "#{Resonline::SOAPPrefixUrl}ContentService.svc?wsdl=wsdl1"
|
|
7
|
+
})
|
|
8
|
+
options
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def self.get_hotel_rooms
|
|
12
|
+
client = Savon.client(soap_options)
|
|
13
|
+
xml = '
|
|
14
|
+
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://cm.schema.com/direct/2.0/" xmlns:ns1="http://cm.schema.com/api-core/2.0/">
|
|
15
|
+
<soapenv:Header/>
|
|
16
|
+
<soapenv:Body>
|
|
17
|
+
<ns:GetHotelRooms>
|
|
18
|
+
<!--Optional:-->
|
|
19
|
+
<ns:request>
|
|
20
|
+
<ns1:ChannelManagerUsername>' + Resonline.configuration.cm_username + '</ns1:ChannelManagerUsername>
|
|
21
|
+
<ns1:ChannelManagerPassword>' + Resonline.configuration.cm_password + '</ns1:ChannelManagerPassword>
|
|
22
|
+
<!--Optional:-->
|
|
23
|
+
<ns1:Username>' + Resonline.configuration.username + '</ns1:Username>
|
|
24
|
+
<!--Optional:-->
|
|
25
|
+
<ns1:Password>' + Resonline.configuration.password + '</ns1:Password>
|
|
26
|
+
<!--Optional:-->
|
|
27
|
+
<ns1:HotelId>' + Resonline.configuration.hotel_id.to_s + '</ns1:HotelId>
|
|
28
|
+
<!--Optional:-->
|
|
29
|
+
</ns:request>
|
|
30
|
+
</ns:GetHotelRooms>
|
|
31
|
+
</soapenv:Body>
|
|
32
|
+
</soapenv:Envelope>'
|
|
33
|
+
response = client.call(:get_hotel_rooms, xml: xml)
|
|
34
|
+
if response.success?
|
|
35
|
+
return response.body[:get_hotel_rooms_response][:get_hotel_rooms_result]
|
|
36
|
+
else
|
|
37
|
+
return Resonline::ErrorMessages.failed_response(response)
|
|
38
|
+
end
|
|
39
|
+
rescue Exception => e
|
|
40
|
+
return Resonline::ErrorMessages.exception(e)
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
def self.get_hotel_rate_package_deals(rate_package_id)
|
|
44
|
+
client = Savon.client(soap_options)
|
|
45
|
+
xml = '
|
|
46
|
+
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://cm.schema.com/direct/2.0/" xmlns:ns1="http://cm.schema.com/api-core/2.0/" xmlns:dir="http://schemas.datacontract.org/2004/07/DirectApi.Service.Content.Model">
|
|
47
|
+
<soapenv:Header/>
|
|
48
|
+
<soapenv:Body>
|
|
49
|
+
<ns:GetHotelRatePackageDeals>
|
|
50
|
+
<!--Optional:-->
|
|
51
|
+
<ns:request>
|
|
52
|
+
<ns1:ChannelManagerUsername>' + Resonline.configuration.cm_username + '</ns1:ChannelManagerUsername>
|
|
53
|
+
<ns1:ChannelManagerPassword>' + Resonline.configuration.cm_password + '</ns1:ChannelManagerPassword>
|
|
54
|
+
<!--Optional:-->
|
|
55
|
+
<ns1:Username>' + Resonline.configuration.username + '</ns1:Username>
|
|
56
|
+
<!--Optional:-->
|
|
57
|
+
<ns1:Password>' + Resonline.configuration.password + '</ns1:Password>
|
|
58
|
+
<!--Optional:-->
|
|
59
|
+
<ns1:HotelId>' + Resonline.configuration.hotel_id.to_s + '</ns1:HotelId>
|
|
60
|
+
<!--Optional:-->
|
|
61
|
+
<dir:HotelRatePackageID>' + rate_package_id.to_s + '</dir:HotelRatePackageID>
|
|
62
|
+
</ns:request>
|
|
63
|
+
</ns:GetHotelRatePackageDeals>
|
|
64
|
+
</soapenv:Body>
|
|
65
|
+
</soapenv:Envelope>'
|
|
66
|
+
response = client.call(:get_hotel_rate_package_deals, xml: xml)
|
|
67
|
+
if response.success?
|
|
68
|
+
return response.body[:get_hotel_rate_package_deals_response][:get_hotel_rate_package_deals_result]
|
|
69
|
+
else
|
|
70
|
+
return Resonline::ErrorMessages.failed_response(response)
|
|
71
|
+
end
|
|
72
|
+
rescue Exception => e
|
|
73
|
+
return Resonline::ErrorMessages.exception(e)
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
end
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
module Resonline
|
|
2
|
+
module Transformation
|
|
3
|
+
def self.soap_options
|
|
4
|
+
options = Resonline::SOAPNamespaces.merge({
|
|
5
|
+
endpoint: "#{Resonline::SOAPPrefixUrl}TransformationService.svc",
|
|
6
|
+
wsdl: "#{Resonline::SOAPPrefixUrl}TransformationService.svc?wsdl=wsdl0"
|
|
7
|
+
})
|
|
8
|
+
options
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def self.get_availability(room_id, start_date, end_date)
|
|
12
|
+
client = Savon.client(soap_options)
|
|
13
|
+
xml = '
|
|
14
|
+
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.bookeasy.com/ws/api/2.1.0.0/">
|
|
15
|
+
<soapenv:Header/>
|
|
16
|
+
<soapenv:Body>
|
|
17
|
+
<ns:GetAvailability>
|
|
18
|
+
<ns:XmlParameters><![CDATA[
|
|
19
|
+
<BookEasy>
|
|
20
|
+
<Operator>
|
|
21
|
+
<Credentials>
|
|
22
|
+
<Username>' + Resonline.configuration.username + '</Username>
|
|
23
|
+
<Password>' + Resonline.configuration.password + '</Password>
|
|
24
|
+
</Credentials>
|
|
25
|
+
<Rooms>
|
|
26
|
+
<Room>
|
|
27
|
+
<RoomID>' + room_id.to_s + '</RoomID>
|
|
28
|
+
</Room>
|
|
29
|
+
</Rooms>
|
|
30
|
+
</Operator>
|
|
31
|
+
<Options>
|
|
32
|
+
<StartDate>' + start_date.strftime("%Y-%m-%d") + '</StartDate>
|
|
33
|
+
<EndDate>' + end_date.strftime("%Y-%m-%d") + '</EndDate>
|
|
34
|
+
</Options>
|
|
35
|
+
</BookEasy>]]>
|
|
36
|
+
</ns:XmlParameters>
|
|
37
|
+
</ns:GetAvailability>
|
|
38
|
+
</soapenv:Body>
|
|
39
|
+
</soapenv:Envelope>'
|
|
40
|
+
response = client.call(:get_availability, xml: xml)
|
|
41
|
+
if response.success?
|
|
42
|
+
return response.body[:get_availability_response][:get_availability_result]
|
|
43
|
+
else
|
|
44
|
+
return Resonline::ErrorMessages.failed_response(response)
|
|
45
|
+
end
|
|
46
|
+
rescue Exception => e
|
|
47
|
+
return Resonline::ErrorMessages.exception(e)
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
def self.set_availability(room_id, start_date, end_date, number_available)
|
|
51
|
+
client = Savon.client(soap_options)
|
|
52
|
+
xml = '
|
|
53
|
+
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.bookeasy.com/ws/api/2.1.0.0/">
|
|
54
|
+
<soapenv:Header/>
|
|
55
|
+
<soapenv:Body>
|
|
56
|
+
<ns:SetAvailability>
|
|
57
|
+
<ns:XmlParameters><![CDATA[
|
|
58
|
+
<BookEasy>
|
|
59
|
+
<Operator>
|
|
60
|
+
<Credentials>
|
|
61
|
+
<Username>' + Resonline.configuration.username + '</Username>
|
|
62
|
+
<Password>' + Resonline.configuration.password + '</Password>
|
|
63
|
+
</Credentials>
|
|
64
|
+
<Rooms>
|
|
65
|
+
<Room>
|
|
66
|
+
<RoomID>' + room_id.to_s + '</RoomID>
|
|
67
|
+
<Availabilities>
|
|
68
|
+
<Availability>
|
|
69
|
+
<StartDate>' + start_date.strftime("%Y-%m-%d") + '</StartDate>
|
|
70
|
+
<EndDate>' + end_date.strftime("%Y-%m-%d") + '</EndDate>
|
|
71
|
+
<NumberAvailable>' + number_available.to_s + '</NumberAvailable>
|
|
72
|
+
</Availability>
|
|
73
|
+
</Availabilities>
|
|
74
|
+
</Room>
|
|
75
|
+
</Rooms>
|
|
76
|
+
</Operator>
|
|
77
|
+
</BookEasy>
|
|
78
|
+
]]></ns:XmlParameters>
|
|
79
|
+
</ns:SetAvailability>
|
|
80
|
+
</soapenv:Body>
|
|
81
|
+
</soapenv:Envelope>'
|
|
82
|
+
response = client.call(:set_availability, xml: xml)
|
|
83
|
+
if response.success?
|
|
84
|
+
return response.body[:set_availability_response][:set_availability_result]
|
|
85
|
+
else
|
|
86
|
+
return Resonline::ErrorMessages.failed_response(response)
|
|
87
|
+
end
|
|
88
|
+
rescue Exception => e
|
|
89
|
+
return Resonline::ErrorMessages.exception(e)
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
end
|
data/lib/resonline.rb
ADDED
data/resonline.gemspec
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
|
+
require 'resonline/version'
|
|
5
|
+
|
|
6
|
+
Gem::Specification.new do |spec|
|
|
7
|
+
spec.name = "resonline"
|
|
8
|
+
spec.version = Resonline::VERSION
|
|
9
|
+
spec.authors = ["Rijaludin Muhsin"]
|
|
10
|
+
spec.email = ["rijaludinmuhsin@gmail.com"]
|
|
11
|
+
spec.summary = %q{Ruby Helper for resonline SOAP}
|
|
12
|
+
spec.description = %q{Ruby Helper for resonline SOAP}
|
|
13
|
+
spec.homepage = ""
|
|
14
|
+
spec.license = "MIT"
|
|
15
|
+
|
|
16
|
+
spec.files = `git ls-files -z`.split("\x0")
|
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
|
19
|
+
spec.require_paths = ["lib"]
|
|
20
|
+
|
|
21
|
+
spec.add_development_dependency "bundler", "~> 1.6"
|
|
22
|
+
spec.add_development_dependency "rake"
|
|
23
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: resonline
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.0.1
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Rijaludin Muhsin
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2014-09-29 00:00:00.000000000 Z
|
|
12
|
+
dependencies:
|
|
13
|
+
- !ruby/object:Gem::Dependency
|
|
14
|
+
name: bundler
|
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
|
16
|
+
requirements:
|
|
17
|
+
- - "~>"
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: '1.6'
|
|
20
|
+
type: :development
|
|
21
|
+
prerelease: false
|
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
+
requirements:
|
|
24
|
+
- - "~>"
|
|
25
|
+
- !ruby/object:Gem::Version
|
|
26
|
+
version: '1.6'
|
|
27
|
+
- !ruby/object:Gem::Dependency
|
|
28
|
+
name: rake
|
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
|
30
|
+
requirements:
|
|
31
|
+
- - ">="
|
|
32
|
+
- !ruby/object:Gem::Version
|
|
33
|
+
version: '0'
|
|
34
|
+
type: :development
|
|
35
|
+
prerelease: false
|
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
+
requirements:
|
|
38
|
+
- - ">="
|
|
39
|
+
- !ruby/object:Gem::Version
|
|
40
|
+
version: '0'
|
|
41
|
+
description: Ruby Helper for resonline SOAP
|
|
42
|
+
email:
|
|
43
|
+
- rijaludinmuhsin@gmail.com
|
|
44
|
+
executables: []
|
|
45
|
+
extensions: []
|
|
46
|
+
extra_rdoc_files: []
|
|
47
|
+
files:
|
|
48
|
+
- ".gitignore"
|
|
49
|
+
- Gemfile
|
|
50
|
+
- LICENSE.txt
|
|
51
|
+
- README.md
|
|
52
|
+
- Rakefile
|
|
53
|
+
- lib/resonline.rb
|
|
54
|
+
- lib/resonline/configuration.rb
|
|
55
|
+
- lib/resonline/constants.rb
|
|
56
|
+
- lib/resonline/error_messages.rb
|
|
57
|
+
- lib/resonline/inventory.rb
|
|
58
|
+
- lib/resonline/service.rb
|
|
59
|
+
- lib/resonline/transformation.rb
|
|
60
|
+
- lib/resonline/version.rb
|
|
61
|
+
- resonline.gemspec
|
|
62
|
+
homepage: ''
|
|
63
|
+
licenses:
|
|
64
|
+
- MIT
|
|
65
|
+
metadata: {}
|
|
66
|
+
post_install_message:
|
|
67
|
+
rdoc_options: []
|
|
68
|
+
require_paths:
|
|
69
|
+
- lib
|
|
70
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
71
|
+
requirements:
|
|
72
|
+
- - ">="
|
|
73
|
+
- !ruby/object:Gem::Version
|
|
74
|
+
version: '0'
|
|
75
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
76
|
+
requirements:
|
|
77
|
+
- - ">="
|
|
78
|
+
- !ruby/object:Gem::Version
|
|
79
|
+
version: '0'
|
|
80
|
+
requirements: []
|
|
81
|
+
rubyforge_project:
|
|
82
|
+
rubygems_version: 2.2.2
|
|
83
|
+
signing_key:
|
|
84
|
+
specification_version: 4
|
|
85
|
+
summary: Ruby Helper for resonline SOAP
|
|
86
|
+
test_files: []
|