billwise4r 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,25 +1,34 @@
1
1
  GEM
2
2
  remote: http://rubygems.org/
3
3
  specs:
4
- awesome_print (0.3.1)
4
+ awesome_print (0.4.0)
5
5
  builder (3.0.0)
6
- crack (0.1.8)
7
6
  git (1.2.5)
8
- jeweler (1.5.1)
7
+ gyoku (0.4.4)
8
+ builder (>= 2.1.2)
9
+ httpi (0.9.4)
10
+ pyu-ntlm-http (>= 0.1.3.1)
11
+ rack
12
+ jeweler (1.5.2)
9
13
  bundler (~> 1.0.0)
10
14
  git (>= 1.2.5)
11
15
  rake
12
- multi_xml (0.2.0)
13
- rake (0.8.7)
16
+ multi_xml (0.2.2)
17
+ nokogiri (1.4.4)
18
+ nori (0.2.3)
19
+ pyu-ntlm-http (0.1.3.1)
20
+ rack (1.3.0)
21
+ rake (0.9.2)
14
22
  rcov (0.9.9)
15
- rcov (0.9.9-java)
16
- savon (0.7.9)
23
+ savon (0.9.2)
17
24
  builder (>= 2.1.2)
18
- crack (>= 0.1.4)
25
+ gyoku (>= 0.4.0)
26
+ httpi (>= 0.7.8)
27
+ nokogiri (>= 1.4.0)
28
+ nori (>= 0.2.0)
19
29
  shoulda (2.11.3)
20
30
 
21
31
  PLATFORMS
22
- java
23
32
  ruby
24
33
 
25
34
  DEPENDENCIES
data/README.md CHANGED
@@ -7,22 +7,21 @@ Examples
7
7
  --------
8
8
 
9
9
  require 'billwise4r'
10
-
11
- billwise = Billwise.new({ :company_id => 123,
12
- :username => 'user',
13
- :password => 'pass',
14
- :wsdl_url => 'https://cwa021.connect4billing.com/axis2/services/ConnectSmService?wsdl',
15
- :endpoint => 'https://cwa021.connect4billing.com/axis2/services/ConnectSmService.ConnectSmServiceHttpSoap12Endpoint/',
16
- :namespace => 'http://connectsm.ws.bwse.com/xsd',
17
- :log => true})
18
-
19
- customer = billwise.find_customer(987)
10
+ billwise = Billwise.new({ :companyCd => 123,
11
+ :username => 'username',
12
+ :password => 'password',
13
+ :wsdl_url => 'https://cwa021.connect4billing.com/axis2/services/ConnectSmService?wsdl',
14
+ :endpoint => 'https://cwa021.connect4billing.com/axis2/services/ConnectSmService.ConnectSmServiceHttpSoap12Endpoint/',
15
+ :namespace => 'http://connectsm.ws.bwse.com/xsd',
16
+ :log => true,
17
+ :log_evel => :debug })
18
+ customer = billwise.find_customer(:customerCd => '000987')
20
19
  services = billwise.find_services({ :customerCd => '000123',
21
- :serviceId => 'A000000000000456',
22
- :status => 'A' })
20
+ :serviceId => 'A000000000000456',
21
+ :status => 'A' })
23
22
 
24
23
  Copyright
25
24
  ---------
26
25
 
