debitech_soap 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +4 -0
- data/Gemfile.lock +1 -1
- data/README.markdown +0 -1
- data/debitech_soap.gemspec +1 -1
- data/lib/debitech_soap.rb +8 -4
- data/lib/debitech_soap/version.rb +1 -1
- data/spec/debitech_soap_spec.rb +16 -0
- metadata +4 -3
data/CHANGELOG
CHANGED
data/Gemfile.lock
CHANGED
data/README.markdown
CHANGED
@@ -46,7 +46,6 @@ Gotchas
|
|
46
46
|
|
47
47
|
- We have only used the following methods in production: askIf3DSEnrolled, authorize3DS, authorize, subscribeAndSettle, checkSwedishPersNo, authorizeAndSettle.
|
48
48
|
- The other methods should work, but have not been tested.
|
49
|
-
- It does not handle timeouts as-is.
|
50
49
|
|
51
50
|
API docs
|
52
51
|
----
|
data/debitech_soap.gemspec
CHANGED
@@ -6,7 +6,7 @@ Gem::Specification.new do |s|
|
|
6
6
|
s.name = "debitech_soap"
|
7
7
|
s.version = DebitechSoap::VERSION
|
8
8
|
s.platform = Gem::Platform::RUBY
|
9
|
-
s.authors = ["Joakim Kolsjö", 'Niklas Holmgren', 'Henrik Nyh']
|
9
|
+
s.authors = ["Joakim Kolsjö", 'Niklas Holmgren', 'Henrik Nyh', 'Daniel Eriksson']
|
10
10
|
s.email = ["joakim.kolsjo@gmail.com", 'niklas.holmgren@bukowskis.com', 'henrik@barsoom.se']
|
11
11
|
s.homepage = "http://github.com/joakimk/debitech_soap"
|
12
12
|
s.summary = %q{A pure ruby way to make payments with DebiTech}
|
data/lib/debitech_soap.rb
CHANGED
@@ -67,10 +67,15 @@ module DebitechSoap
|
|
67
67
|
args.each_with_index { |argument, i|
|
68
68
|
attributes[parameter_order[i].to_sym] = argument
|
69
69
|
}
|
70
|
+
end
|
71
|
+
begin
|
72
|
+
client_result = return_value(@client.send(api_signature(method).first.first, attributes))
|
73
|
+
rescue Timeout::Error
|
74
|
+
client_result = OpenStruct.new(:resultCode => 403, :resultText => "SOAP Timeout")
|
75
|
+
return return_data(client_result)
|
70
76
|
end
|
71
|
-
|
72
|
-
|
73
|
-
end # end
|
77
|
+
return_data(client_result)
|
78
|
+
end
|
74
79
|
end
|
75
80
|
}
|
76
81
|
end
|
@@ -88,7 +93,6 @@ module DebitechSoap
|
|
88
93
|
hash[attribute.underscore] = result
|
89
94
|
end
|
90
95
|
}
|
91
|
-
|
92
96
|
OpenStruct.new(hash)
|
93
97
|
end
|
94
98
|
|
data/spec/debitech_soap_spec.rb
CHANGED
@@ -177,3 +177,19 @@ describe DebitechSoap::API, "calling a method with hash-style arguments" do
|
|
177
177
|
|
178
178
|
end
|
179
179
|
|
180
|
+
describe DebitechSoap::API, "handling exceptions" do
|
181
|
+
|
182
|
+
before do
|
183
|
+
@client = mock(Object)
|
184
|
+
SOAP::WSDLDriverFactory.stub!(:new).and_return(mock(Object, :create_rpc_driver => @client))
|
185
|
+
end
|
186
|
+
|
187
|
+
it "should catch Timeout::Error and return 403" do
|
188
|
+
api = DebitechSoap::API.new
|
189
|
+
@client.stub!("refund").and_raise(Timeout::Error)
|
190
|
+
result = api.refund(:verifyID => 1234567, :transID => 23456, :amount => 100, :extra => "extra")
|
191
|
+
result.getResultCode.should == 403
|
192
|
+
result.getResultText.should == "SOAP Timeout"
|
193
|
+
end
|
194
|
+
|
195
|
+
end
|
metadata
CHANGED
@@ -1,18 +1,19 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: debitech_soap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 21
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 5
|
10
|
+
version: 0.0.5
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- "Joakim Kolsj\xC3\xB6"
|
14
14
|
- Niklas Holmgren
|
15
15
|
- Henrik Nyh
|
16
|
+
- Daniel Eriksson
|
16
17
|
autorequire:
|
17
18
|
bindir: bin
|
18
19
|
cert_chain: []
|