sisow 1.0.1 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +7 -6
- data/lib/sisow.rb +2 -1
- data/lib/sisow/api/request.rb +8 -4
- data/lib/sisow/api/request/transaction_request.rb +1 -0
- data/lib/sisow/configuration.rb +4 -3
- data/lib/sisow/version.rb +1 -1
- data/sisow.gemspec +3 -1
- data/spec/models/configuration_spec.rb +0 -1
- data/spec/models/request_spec.rb +2 -1
- metadata +19 -3
data/Gemfile.lock
CHANGED
@@ -1,21 +1,22 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
sisow (1.0.
|
4
|
+
sisow (1.0.1)
|
5
|
+
crack
|
5
6
|
hashie
|
6
|
-
|
7
|
+
httpi
|
7
8
|
|
8
9
|
GEM
|
9
10
|
remote: http://rubygems.org/
|
10
11
|
specs:
|
12
|
+
crack (0.3.1)
|
11
13
|
diff-lcs (1.1.3)
|
12
14
|
fakeweb (1.3.0)
|
13
15
|
hashie (1.2.0)
|
14
|
-
|
15
|
-
|
16
|
-
multi_xml
|
16
|
+
httpi (1.1.1)
|
17
|
+
rack
|
17
18
|
multi_json (1.3.5)
|
18
|
-
|
19
|
+
rack (1.4.1)
|
19
20
|
rake (0.9.2.2)
|
20
21
|
rspec (2.10.0)
|
21
22
|
rspec-core (~> 2.10.0)
|
data/lib/sisow.rb
CHANGED
data/lib/sisow/api/request.rb
CHANGED
@@ -2,8 +2,7 @@ module Sisow
|
|
2
2
|
module Api
|
3
3
|
class Request
|
4
4
|
|
5
|
-
|
6
|
-
base_uri "http://www.sisow.nl/Sisow/iDeal/RestHandler.ashx/"
|
5
|
+
BASE_URI = "http://www.sisow.nl/Sisow/iDeal/RestHandler.ashx"
|
7
6
|
|
8
7
|
def self.perform
|
9
8
|
new.perform
|
@@ -14,8 +13,9 @@ module Sisow
|
|
14
13
|
|
15
14
|
validate!
|
16
15
|
|
17
|
-
|
18
|
-
|
16
|
+
http_response = HTTPI.get(base_uri + uri)
|
17
|
+
parsed_response = Crack::XML.parse(http_response.body)
|
18
|
+
response = Hashie::Mash.new(parsed_response)
|
19
19
|
|
20
20
|
error!(response) if response.errorresponse?
|
21
21
|
|
@@ -61,6 +61,10 @@ module Sisow
|
|
61
61
|
raise Sisow::Exception, error_response.message and return
|
62
62
|
end
|
63
63
|
|
64
|
+
def base_uri
|
65
|
+
Sisow.configuration.base_uri || BASE_URI
|
66
|
+
end
|
67
|
+
|
64
68
|
end
|
65
69
|
end
|
66
70
|
end
|
data/lib/sisow/configuration.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
module Sisow
|
2
2
|
class Configuration
|
3
3
|
|
4
|
-
attr_accessor :merchant_id, :merchant_key, :test_mode, :debug_mode, :shop_id
|
4
|
+
attr_accessor :merchant_id, :merchant_key, :test_mode, :debug_mode, :shop_id, :base_uri
|
5
5
|
|
6
6
|
def initialize
|
7
7
|
@debug_mode = false
|
@@ -19,9 +19,10 @@ module Sisow
|
|
19
19
|
@debug_mode = boolean
|
20
20
|
|
21
21
|
if boolean == true
|
22
|
-
|
22
|
+
HTTPI.log = true
|
23
|
+
HTTPI.log_level = :debug
|
23
24
|
else
|
24
|
-
|
25
|
+
HTTPI.log = false
|
25
26
|
end
|
26
27
|
end
|
27
28
|
|
data/lib/sisow/version.rb
CHANGED
data/sisow.gemspec
CHANGED
@@ -19,12 +19,14 @@ Gem::Specification.new do |s|
|
|
19
19
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
20
20
|
s.require_paths = ["lib"]
|
21
21
|
|
22
|
-
s.add_dependency '
|
22
|
+
s.add_dependency 'httpi'
|
23
23
|
s.add_dependency 'hashie'
|
24
|
+
s.add_dependency 'crack'
|
24
25
|
|
25
26
|
s.add_development_dependency 'rspec'
|
26
27
|
s.add_development_dependency 'vcr'
|
27
28
|
s.add_development_dependency 'fakeweb'
|
28
29
|
s.add_development_dependency 'simplecov'
|
29
30
|
s.add_development_dependency 'simplecov-rcov'
|
31
|
+
|
30
32
|
end
|
data/spec/models/request_spec.rb
CHANGED
@@ -12,7 +12,8 @@ describe Sisow::Api::Request do
|
|
12
12
|
end
|
13
13
|
|
14
14
|
it "should point to the base URI of the Sisow API" do
|
15
|
-
Sisow::Api::Request.
|
15
|
+
request = Sisow::Api::Request.new
|
16
|
+
request.send(:base_uri).should == "http://www.sisow.nl/Sisow/iDeal/RestHandler.ashx"
|
16
17
|
end
|
17
18
|
|
18
19
|
it "should perform properly" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sisow
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,10 +9,10 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-07-
|
12
|
+
date: 2012-07-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
|
-
name:
|
15
|
+
name: httpi
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
@@ -43,6 +43,22 @@ dependencies:
|
|
43
43
|
- - ! '>='
|
44
44
|
- !ruby/object:Gem::Version
|
45
45
|
version: '0'
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: crack
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
type: :runtime
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
46
62
|
- !ruby/object:Gem::Dependency
|
47
63
|
name: rspec
|
48
64
|
requirement: !ruby/object:Gem::Requirement
|