27
- Copyright (c) 2010 Jason Goecke. See LICENSE.txt for further details.
26
+ Copyright (c) 2010, 2011 Jason Goecke. See LICENSE.txt for further details.
28
27
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.1.1
@@ -0,0 +1,82 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{billwise4r}
8
+ s.version = "0.1.1"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Jason Goecke"]
12
+ s.date = %q{2011-06-07}
13
+ s.description = %q{Ruby lib for consuming the Billwise SOAP/XML API}
14
+ s.email = %q{jason@goecke.net}
15
+ s.extra_rdoc_files = [
16
+ "LICENSE.txt",
17
+ "README.md"
18
+ ]
19
+ s.files = [
20
+ ".document",
21
+ "Gemfile",
22
+ "Gemfile.lock",
23
+ "LICENSE.txt",
24
+ "README.md",
25
+ "Rakefile",
26
+ "VERSION",
27
+ "billwise4r.gemspec",
28
+ "lib/billwise4r.rb",
29
+ "lib/billwise4r/billwise4r.rb",
30
+ "spec/billwise4r_spec.rb",
31
+ "spec/config/.gitignore",
32
+ "spec/config/config.yml",
33
+ "spec/connect_sm_service.wsdl",
34
+ "spec/spec_helper.rb"
35
+ ]
36
+ s.homepage = %q{http://github.com/tropo/billwise4r}
37
+ s.licenses = ["MIT"]
38
+ s.require_paths = ["lib"]
39
+ s.rubygems_version = %q{1.5.0}
40
+ s.summary = %q{Ruby lib for consuming the Billwise SOAP/XML API}
41
+ s.test_files = [
42
+ "spec/billwise4r_spec.rb",
43
+ "spec/spec_helper.rb"
44
+ ]
45
+
46
+ if s.respond_to? :specification_version then
47
+ s.specification_version = 3
48
+
49
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
50
+ s.add_runtime_dependency(%q<savon>, [">= 0"])
51
+ s.add_runtime_dependency(%q<multi_xml>, [">= 0"])
52
+ s.add_development_dependency(%q<shoulda>, [">= 0"])
53
+ s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
54
+ s.add_development_dependency(%q<jeweler>, ["~> 1.5.1"])
55
+ s.add_development_dependency(%q<rcov>, [">= 0"])
56
+ s.add_development_dependency(%q<awesome_print>, [">= 0"])
57
+ s.add_runtime_dependency(%q<savon>, [">= 0"])
58
+ s.add_development_dependency(%q<rspec>, [">= 0"])
59
+ else
60
+ s.add_dependency(%q<savon>, [">= 0"])
61
+ s.add_dependency(%q<multi_xml>, [">= 0"])
62
+ s.add_dependency(%q<shoulda>, [">= 0"])
63
+ s.add_dependency(%q<bundler>, ["~> 1.0.0"])
64
+ s.add_dependency(%q<jeweler>, ["~> 1.5.1"])
65
+ s.add_dependency(%q<rcov>, [">= 0"])
66
+ s.add_dependency(%q<awesome_print>, [">= 0"])
67
+ s.add_dependency(%q<savon>, [">= 0"])
68
+ s.add_dependency(%q<rspec>, [">= 0"])
69
+ end
70
+ else
71
+ s.add_dependency(%q<savon>, [">= 0"])
72
+ s.add_dependency(%q<multi_xml>, [">= 0"])
73
+ s.add_dependency(%q<shoulda>, [">= 0"])
74
+ s.add_dependency(%q<bundler>, ["~> 1.0.0"])
75
+ s.add_dependency(%q<jeweler>, ["~> 1.5.1"])
76
+ s.add_dependency(%q<rcov>, [">= 0"])
77
+ s.add_dependency(%q<awesome_print>, [">= 0"])
78
+ s.add_dependency(%q<savon>, [">= 0"])
79
+ s.add_dependency(%q<rspec>, [">= 0"])
80
+ end
81
+ end
82
+
@@ -9,18 +9,22 @@ class Billwise
9
9
  @companyCd = params[:companyCd]
10
10
  log = params[:log] || false
11
11
  log_level = params[:log_level] || false
12
-
13
- #Build our SOAP driver
14
- Savon::SOAP.version = 2
15
- Savon::WSSE.username = params[:username]
16
- Savon::WSSE.password = params[:password]
17
- Savon::Request.log = log
18
- Savon::Request.log_level = log_level
19
12
 
20
- @soap_driver = Savon::Client.new params[:wsdlUrl] || 'https://cwa021.connect4billing.com/axis2/services/ConnectSmService?wsdl'
13
+ Savon.configure do |config|
14
+ config.log = log
15
+ config.log_level = log_level
16
+ end
17
+
21
18
  @soap_endpoint = URI.parse params[:endpoint] || 'https://cwa021.connect4billing.com/axis2/services/ConnectSmService.ConnectSmServiceHttpSoap12Endpoint/'
22
- @soap_namespace = namespace = params[:namespace] || 'http://connectsm.ws.bwse.com/xsd'
19
+ @soap_namespace = params[:namespace] || 'http://connectsm.ws.bwse.com/xsd'
20
+ @soap_version = 2
23
21
 
22
+ # Build our SOAP driver
23
+ @soap_driver = Savon::Client.new do
24
+ wsse.credentials params[:username] , params[:password]
25
+ wsdl.document = params[:wsdlUrl] || 'https://cwa021.connect4billing.com/axis2/services/ConnectSmService?wsdl'
26
+ end
27
+
24
28
  @tag_order = tag_order
25
29
 
26
30
  MultiXml.parser = :nokogiri
@@ -32,9 +36,10 @@ class Billwise
32
36
  #
33
37
  # @return [Hash] the Billwise response
34
38
  def method_missing(method, params)
35
- response = @soap_driver.send(method) do |soap, wsse|
39
+ response = @soap_driver.request(:xsd, method) do |soap, wsse|
40
+ soap.version = @soap_version
36
41
  soap.endpoint = @soap_endpoint
37
- soap.namespaces["xmlns:wsdl"] = @soap_namespace
42
+ soap.namespaces["xmlns:xsd"] = @soap_namespace
38
43
 
39
44
  fields = { :companyCd => @companyCd }.merge!(params)
40
45
  fields.merge!({ :order! => @tag_order[method] }) if @tag_order[method]
@@ -62,7 +67,7 @@ class Billwise
62
67
  # @return [Hash] the methods and their ordered parameters
63
68
  def tag_order
64
69
  actions = {}
65
- MultiXml.parse(@soap_driver.wsdl.to_s)['definitions']['types']['schema'][2]['element'].each do |action|
70
+ MultiXml.parse(@soap_driver.wsdl.to_xml)['definitions']['types']['schema'][2]['element'].each do |action|
66
71
  attributes = []
67
72
  if action['complexType']['sequence']['element'].instance_of?(Hash)
68
73
  attributes << action['complexType']['sequence']['element']['name'].to_sym
data/lib/billwise4r.rb CHANGED
@@ -1,3 +1,4 @@
1
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
1
2
  require 'savon'
2
3
  require 'multi_xml'
3
4
  require 'billwise4r/billwise4r'
@@ -2,10 +2,8 @@ require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
2
 
3
3
  describe "Billwise" do
4
4
  before(:all) do
5
- @options = { :companyCd => 124,
6
- :username => 'user',
7
- :password => 'pass',
8
- :log => false }
5
+ config = YAML.load(File.open('spec/config/config.yml'))
6
+ @options = config.merge!({ :log => false })
9
7
 
10
8
  @billwise = Billwise.new @options
11
9
  end
@@ -0,0 +1 @@
1
+ config.yml
@@ -0,0 +1,3 @@
1
+ :companyCd: 123
2
+ :username: username
3
+ :password: password
metadata CHANGED
@@ -1,12 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: billwise4r
3
3
  version: !ruby/object:Gem::Version
4
- prerelease: false
4
+ hash: 25
5
+ prerelease:
5
6
  segments:
6
7
  - 0
7
8
  - 1
8
- - 0
9
- version: 0.1.0
9
+ - 1
10
+ version: 0.1.1
10
11
  platform: ruby
11
12
  authors:
12
13
  - Jason Goecke
@@ -14,120 +15,138 @@ autorequire:
14
15
  bindir: bin
15
16
  cert_chain: []
16
17
 
17
- date: 2010-12-07 00:00:00 -08:00
18
+ date: 2011-06-07 00:00:00 -07:00
18
19
  default_executable:
19
20
  dependencies:
20
21
  - !ruby/object:Gem::Dependency
21
22
  type: :runtime
22
- name: savon
23
- version_requirements: &id001 !ruby/object:Gem::Requirement
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ none: false
24
25
  requirements:
25
26
  - - ">="
26
27
  - !ruby/object:Gem::Version
28
+ hash: 3
27
29
  segments:
28
30
  - 0
29
31
  version: "0"
30
- requirement: *id001
32
+ name: savon
33
+ version_requirements: *id001
31
34
  prerelease: false
32
35
  - !ruby/object:Gem::Dependency
33
36
  type: :runtime
34
- name: multi_xml
35
- version_requirements: &id002 !ruby/object:Gem::Requirement
37
+ requirement: &id002 !ruby/object:Gem::Requirement
38
+ none: false
36
39
  requirements:
37
40
  - - ">="
38
41
  - !ruby/object:Gem::Version
42
+ hash: 3
39
43
  segments:
40
44
  - 0
41
45
  version: "0"
42
- requirement: *id002
46
+ name: multi_xml
47
+ version_requirements: *id002
43
48
  prerelease: false
44
49
  - !ruby/object:Gem::Dependency
45
50
  type: :development
46
- name: shoulda
47
- version_requirements: &id003 !ruby/object:Gem::Requirement
51
+ requirement: &id003 !ruby/object:Gem::Requirement
52
+ none: false
48
53
  requirements:
49
54
  - - ">="
50
55
  - !ruby/object:Gem::Version
56
+ hash: 3
51
57
  segments:
52
58
  - 0
53
59
  version: "0"
54
- requirement: *id003
60
+ name: shoulda
61
+ version_requirements: *id003
55
62
  prerelease: false
56
63
  - !ruby/object:Gem::Dependency
57
64
  type: :development
58
- name: bundler
59
- version_requirements: &id004 !ruby/object:Gem::Requirement
65
+ requirement: &id004 !ruby/object:Gem::Requirement
66
+ none: false
60
67
  requirements:
61
68
  - - ~>
62
69
  - !ruby/object:Gem::Version
70
+ hash: 23
63
71
  segments:
64
72
  - 1
65
73
  - 0
66
74
  - 0
67
75
  version: 1.0.0
68
- requirement: *id004
76
+ name: bundler
77
+ version_requirements: *id004
69
78
  prerelease: false
70
79
  - !ruby/object:Gem::Dependency
71
80
  type: :development
72
- name: jeweler
73
- version_requirements: &id005 !ruby/object:Gem::Requirement
81
+ requirement: &id005 !ruby/object:Gem::Requirement
82
+ none: false
74
83
  requirements:
75
84
  - - ~>
76
85
  - !ruby/object:Gem::Version
86
+ hash: 1
77
87
  segments:
78
88
  - 1
79
89
  - 5
80
90
  - 1
81
91
  version: 1.5.1
82
- requirement: *id005
92
+ name: jeweler
93
+ version_requirements: *id005
83
94
  prerelease: false
84
95
  - !ruby/object:Gem::Dependency
85
96
  type: :development
86
- name: rcov
87
- version_requirements: &id006 !ruby/object:Gem::Requirement
97
+ requirement: &id006 !ruby/object:Gem::Requirement
98
+ none: false
88
99
  requirements:
89
100
  - - ">="
90
101
  - !ruby/object:Gem::Version
102
+ hash: 3
91
103
  segments:
92
104
  - 0
93
105
  version: "0"
94
- requirement: *id006
106
+ name: rcov
107
+ version_requirements: *id006
95
108
  prerelease: false
96
109
  - !ruby/object:Gem::Dependency
97
110
  type: :development
98
- name: awesome_print
99
- version_requirements: &id007 !ruby/object:Gem::Requirement
111
+ requirement: &id007 !ruby/object:Gem::Requirement
112
+ none: false
100
113
  requirements:
101
114
  - - ">="
102
115
  - !ruby/object:Gem::Version
116
+ hash: 3
103
117
  segments:
104
118
  - 0
105
119
  version: "0"
106
- requirement: *id007
120
+ name: awesome_print
121
+ version_requirements: *id007
107
122
  prerelease: false
108
123
  - !ruby/object:Gem::Dependency
109
124
  type: :runtime
110
- name: savon
111
- version_requirements: &id008 !ruby/object:Gem::Requirement
125
+ requirement: &id008 !ruby/object:Gem::Requirement
126
+ none: false
112
127
  requirements:
113
128
  - - ">="
114
129
  - !ruby/object:Gem::Version
130
+ hash: 3
115
131
  segments:
116
132
  - 0
117
133
  version: "0"
118
- requirement: *id008
134
+ name: savon
135
+ version_requirements: *id008
119
136
  prerelease: false
120
137
  - !ruby/object:Gem::Dependency
121
138
  type: :development
122
- name: rspec
123
- version_requirements: &id009 !ruby/object:Gem::Requirement
139
+ requirement: &id009 !ruby/object:Gem::Requirement
140
+ none: false
124
141
  requirements:
125
142
  - - ">="
126
143
  - !ruby/object:Gem::Version
144
+ hash: 3
127
145
  segments:
128
146
  - 0
129
147
  version: "0"
130
- requirement: *id009
148
+ name: rspec
149
+ version_requirements: *id009
131
150
  prerelease: false
132
151
  description: Ruby lib for consuming the Billwise SOAP/XML API
133
152
  email: jason@goecke.net
@@ -146,9 +165,12 @@ files:
146
165
  - README.md
147
166
  - Rakefile
148
167
  - VERSION
168
+ - billwise4r.gemspec
149
169
  - lib/billwise4r.rb
150
170
  - lib/billwise4r/billwise4r.rb
151
171
  - spec/billwise4r_spec.rb
172
+ - spec/config/.gitignore
173
+ - spec/config/config.yml
152
174
  - spec/connect_sm_service.wsdl
153
175
  - spec/spec_helper.rb
154
176
  has_rdoc: true
@@ -161,23 +183,27 @@ rdoc_options: []
161
183
  require_paths:
162
184
  - lib
163
185
  required_ruby_version: !ruby/object:Gem::Requirement
186
+ none: false
164
187
  requirements:
165
188
  - - ">="
166
189
  - !ruby/object:Gem::Version
190
+ hash: 3
167
191
  segments:
168
192
  - 0
169
193
  version: "0"
170
194
  required_rubygems_version: !ruby/object:Gem::Requirement
195
+ none: false
171
196
  requirements:
172
197
  - - ">="
173
198
  - !ruby/object:Gem::Version
199
+ hash: 3
174
200
  segments:
175
201
  - 0
176
202
  version: "0"
177
203
  requirements: []
178
204
 
179
205
  rubyforge_project:
180
- rubygems_version: 1.3.6
206
+ rubygems_version: 1.5.0
181
207
  signing_key:
182
208
  specification_version: 3
183
209
  summary: Ruby lib for consuming the Billwise SOAP/XML API