debitech_soap 0.0.1 → 0.0.2
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/CHANGELOG +7 -0
- data/Gemfile.lock +0 -4
- data/debitech_soap.gemspec +0 -2
- data/lib/debitech_soap.rb +3 -9
- data/lib/debitech_soap/string_extensions.rb +39 -0
- data/lib/debitech_soap/version.rb +1 -1
- metadata +11 -37
data/CHANGELOG
ADDED
data/Gemfile.lock
CHANGED
@@ -2,18 +2,14 @@ PATH
|
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
4
|
debitech_soap (0.0.1)
|
5
|
-
activesupport
|
6
|
-
i18n
|
7
5
|
|
8
6
|
GEM
|
9
7
|
remote: http://rubygems.org/
|
10
8
|
specs:
|
11
9
|
ZenTest (4.4.2)
|
12
|
-
activesupport (3.0.3)
|
13
10
|
autotest (4.4.6)
|
14
11
|
ZenTest (>= 4.4.1)
|
15
12
|
diff-lcs (1.1.2)
|
16
|
-
i18n (0.5.0)
|
17
13
|
rspec (2.3.0)
|
18
14
|
rspec-core (~> 2.3.0)
|
19
15
|
rspec-expectations (~> 2.3.0)
|
data/debitech_soap.gemspec
CHANGED
@@ -12,8 +12,6 @@ Gem::Specification.new do |s|
|
|
12
12
|
s.summary = %q{A pure ruby way to make payments with DebiTech}
|
13
13
|
s.description = %q{An implementation of the DebiTech Java API using pure ruby and the SOAP API.}
|
14
14
|
|
15
|
-
s.add_dependency "activesupport"
|
16
|
-
s.add_dependency "i18n" # Because of activesupport infections
|
17
15
|
s.add_development_dependency 'rspec'
|
18
16
|
s.add_development_dependency 'autotest'
|
19
17
|
|
data/lib/debitech_soap.rb
CHANGED
@@ -1,13 +1,7 @@
|
|
1
1
|
require 'soap/wsdlDriver'
|
2
2
|
require 'ostruct'
|
3
3
|
require 'rubygems'
|
4
|
-
require '
|
5
|
-
|
6
|
-
begin
|
7
|
-
# Required for active_support 3+
|
8
|
-
require 'active_support/core_ext/string/inflections'
|
9
|
-
rescue LoadError
|
10
|
-
end
|
4
|
+
require 'debitech_soap/string_extensions'
|
11
5
|
|
12
6
|
module DebitechSoap
|
13
7
|
class API
|
@@ -34,12 +28,12 @@ module DebitechSoap
|
|
34
28
|
@api_credentials[:shopName] = opts[:merchant]
|
35
29
|
@api_credentials[:userName] = opts[:username]
|
36
30
|
@api_credentials[:password] = opts[:password]
|
37
|
-
|
31
|
+
|
38
32
|
disable_stderr do
|
39
33
|
@client = SOAP::WSDLDriverFactory.new('https://secure.incab.se/axis2/services/DTServerModuleService_v1?wsdl').create_rpc_driver
|
40
34
|
end
|
41
35
|
|
42
|
-
define_java_wrapper_methods!
|
36
|
+
define_java_wrapper_methods!
|
43
37
|
end
|
44
38
|
|
45
39
|
def valid_credentials?
|
@@ -0,0 +1,39 @@
|
|
1
|
+
module DebitechSoap
|
2
|
+
module StringExtensions
|
3
|
+
|
4
|
+
module Underscore
|
5
|
+
def underscore
|
6
|
+
word = dup
|
7
|
+
word.gsub!(/::/, '/')
|
8
|
+
word.gsub!(/([A-Z]+)([A-Z][a-z])/,'\1_\2')
|
9
|
+
word.gsub!(/([a-z\d])([A-Z])/,'\1_\2')
|
10
|
+
word.tr!("-", "_")
|
11
|
+
word.downcase!
|
12
|
+
word
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
module CamelCase
|
17
|
+
def camelcase(first_letter_in_uppercase = true)
|
18
|
+
if first_letter_in_uppercase
|
19
|
+
self.to_s.gsub(/\/(.?)/) { "::#{$1.upcase}" }.gsub(/(?:^|_)(.)/) { $1.upcase }
|
20
|
+
else
|
21
|
+
self.to_s[0].chr.downcase + camelize(lower_case_and_underscored_word)[1..1]
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
unless String.methods.include?('underscore')
|
30
|
+
String.class_eval do
|
31
|
+
include DebitechSoap::StringExtensions::Underscore
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
unless String.methods.include?('camelcase')
|
36
|
+
String.class_eval do
|
37
|
+
include DebitechSoap::StringExtensions::CamelCase
|
38
|
+
end
|
39
|
+
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: debitech_soap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: 27
|
5
|
+
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 2
|
10
|
+
version: 0.0.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- "Joakim Kolsj\xC3\xB6"
|
@@ -19,38 +19,10 @@ cert_chain: []
|
|
19
19
|
date: 2011-01-27 00:00:00 +01:00
|
20
20
|
default_executable:
|
21
21
|
dependencies:
|
22
|
-
- !ruby/object:Gem::Dependency
|
23
|
-
name: activesupport
|
24
|
-
prerelease: false
|
25
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
26
|
-
none: false
|
27
|
-
requirements:
|
28
|
-
- - ">="
|
29
|
-
- !ruby/object:Gem::Version
|
30
|
-
hash: 3
|
31
|
-
segments:
|
32
|
-
- 0
|
33
|
-
version: "0"
|
34
|
-
type: :runtime
|
35
|
-
version_requirements: *id001
|
36
|
-
- !ruby/object:Gem::Dependency
|
37
|
-
name: i18n
|
38
|
-
prerelease: false
|
39
|
-
requirement: &id002 !ruby/object:Gem::Requirement
|
40
|
-
none: false
|
41
|
-
requirements:
|
42
|
-
- - ">="
|
43
|
-
- !ruby/object:Gem::Version
|
44
|
-
hash: 3
|
45
|
-
segments:
|
46
|
-
- 0
|
47
|
-
version: "0"
|
48
|
-
type: :runtime
|
49
|
-
version_requirements: *id002
|
50
22
|
- !ruby/object:Gem::Dependency
|
51
23
|
name: rspec
|
52
24
|
prerelease: false
|
53
|
-
requirement: &
|
25
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
54
26
|
none: false
|
55
27
|
requirements:
|
56
28
|
- - ">="
|
@@ -60,11 +32,11 @@ dependencies:
|
|
60
32
|
- 0
|
61
33
|
version: "0"
|
62
34
|
type: :development
|
63
|
-
version_requirements: *
|
35
|
+
version_requirements: *id001
|
64
36
|
- !ruby/object:Gem::Dependency
|
65
37
|
name: autotest
|
66
38
|
prerelease: false
|
67
|
-
requirement: &
|
39
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
68
40
|
none: false
|
69
41
|
requirements:
|
70
42
|
- - ">="
|
@@ -74,7 +46,7 @@ dependencies:
|
|
74
46
|
- 0
|
75
47
|
version: "0"
|
76
48
|
type: :development
|
77
|
-
version_requirements: *
|
49
|
+
version_requirements: *id002
|
78
50
|
description: An implementation of the DebiTech Java API using pure ruby and the SOAP API.
|
79
51
|
email:
|
80
52
|
- joakim.kolsjo@gmail.com
|
@@ -88,6 +60,7 @@ extra_rdoc_files: []
|
|
88
60
|
files:
|
89
61
|
- .gitignore
|
90
62
|
- .rvmrc
|
63
|
+
- CHANGELOG
|
91
64
|
- Gemfile
|
92
65
|
- Gemfile.lock
|
93
66
|
- LICENCE
|
@@ -96,6 +69,7 @@ files:
|
|
96
69
|
- autotest/discover.rb
|
97
70
|
- debitech_soap.gemspec
|
98
71
|
- lib/debitech_soap.rb
|
72
|
+
- lib/debitech_soap/string_extensions.rb
|
99
73
|
- lib/debitech_soap/version.rb
|
100
74
|
- spec/debitech_soap_spec.rb
|
101
75
|
has_rdoc: true
|
@@ -128,7 +102,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
128
102
|
requirements: []
|
129
103
|
|
130
104
|
rubyforge_project:
|
131
|
-
rubygems_version: 1.
|
105
|
+
rubygems_version: 1.4.1
|
132
106
|
signing_key:
|
133
107
|
specification_version: 3
|
134
108
|
summary: A pure ruby way to make payments with DebiTech
|