solo 0.0.3 → 0.0.4

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.
data/lib/solo/customer.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  module Solo
2
2
  class Customer
3
3
  def self.search(arguments)
4
+ raise "Configuration Not Set" if Solo.configuration.nil?
4
5
  endpoint = URI('http://secure.softwarekey.com/solo/webservices/XmlCustomerService.asmx/CustomerSearchS')
5
6
  # build xml
6
7
  xml = String.new
@@ -15,6 +16,7 @@ module Solo
15
16
  end
16
17
 
17
18
  def self.search_by_id(id)
19
+ raise "Configuration Not Set" if Solo.configuration.nil?
18
20
  endpoint = URI('http://secure.softwarekey.com/solo/webservices/XmlCustomerService.asmx/GetCustomerDataByAuthorS')
19
21
  if id.blank?
20
22
  puts "ID can not be blank"
@@ -28,12 +30,14 @@ module Solo
28
30
  result = Net::HTTP.post_form(endpoint, 'xml' => xml)
29
31
  parser = Nori.new
30
32
  parsed = parser.parse(result.body)
31
- return parsed["CustomerData"] if parsed["CustomerData"].has_key? "ResultCode"
32
- return parsed["CustomerData"]["Customer"]
33
+ #return parsed["CustomerData"] if parsed["CustomerData"].has_key? "ResultCode"
34
+ #return parsed["CustomerData"]["Customer"]
35
+ return parsed["CustomerData"]
33
36
  end
34
37
  end
35
38
 
36
39
  def self.create!(arguments)
40
+ raise "Configuration Not Set" if Solo.configuration.nil?
37
41
  endpoint = URI('http://secure.softwarekey.com/solo/webservices/customerserver.asmx/CreateCustomer')
38
42
  auth = {}
39
43
  auth[:authorID] = Solo.configuration.author_id
data/lib/solo/license.rb CHANGED
@@ -4,6 +4,7 @@ module Solo
4
4
 
5
5
  class << self
6
6
  def infocheck(license_id)
7
+ raise "Configuration Not Set" if Solo.configuration.nil?
7
8
  endpoint = URI(SERVICEURI + '/InfoCheckS')
8
9
  xml = String.new
9
10
  xml += '<InfoCheckS>'
@@ -20,6 +21,7 @@ module Solo
20
21
  end
21
22
 
22
23
  def add(arguments)
24
+ raise "Configuration Not Set" if Solo.configuration.nil?
23
25
  endpoint = URI(SERVICEURI + '/AddS')
24
26
  xml = String.new
25
27
  xml += '<AddS>'
data/lib/solo/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Solo
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
@@ -23,7 +23,8 @@ describe Solo do
23
23
  VCR.use_cassette('search_by_valid_id') do
24
24
  customer = Solo::Customer.search_by_id('20496203')
25
25
  customer.class.should == Hash
26
- customer["CompanyName"].should == "TESTWEBSEV"
26
+ customer["Customer"]["CompanyName"].should == "TESTWEBSEV"
27
+ customer["License"].size.should > 0
27
28
  end
28
29
  end
29
30
 
data/spec/spec_helper.rb CHANGED
@@ -28,6 +28,5 @@ end
28
28
  VCR.configure do |c|
29
29
  c.cassette_library_dir = 'vcr_cassettes'
30
30
  c.hook_into :fakeweb # or :fakeweb
31
- #c.filter_sensitive_data
32
31
  c.allow_http_connections_when_no_cassette = true
33
32
  end
@@ -5,7 +5,7 @@ http_interactions:
5
5
  uri: http://secure.softwarekey.com/solo/webservices/XmlCustomerService.asmx/GetCustomerDataByAuthorS
6
6
  body:
7
7
  encoding: US-ASCII
8
- string: xml=%3CGetCustomerDataByAuthor%3E%3CAuthorID%3Eauthorid%3C%2FAuthorID%3E%3CUserID%3Euserid%3C%2FUserID%3E%3CUserPassword%3Epassword%3C%2FUserPassword%3E%3CCustomerID%3E20496203%3C%2FCustomerID%3E%3C%2FGetCustomerDataByAuthor%3E
8
+ string: xml=%3CGetCustomerDataByAuthor%3E%3CAuthorID%3E{AUTHORID}%3C%2FAuthorID%3E%3CUserID%3E{USERNAME}%3C%2FUserID%3E%3CUserPassword%3E{PASSWORD}%3C%2FUserPassword%3E%3CCustomerID%3E20496203%3C%2FCustomerID%3E%3C%2FGetCustomerDataByAuthor%3E
9
9
  headers:
10
10
  accept:
11
11
  - ! '*/*'
@@ -18,23 +18,23 @@ http_interactions:
18
18
  code: 200
19
19
  message: OK
20
20
  headers:
21
- date:
22
- - Thu, 30 Aug 2012 15:46:41 GMT
23
- server:
24
- - Microsoft-IIS/6.0
25
- p3p:
26
- - CP="CAO DSP COR CURa ADMa DEVa CONi HISa OTPi OUR DELa SAMi BUS IND PHY ONL
27
- UNI PUR COM NAV INT DEM STA"
28
- x-powered-by:
29
- - ASP.NET
30
- x-aspnet-version:
31
- - 2.0.50727
32
21
  cache-control:
33
22
  - private, max-age=0
23
+ content-length:
24
+ - '1827'
34
25
  content-type:
35
26
  - text/xml; charset=utf-8
36
- content-length:
37
- - '516'
27
+ server:
28
+ - Microsoft-IIS/7.5
29
+ x-aspnet-version:
30
+ - 2.0.50727
31
+ x-powered-by:
32
+ - ASP.NET
33
+ p3p:
34
+ - CP="CAO DSP COR CURa ADMa DEVa CONi HISa OTPi OUR DELa SAMi BUS IND PHY ONL
35
+ UNI PUR COM NAV INT DEM STA"
36
+ date:
37
+ - Mon, 21 Oct 2013 20:25:37 GMT
38
38
  body:
39
39
  encoding: US-ASCII
40
40
  string: ! "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<CustomerData>\r\n
@@ -43,7 +43,22 @@ http_interactions:
43
43
  \ <Enabled>true</Enabled>\r\n <InvalidAddress>false</InvalidAddress>\r\n
44
44
  \ <Taxable>true</Taxable>\r\n <ExcludeFromAll>false</ExcludeFromAll>\r\n
45
45
  \ <IsDistributor>false</IsDistributor>\r\n <OfferProduct>false</OfferProduct>\r\n
46
- \ <OfferPartners>false</OfferPartners>\r\n </Customer>\r\n</CustomerData>"
46
+ \ <OfferPartners>false</OfferPartners>\r\n <Password />\r\n </Customer>\r\n
47
+ \ <License>\r\n <LicenseID>60975017</LicenseID>\r\n <EnteredDate>2012-08-30T13:58:53.157-05:00</EnteredDate>\r\n
48
+ \ <Status>OK </Status>\r\n <ExpirationDate>2012-08-30T00:00:00-05:00</ExpirationDate>\r\n
49
+ \ <Quantity>0</Quantity>\r\n <LicenseUpdate />\r\n <ProductID>133024</ProductID>\r\n
50
+ \ <ProductName>Dr Dispatch 5</ProductName>\r\n <ProdOptionID>9754</ProdOptionID>\r\n
51
+ \ <OptionName>Dr Dispatch</OptionName>\r\n </License>\r\n <License>\r\n
52
+ \ <LicenseID>60975018</LicenseID>\r\n <EnteredDate>2012-08-30T13:59:39.773-05:00</EnteredDate>\r\n
53
+ \ <Status>OK </Status>\r\n <ExpirationDate>2012-08-30T00:00:00-05:00</ExpirationDate>\r\n
54
+ \ <Quantity>0</Quantity>\r\n <LicenseUpdate />\r\n <ProductID>133024</ProductID>\r\n
55
+ \ <ProductName>Dr Dispatch 5</ProductName>\r\n <ProdOptionID>9754</ProdOptionID>\r\n
56
+ \ <OptionName>Dr Dispatch</OptionName>\r\n </License>\r\n <License>\r\n
57
+ \ <LicenseID>60975019</LicenseID>\r\n <EnteredDate>2012-08-30T14:00:39.067-05:00</EnteredDate>\r\n
58
+ \ <Status>OK </Status>\r\n <ExpirationDate>2012-08-30T00:00:00-05:00</ExpirationDate>\r\n
59
+ \ <Quantity>0</Quantity>\r\n <LicenseUpdate />\r\n <ProductID>133024</ProductID>\r\n
60
+ \ <ProductName>Dr Dispatch 5</ProductName>\r\n <ProdOptionID>9754</ProdOptionID>\r\n
61
+ \ <OptionName>Dr Dispatch</OptionName>\r\n </License>\r\n</CustomerData>"
47
62
  http_version: '1.1'
48
- recorded_at: Thu, 30 Aug 2012 15:46:41 GMT
63
+ recorded_at: Mon, 21 Oct 2013 20:25:38 GMT
49
64
  recorded_with: VCR 2.2.4
metadata CHANGED
@@ -1,18 +1,20 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
+ prerelease:
5
6
  platform: ruby
6
7
  authors:
7
8
  - Richard Holland
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2013-10-19 00:00:00.000000000 Z
12
+ date: 2013-10-21 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: nori
15
16
  requirement: !ruby/object:Gem::Requirement
17
+ none: false
16
18
  requirements:
17
19
  - - ! '>='
18
20
  - !ruby/object:Gem::Version
@@ -20,6 +22,7 @@ dependencies:
20
22
  type: :runtime
21
23
  prerelease: false
22
24
  version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
23
26
  requirements:
24
27
  - - ! '>='
25
28
  - !ruby/object:Gem::Version
@@ -27,6 +30,7 @@ dependencies:
27
30
  - !ruby/object:Gem::Dependency
28
31
  name: nokogiri
29
32
  requirement: !ruby/object:Gem::Requirement
33
+ none: false
30
34
  requirements:
31
35
  - - ! '>='
32
36
  - !ruby/object:Gem::Version
@@ -34,6 +38,7 @@ dependencies:
34
38
  type: :runtime
35
39
  prerelease: false
36
40
  version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
37
42
  requirements:
38
43
  - - ! '>='
39
44
  - !ruby/object:Gem::Version
@@ -41,6 +46,7 @@ dependencies:
41
46
  - !ruby/object:Gem::Dependency
42
47
  name: bundler
43
48
  requirement: !ruby/object:Gem::Requirement
49
+ none: false
44
50
  requirements:
45
51
  - - ~>
46
52
  - !ruby/object:Gem::Version
@@ -48,6 +54,7 @@ dependencies:
48
54
  type: :development
49
55
  prerelease: false
50
56
  version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
51
58
  requirements:
52
59
  - - ~>
53
60
  - !ruby/object:Gem::Version
@@ -55,6 +62,7 @@ dependencies:
55
62
  - !ruby/object:Gem::Dependency
56
63
  name: rake
57
64
  requirement: !ruby/object:Gem::Requirement
65
+ none: false
58
66
  requirements:
59
67
  - - ! '>='
60
68
  - !ruby/object:Gem::Version
@@ -62,6 +70,7 @@ dependencies:
62
70
  type: :development
63
71
  prerelease: false
64
72
  version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
65
74
  requirements:
66
75
  - - ! '>='
67
76
  - !ruby/object:Gem::Version
@@ -69,6 +78,7 @@ dependencies:
69
78
  - !ruby/object:Gem::Dependency
70
79
  name: rspec
71
80
  requirement: !ruby/object:Gem::Requirement
81
+ none: false
72
82
  requirements:
73
83
  - - ! '>='
74
84
  - !ruby/object:Gem::Version
@@ -76,6 +86,7 @@ dependencies:
76
86
  type: :development
77
87
  prerelease: false
78
88
  version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
79
90
  requirements:
80
91
  - - ! '>='
81
92
  - !ruby/object:Gem::Version
@@ -83,6 +94,7 @@ dependencies:
83
94
  - !ruby/object:Gem::Dependency
84
95
  name: vcr
85
96
  requirement: !ruby/object:Gem::Requirement
97
+ none: false
86
98
  requirements:
87
99
  - - ! '>='
88
100
  - !ruby/object:Gem::Version
@@ -90,6 +102,7 @@ dependencies:
90
102
  type: :development
91
103
  prerelease: false
92
104
  version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
93
106
  requirements:
94
107
  - - ! '>='
95
108
  - !ruby/object:Gem::Version
@@ -97,6 +110,7 @@ dependencies:
97
110
  - !ruby/object:Gem::Dependency
98
111
  name: fakeweb
99
112
  requirement: !ruby/object:Gem::Requirement
113
+ none: false
100
114
  requirements:
101
115
  - - ! '>='
102
116
  - !ruby/object:Gem::Version
@@ -104,6 +118,7 @@ dependencies:
104
118
  type: :development
105
119
  prerelease: false
106
120
  version_requirements: !ruby/object:Gem::Requirement
121
+ none: false
107
122
  requirements:
108
123
  - - ! '>='
109
124
  - !ruby/object:Gem::Version
@@ -146,26 +161,27 @@ files:
146
161
  homepage: ''
147
162
  licenses:
148
163
  - MIT
149
- metadata: {}
150
164
  post_install_message:
151
165
  rdoc_options: []
152
166
  require_paths:
153
167
  - lib
154
168
  required_ruby_version: !ruby/object:Gem::Requirement
169
+ none: false
155
170
  requirements:
156
171
  - - ! '>='
157
172
  - !ruby/object:Gem::Version
158
173
  version: '0'
159
174
  required_rubygems_version: !ruby/object:Gem::Requirement
175
+ none: false
160
176
  requirements:
161
177
  - - ! '>='
162
178
  - !ruby/object:Gem::Version
163
179
  version: '0'
164
180
  requirements: []
165
181
  rubyforge_project:
166
- rubygems_version: 2.1.9
182
+ rubygems_version: 1.8.23
167
183
  signing_key:
168
- specification_version: 4
184
+ specification_version: 3
169
185
  summary: Integrate with Softwarekey SOLO hosted server
170
186
  test_files:
171
187
  - spec/.rspec
checksums.yaml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- SHA1:
3
- metadata.gz: d5ac2d3754caeda43a0df32b796070182b245574
4
- data.tar.gz: 4dfe16fbd5e23ff8da61b6bef789c2a0ac4940bd
5
- SHA512:
6
- metadata.gz: 4a2ef4643cba0e206012fe38062061fe4db90a55f8f2fd48489c103baaaa99c547528015d0852e34da01d90336ab6b8edf45dd55e83f94c5a516112ce651a3d9
7
- data.tar.gz: 45996e1e578ecfe993bb4960d1d6c15c54a178652bdd7a4fd9aa88b873cfb851d5d165a3dc507a1345c3de8a45149750e7315b75f37777f5f05e36f0f2be137a