micropayment 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +5 -0
- data/.rvmrc +1 -0
- data/Gemfile +12 -0
- data/Gemfile.lock +33 -0
- data/LICENSE.txt +20 -0
- data/README.markdown +38 -0
- data/Rakefile +53 -0
- data/VERSION +1 -0
- data/lib/micropayment.rb +26 -0
- data/lib/services/api.rb +54 -0
- data/lib/services/config.rb +15 -0
- data/lib/services/debit.rb +221 -0
- data/micropayment.gemspec +72 -0
- data/test/helper.rb +18 -0
- data/test/test_micropayment.rb +7 -0
- metadata +182 -0
data/.document
ADDED
data/.rvmrc
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
rvm use --create ree@micropayment
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
GEM
|
2
|
+
remote: http://rubygems.org/
|
3
|
+
specs:
|
4
|
+
addressable (2.2.8)
|
5
|
+
git (1.2.5)
|
6
|
+
jeweler (1.8.3)
|
7
|
+
bundler (~> 1.0)
|
8
|
+
git (>= 1.2.5)
|
9
|
+
rake
|
10
|
+
rdoc
|
11
|
+
json (1.6.6)
|
12
|
+
rake (0.9.2.2)
|
13
|
+
rcov (1.0.0)
|
14
|
+
rdoc (3.12)
|
15
|
+
json (~> 1.4)
|
16
|
+
shoulda (3.0.1)
|
17
|
+
shoulda-context (~> 1.0.0)
|
18
|
+
shoulda-matchers (~> 1.0.0)
|
19
|
+
shoulda-context (1.0.0)
|
20
|
+
shoulda-matchers (1.0.0)
|
21
|
+
yajl-ruby (1.1.0)
|
22
|
+
|
23
|
+
PLATFORMS
|
24
|
+
ruby
|
25
|
+
|
26
|
+
DEPENDENCIES
|
27
|
+
addressable
|
28
|
+
bundler (~> 1.1.0)
|
29
|
+
jeweler (~> 1.8.3)
|
30
|
+
rcov
|
31
|
+
rdoc (~> 3.12)
|
32
|
+
shoulda
|
33
|
+
yajl-ruby
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2012 General Scripting UG (haftungsbeschränkt)
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.markdown
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
= micropayment
|
2
|
+
|
3
|
+
Implemantation of the NVP API provided by micropayment.de.
|
4
|
+
WIP
|
5
|
+
|
6
|
+
== Installation
|
7
|
+
|
8
|
+
```
|
9
|
+
gem install micropayment
|
10
|
+
```
|
11
|
+
|
12
|
+
== Usage
|
13
|
+
|
14
|
+
```
|
15
|
+
require 'micropayment'
|
16
|
+
|
17
|
+
Micropayment::Config.api_key = 'api_access_key_from_micropayment_de'
|
18
|
+
|
19
|
+
Micropayment::Config.sandbox = 1
|
20
|
+
|
21
|
+
Micropayment::Debit.customerList
|
22
|
+
#=> { "error"=>"0", "count"=>"2", "maxCount"=>"2", "customerIdList"=>["id1", "id2"] }
|
23
|
+
```
|
24
|
+
|
25
|
+
== Contributing to micropayment
|
26
|
+
|
27
|
+
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
|
28
|
+
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
|
29
|
+
* Fork the project.
|
30
|
+
* Start a feature/bugfix branch.
|
31
|
+
* Commit and push until you are happy with your contribution.
|
32
|
+
* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
|
33
|
+
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
|
34
|
+
|
35
|
+
== Copyright
|
36
|
+
|
37
|
+
Copyright (c) 2012 General Scripting UG (haftungsbeschränkt). See LICENSE.txt for further details.
|
38
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,53 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
require 'bundler'
|
5
|
+
begin
|
6
|
+
Bundler.setup(:default, :development)
|
7
|
+
rescue Bundler::BundlerError => e
|
8
|
+
$stderr.puts e.message
|
9
|
+
$stderr.puts "Run `bundle install` to install missing gems"
|
10
|
+
exit e.status_code
|
11
|
+
end
|
12
|
+
require 'rake'
|
13
|
+
|
14
|
+
require 'jeweler'
|
15
|
+
Jeweler::Tasks.new do |gem|
|
16
|
+
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
|
17
|
+
gem.name = "micropayment"
|
18
|
+
gem.homepage = "http://github.com/GeneralScripting/micropayment"
|
19
|
+
gem.license = "MIT"
|
20
|
+
gem.summary = %Q{NVP API implementation for micropayment.de}
|
21
|
+
gem.description = %Q{Implements the NameValuePair API provided by micropayment.de}
|
22
|
+
gem.email = "jan@general-scripting.com"
|
23
|
+
gem.authors = ["Jan Schwenzien"]
|
24
|
+
# dependencies defined in Gemfile
|
25
|
+
end
|
26
|
+
Jeweler::RubygemsDotOrgTasks.new
|
27
|
+
|
28
|
+
require 'rake/testtask'
|
29
|
+
Rake::TestTask.new(:test) do |test|
|
30
|
+
test.libs << 'lib' << 'test'
|
31
|
+
test.pattern = 'test/**/test_*.rb'
|
32
|
+
test.verbose = true
|
33
|
+
end
|
34
|
+
|
35
|
+
require 'rcov/rcovtask'
|
36
|
+
Rcov::RcovTask.new do |test|
|
37
|
+
test.libs << 'test'
|
38
|
+
test.pattern = 'test/**/test_*.rb'
|
39
|
+
test.verbose = true
|
40
|
+
test.rcov_opts << '--exclude "gems/*"'
|
41
|
+
end
|
42
|
+
|
43
|
+
task :default => :test
|
44
|
+
|
45
|
+
require 'rdoc/task'
|
46
|
+
Rake::RDocTask.new do |rdoc|
|
47
|
+
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
48
|
+
|
49
|
+
rdoc.rdoc_dir = 'rdoc'
|
50
|
+
rdoc.title = "micropayment #{version}"
|
51
|
+
rdoc.rdoc_files.include('README*')
|
52
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
53
|
+
end
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.1.1
|
data/lib/micropayment.rb
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
require "addressable/uri"
|
2
|
+
require "net/https"
|
3
|
+
require "cgi"
|
4
|
+
|
5
|
+
module Micropayment
|
6
|
+
|
7
|
+
autoload :Config, 'services/config'
|
8
|
+
autoload :API, 'services/api'
|
9
|
+
autoload :Debit, 'services/debit'
|
10
|
+
|
11
|
+
def self.assert_valid_keys(opts, *valid_keys)
|
12
|
+
valid_keys.flatten!
|
13
|
+
opts.each_key do |k|
|
14
|
+
raise(ArgumentError, "Unknown key: #{k}") unless valid_keys.include?(k)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
def self.assert_keys_exists(opts, *keys)
|
19
|
+
keys.flatten!
|
20
|
+
opt_keys = opts.keys
|
21
|
+
keys.each do |k|
|
22
|
+
raise(ArgumentError, "Mandatory key missing: #{k}") unless opt_keys.include?(k)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
data/lib/services/api.rb
ADDED
@@ -0,0 +1,54 @@
|
|
1
|
+
module Micropayment
|
2
|
+
|
3
|
+
module API
|
4
|
+
|
5
|
+
extend self
|
6
|
+
|
7
|
+
RootCA = '/etc/ssl/certs'
|
8
|
+
DEFAULT_TIMEOUT = 10
|
9
|
+
|
10
|
+
def ensure_api_key!
|
11
|
+
raise "Micropayment::Config.api_key has not been set. See github.com/GeneralScripting/micropayment" unless Config.api_key
|
12
|
+
end
|
13
|
+
|
14
|
+
def call(url, method, data={})
|
15
|
+
ensure_api_key!
|
16
|
+
data[:action] = method
|
17
|
+
data[:accessKey] = Config.api_key
|
18
|
+
data[:testMode] ||= Config.sandbox || 0
|
19
|
+
data.delete_if {|k,v| v.nil? }
|
20
|
+
uri = Addressable::URI.parse(url)
|
21
|
+
uri.query_values = data
|
22
|
+
parseNVP get(uri)
|
23
|
+
end
|
24
|
+
|
25
|
+
def get(uri)
|
26
|
+
use_ssl = uri.scheme == 'https'
|
27
|
+
http = Net::HTTP.new(uri.host, use_ssl ? 443 : 80)
|
28
|
+
http.use_ssl = use_ssl
|
29
|
+
#http.read_timeout = timeout
|
30
|
+
if use_ssl
|
31
|
+
if File.directory? RootCA
|
32
|
+
http.ca_path = RootCA
|
33
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_PEER
|
34
|
+
http.verify_depth = 5
|
35
|
+
else
|
36
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
37
|
+
end
|
38
|
+
end
|
39
|
+
response = http.get uri.request_uri, 'User-agent' => 'Micropayment Ruby Client'
|
40
|
+
case response
|
41
|
+
when Net::HTTPSuccess, Net::HTTPOK
|
42
|
+
response.body
|
43
|
+
else
|
44
|
+
response.error!
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
def parseNVP(text)
|
49
|
+
Addressable::URI.parse("http://example.com?#{text.split("\n").join("&")}").query_values
|
50
|
+
end
|
51
|
+
|
52
|
+
end
|
53
|
+
|
54
|
+
end
|
@@ -0,0 +1,221 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
module Micropayment
|
4
|
+
class Debit
|
5
|
+
|
6
|
+
URL = Config::BASE_URL + "debit/v1.4/nvp/"
|
7
|
+
|
8
|
+
class << self
|
9
|
+
|
10
|
+
def execute(method, data={})
|
11
|
+
API.call(URL, method, data)
|
12
|
+
end
|
13
|
+
|
14
|
+
def assert_valid_keys(*opts)
|
15
|
+
Micropayment.assert_valid_keys *opts
|
16
|
+
end
|
17
|
+
|
18
|
+
def assert_keys_exists(*opts)
|
19
|
+
Micropayment.assert_keys_exists *opts
|
20
|
+
end
|
21
|
+
|
22
|
+
|
23
|
+
# "löscht alle Kunden und Transaktionen in der Testumgebung"
|
24
|
+
def reset_test
|
25
|
+
execute(:resetTest, :testMode => 1)
|
26
|
+
end
|
27
|
+
|
28
|
+
# "legt neuen Kunden an"
|
29
|
+
def customerCreate(options={})
|
30
|
+
assert_valid_keys(options, :customerId, :freeParams)
|
31
|
+
assert_keys_exists(options, :customerId)
|
32
|
+
execute(:customerCreate, options)
|
33
|
+
end
|
34
|
+
|
35
|
+
# "ordnet weitere freie Parameter dem Kunden zu, oder ändert sie"
|
36
|
+
def customerSet(options={})
|
37
|
+
assert_valid_keys(options, :customerId, :freeParams)
|
38
|
+
assert_keys_exists(options, :customerId)
|
39
|
+
execute(:customerSet, options)
|
40
|
+
end
|
41
|
+
|
42
|
+
# "ermittelt alle freien Parameter des Kunden"
|
43
|
+
def customerGet(options={})
|
44
|
+
assert_valid_keys(options, :customerId)
|
45
|
+
assert_keys_exists(options, :customerId)
|
46
|
+
execute(:customerGet, options)
|
47
|
+
end
|
48
|
+
|
49
|
+
# "ermittelt alle Kunden"
|
50
|
+
def customerList(options={})
|
51
|
+
assert_valid_keys(options, :from, :count)
|
52
|
+
execute(:customerList, options)
|
53
|
+
end
|
54
|
+
|
55
|
+
# "erzeugt oder ändert Bankverbindung eines Kunden"
|
56
|
+
def bankaccountSet(options={})
|
57
|
+
assert_valid_keys(options, :customerId, :bankVode, :accountNumber, :accountHolder, :country)
|
58
|
+
assert_keys_exists(options, :customerId, :bankVode, :accountNumber, :accountHolder)
|
59
|
+
execute(:bankaccountSet, options)
|
60
|
+
end
|
61
|
+
|
62
|
+
# "ermittelt die Bankverbindung des Kunden"
|
63
|
+
def bankaccountGet(options={})
|
64
|
+
assert_valid_keys(options, :customerId)
|
65
|
+
assert_keys_exists(options, :customerId)
|
66
|
+
execute(:bankaccountGet, options)
|
67
|
+
end
|
68
|
+
|
69
|
+
# "prüft Bankleitzahl und ermittelt Banknamen"
|
70
|
+
def bankCheck(options={})
|
71
|
+
assert_valid_keys(options, :country, :bankCode)
|
72
|
+
assert_keys_exists(options, :bankCode)
|
73
|
+
execute(:bankCheck, options)
|
74
|
+
end
|
75
|
+
|
76
|
+
# "prüft Bankverbindung und ermittelt Banknamen"
|
77
|
+
def bankaccountCheck(options={})
|
78
|
+
assert_valid_keys(options, :country, :bankCode, :accountNumber)
|
79
|
+
assert_keys_exists(options, :bankCode, :accountNumber)
|
80
|
+
execute(:bankaccountCheck, options)
|
81
|
+
end
|
82
|
+
|
83
|
+
# "Sperrt Bankverbindung oder gibt sie frei"
|
84
|
+
def bankaccountBar(options={})
|
85
|
+
assert_valid_keys(options, :country, :bankCode, :accountNumber, :barStatus)
|
86
|
+
assert_keys_exists(options, :bankCode, :accountNumber, :barStatus)
|
87
|
+
execute(:bankaccountBar, options)
|
88
|
+
end
|
89
|
+
|
90
|
+
# "erzeugt oder ändert Adressdaten eines Kunden"
|
91
|
+
def addressSet(options={})
|
92
|
+
assert_valid_keys(options, :customerId, :firstName, :surName, :street, :zip, :city, :country)
|
93
|
+
assert_keys_exists(options, :customerId, :firstName, :surName, :street, :zip, :city)
|
94
|
+
execute(:addressSet, options)
|
95
|
+
end
|
96
|
+
|
97
|
+
# "ermittelt die Adresse des Kunden"
|
98
|
+
def addressGet(options={})
|
99
|
+
assert_valid_keys(options, :customerId)
|
100
|
+
assert_keys_exists(options, :customerId)
|
101
|
+
execute(:addressGet, options)
|
102
|
+
end
|
103
|
+
|
104
|
+
# "erzeugt oder ändert Kontaktdaten eines Kunden"
|
105
|
+
def contactDataSet(options={})
|
106
|
+
assert_valid_keys(options, :customerId, :email, :phone, :mobile)
|
107
|
+
assert_keys_exists(options, :customerId)
|
108
|
+
execute(:contactDataSet, options)
|
109
|
+
end
|
110
|
+
|
111
|
+
# "ermittelt die Kontaktdaten des Kunden"
|
112
|
+
def contactDataGet(options={})
|
113
|
+
assert_valid_keys(options, :customerId)
|
114
|
+
assert_keys_exists(options, :customerId)
|
115
|
+
execute(:contactDataGet, options)
|
116
|
+
end
|
117
|
+
|
118
|
+
# "erzeugt einen neuen Bezahlvorgang"
|
119
|
+
# => "löst die Benachrichtigung sessionStatus mit dem Status "INIT" bzw. "REINIT" aus"
|
120
|
+
def sessionCreate(options={})
|
121
|
+
assert_valid_keys(options, :customerId, :sessionId, :project, :projectCampaign, :account, :webmasterCampaign, :amount, :currency, :title, :payText, :ip, :freeParams)
|
122
|
+
assert_keys_exists(options, :customerId, :project)
|
123
|
+
execute(:sessionCreate, options)
|
124
|
+
end
|
125
|
+
|
126
|
+
# "ordnet weitere freie Parameter der Session zu, oder ändert sie"
|
127
|
+
def sessionSet(options={})
|
128
|
+
assert_valid_keys(options, :sessionId, :freeParams)
|
129
|
+
assert_keys_exists(options, :sessionId)
|
130
|
+
execute(:sessionSet, options)
|
131
|
+
end
|
132
|
+
|
133
|
+
# "ermittelt Daten eines Bezahlvorgangs"
|
134
|
+
def sessionGet(options={})
|
135
|
+
assert_valid_keys(options, :sessionId)
|
136
|
+
assert_keys_exists(options, :sessionId)
|
137
|
+
execute(:sessionGet, options)
|
138
|
+
end
|
139
|
+
|
140
|
+
# "bestätigt den Lastschrifteinzug eines Vorgangs"
|
141
|
+
# => "löst die Benachrichtigung sessionStatus mit dem Status "APPROVED" aus"
|
142
|
+
def sessionApprove(options={})
|
143
|
+
assert_valid_keys(options, :sessionId)
|
144
|
+
assert_keys_exists(options, :sessionId)
|
145
|
+
execute(:sessionApprove, options)
|
146
|
+
end
|
147
|
+
|
148
|
+
# "übermittelt alle Bezahlvorgänge eines Kunden"
|
149
|
+
def sessionList(options={})
|
150
|
+
assert_valid_keys(options, :customerId)
|
151
|
+
assert_keys_exists(options, :customerId)
|
152
|
+
execute(:sessionList, options)
|
153
|
+
end
|
154
|
+
|
155
|
+
# "simuliert die Abbuchung für alle bestätigten Vorgänge"
|
156
|
+
# => "erzeugt für jede bestätigte Session eine neue Transaktion mit dem Typ 'BOOKING' und löst die Benachrichtigung transactionCreate aus"
|
157
|
+
# => "löst die Benachrichtigung sessionStatus mit dem Status 'CHARGED' aus"
|
158
|
+
def sessionChargeTest(options={})
|
159
|
+
execute(:sessionChargeTest, :testMode => 1)
|
160
|
+
end
|
161
|
+
|
162
|
+
# "simuliert Stornierung eines einzelnen Vorgangs"
|
163
|
+
# => "erzeugt eine neue Transaktion mit dem Typ "REVERSAL" und löst die Benachrichtigung transactionCreate aus"
|
164
|
+
# => "löst die Benachrichtigung sessionStatus mit dem Status "REVERSED" aus"
|
165
|
+
def sessionReverseTest(options={})
|
166
|
+
assert_valid_keys(options, :sessionId)
|
167
|
+
assert_keys_exists(options, :sessionId)
|
168
|
+
execute(:sessionReverseTest, options.merge(:testMode => 1))
|
169
|
+
end
|
170
|
+
|
171
|
+
# "simuliert die komplette Nachzahlung eines stornierten Vorgangs"
|
172
|
+
# => "erzeugt eine neue Transaktion mit dem Typ "BACKPAY" und löst die Benachrichtigung transactionCreate aus"
|
173
|
+
# => "löst die Benachrichtigung sessionStatus mit dem Status "RECHARGED" aus, wenn der gesamte offene Betrag beglichen wurde"
|
174
|
+
def sessionRechargeTest(options={})
|
175
|
+
assert_valid_keys(options, :sessionId, :amount)
|
176
|
+
assert_keys_exists(options, :sessionId)
|
177
|
+
execute(:sessionRechargeTest, options.merge(:testMode => 1))
|
178
|
+
end
|
179
|
+
|
180
|
+
# "Veranlasst eine (Teil-)Gutschrift und überweist sie zurück"
|
181
|
+
# => "erzeugt eine neue Transaktion mit dem Typ "REFUND" und löst die Benachrichtigung transactionCreate aus"
|
182
|
+
def sessionRefund(options={})
|
183
|
+
assert_valid_keys(options, :sessionId, :bankCode, :accountNumber, :accountHolder, :amount, :payText)
|
184
|
+
assert_keys_exists(options, :sessionId)
|
185
|
+
execute(:sessionRefund, options)
|
186
|
+
end
|
187
|
+
|
188
|
+
# "simuliert Stornierung der letzten Gutschrift,"
|
189
|
+
# => "erzeugt eine neue Transaktion mit dem Typ "REFUNDREVERSAL" und löst die Benachrichtigung transactionCreate aus"
|
190
|
+
def sessionRefundReverseTest(options={})
|
191
|
+
assert_valid_keys(options, :sessionId)
|
192
|
+
assert_keys_exists(options, :sessionId)
|
193
|
+
execute(:sessionRefundReverseTest, options.merge(:testMode => 1))
|
194
|
+
end
|
195
|
+
|
196
|
+
# "erstellt eine Transaktion vom Typ "EXTERNAL""
|
197
|
+
# => "löst die Benachrichtigung transactionCreate aus"
|
198
|
+
def transactionCreate(options={})
|
199
|
+
assert_valid_keys(options, :sessionId, :date, :amount, :description)
|
200
|
+
assert_keys_exists(options, :sessionId, :amount)
|
201
|
+
execute(:transactionCreate, options)
|
202
|
+
end
|
203
|
+
|
204
|
+
# "ermittelt alle Transaktionen für einen Bezahlvorgang"
|
205
|
+
def transactionList(options={})
|
206
|
+
assert_valid_keys(options, :sessionId)
|
207
|
+
assert_keys_exists(options, :sessionId)
|
208
|
+
execute(:transactionList, options)
|
209
|
+
end
|
210
|
+
|
211
|
+
# "ermittelt Daten einer Transaktion"
|
212
|
+
def transactionGet(options={})
|
213
|
+
assert_valid_keys(options, :transactionId)
|
214
|
+
assert_keys_exists(options, :transactionId)
|
215
|
+
execute(:transactionGet, options)
|
216
|
+
end
|
217
|
+
|
218
|
+
end
|
219
|
+
|
220
|
+
end
|
221
|
+
end
|
@@ -0,0 +1,72 @@
|
|
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 = "micropayment"
|
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 = ["Jan Schwenzien"]
|
12
|
+
s.date = "2012-05-19"
|
13
|
+
s.description = "Implements the NameValuePair API provided by micropayment.de"
|
14
|
+
s.email = "jan@general-scripting.com"
|
15
|
+
s.extra_rdoc_files = [
|
16
|
+
"LICENSE.txt",
|
17
|
+
"README.markdown"
|
18
|
+
]
|
19
|
+
s.files = [
|
20
|
+
".document",
|
21
|
+
".rvmrc",
|
22
|
+
"Gemfile",
|
23
|
+
"Gemfile.lock",
|
24
|
+
"LICENSE.txt",
|
25
|
+
"README.markdown",
|
26
|
+
"Rakefile",
|
27
|
+
"VERSION",
|
28
|
+
"lib/micropayment.rb",
|
29
|
+
"lib/services/api.rb",
|
30
|
+
"lib/services/config.rb",
|
31
|
+
"lib/services/debit.rb",
|
32
|
+
"micropayment.gemspec",
|
33
|
+
"test/helper.rb",
|
34
|
+
"test/test_micropayment.rb"
|
35
|
+
]
|
36
|
+
s.homepage = "http://github.com/GeneralScripting/micropayment"
|
37
|
+
s.licenses = ["MIT"]
|
38
|
+
s.require_paths = ["lib"]
|
39
|
+
s.rubygems_version = "1.8.23"
|
40
|
+
s.summary = "NVP API implementation for micropayment.de"
|
41
|
+
|
42
|
+
if s.respond_to? :specification_version then
|
43
|
+
s.specification_version = 3
|
44
|
+
|
45
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
46
|
+
s.add_runtime_dependency(%q<addressable>, [">= 0"])
|
47
|
+
s.add_runtime_dependency(%q<yajl-ruby>, [">= 0"])
|
48
|
+
s.add_development_dependency(%q<shoulda>, [">= 0"])
|
49
|
+
s.add_development_dependency(%q<rdoc>, ["~> 3.12"])
|
50
|
+
s.add_development_dependency(%q<bundler>, ["~> 1.1.0"])
|
51
|
+
s.add_development_dependency(%q<jeweler>, ["~> 1.8.3"])
|
52
|
+
s.add_development_dependency(%q<rcov>, [">= 0"])
|
53
|
+
else
|
54
|
+
s.add_dependency(%q<addressable>, [">= 0"])
|
55
|
+
s.add_dependency(%q<yajl-ruby>, [">= 0"])
|
56
|
+
s.add_dependency(%q<shoulda>, [">= 0"])
|
57
|
+
s.add_dependency(%q<rdoc>, ["~> 3.12"])
|
58
|
+
s.add_dependency(%q<bundler>, ["~> 1.1.0"])
|
59
|
+
s.add_dependency(%q<jeweler>, ["~> 1.8.3"])
|
60
|
+
s.add_dependency(%q<rcov>, [">= 0"])
|
61
|
+
end
|
62
|
+
else
|
63
|
+
s.add_dependency(%q<addressable>, [">= 0"])
|
64
|
+
s.add_dependency(%q<yajl-ruby>, [">= 0"])
|
65
|
+
s.add_dependency(%q<shoulda>, [">= 0"])
|
66
|
+
s.add_dependency(%q<rdoc>, ["~> 3.12"])
|
67
|
+
s.add_dependency(%q<bundler>, ["~> 1.1.0"])
|
68
|
+
s.add_dependency(%q<jeweler>, ["~> 1.8.3"])
|
69
|
+
s.add_dependency(%q<rcov>, [">= 0"])
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
data/test/helper.rb
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'bundler'
|
3
|
+
begin
|
4
|
+
Bundler.setup(:default, :development)
|
5
|
+
rescue Bundler::BundlerError => e
|
6
|
+
$stderr.puts e.message
|
7
|
+
$stderr.puts "Run `bundle install` to install missing gems"
|
8
|
+
exit e.status_code
|
9
|
+
end
|
10
|
+
require 'test/unit'
|
11
|
+
require 'shoulda'
|
12
|
+
|
13
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
14
|
+
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
15
|
+
require 'micropayment'
|
16
|
+
|
17
|
+
class Test::Unit::TestCase
|
18
|
+
end
|
metadata
ADDED
@@ -0,0 +1,182 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: micropayment
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 25
|
5
|
+
prerelease:
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 1
|
9
|
+
- 1
|
10
|
+
version: 0.1.1
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- Jan Schwenzien
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain: []
|
17
|
+
|
18
|
+
date: 2012-05-19 00:00:00 Z
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
21
|
+
type: :runtime
|
22
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
23
|
+
none: false
|
24
|
+
requirements:
|
25
|
+
- - ">="
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
hash: 3
|
28
|
+
segments:
|
29
|
+
- 0
|
30
|
+
version: "0"
|
31
|
+
version_requirements: *id001
|
32
|
+
name: addressable
|
33
|
+
prerelease: false
|
34
|
+
- !ruby/object:Gem::Dependency
|
35
|
+
type: :runtime
|
36
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
37
|
+
none: false
|
38
|
+
requirements:
|
39
|
+
- - ">="
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
hash: 3
|
42
|
+
segments:
|
43
|
+
- 0
|
44
|
+
version: "0"
|
45
|
+
version_requirements: *id002
|
46
|
+
name: yajl-ruby
|
47
|
+
prerelease: false
|
48
|
+
- !ruby/object:Gem::Dependency
|
49
|
+
type: :development
|
50
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
51
|
+
none: false
|
52
|
+
requirements:
|
53
|
+
- - ">="
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
hash: 3
|
56
|
+
segments:
|
57
|
+
- 0
|
58
|
+
version: "0"
|
59
|
+
version_requirements: *id003
|
60
|
+
name: shoulda
|
61
|
+
prerelease: false
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
type: :development
|
64
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
66
|
+
requirements:
|
67
|
+
- - ~>
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
hash: 31
|
70
|
+
segments:
|
71
|
+
- 3
|
72
|
+
- 12
|
73
|
+
version: "3.12"
|
74
|
+
version_requirements: *id004
|
75
|
+
name: rdoc
|
76
|
+
prerelease: false
|
77
|
+
- !ruby/object:Gem::Dependency
|
78
|
+
type: :development
|
79
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
80
|
+
none: false
|
81
|
+
requirements:
|
82
|
+
- - ~>
|
83
|
+
- !ruby/object:Gem::Version
|
84
|
+
hash: 19
|
85
|
+
segments:
|
86
|
+
- 1
|
87
|
+
- 1
|
88
|
+
- 0
|
89
|
+
version: 1.1.0
|
90
|
+
version_requirements: *id005
|
91
|
+
name: bundler
|
92
|
+
prerelease: false
|
93
|
+
- !ruby/object:Gem::Dependency
|
94
|
+
type: :development
|
95
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
96
|
+
none: false
|
97
|
+
requirements:
|
98
|
+
- - ~>
|
99
|
+
- !ruby/object:Gem::Version
|
100
|
+
hash: 49
|
101
|
+
segments:
|
102
|
+
- 1
|
103
|
+
- 8
|
104
|
+
- 3
|
105
|
+
version: 1.8.3
|
106
|
+
version_requirements: *id006
|
107
|
+
name: jeweler
|
108
|
+
prerelease: false
|
109
|
+
- !ruby/object:Gem::Dependency
|
110
|
+
type: :development
|
111
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
112
|
+
none: false
|
113
|
+
requirements:
|
114
|
+
- - ">="
|
115
|
+
- !ruby/object:Gem::Version
|
116
|
+
hash: 3
|
117
|
+
segments:
|
118
|
+
- 0
|
119
|
+
version: "0"
|
120
|
+
version_requirements: *id007
|
121
|
+
name: rcov
|
122
|
+
prerelease: false
|
123
|
+
description: Implements the NameValuePair API provided by micropayment.de
|
124
|
+
email: jan@general-scripting.com
|
125
|
+
executables: []
|
126
|
+
|
127
|
+
extensions: []
|
128
|
+
|
129
|
+
extra_rdoc_files:
|
130
|
+
- LICENSE.txt
|
131
|
+
- README.markdown
|
132
|
+
files:
|
133
|
+
- .document
|
134
|
+
- .rvmrc
|
135
|
+
- Gemfile
|
136
|
+
- Gemfile.lock
|
137
|
+
- LICENSE.txt
|
138
|
+
- README.markdown
|
139
|
+
- Rakefile
|
140
|
+
- VERSION
|
141
|
+
- lib/micropayment.rb
|
142
|
+
- lib/services/api.rb
|
143
|
+
- lib/services/config.rb
|
144
|
+
- lib/services/debit.rb
|
145
|
+
- micropayment.gemspec
|
146
|
+
- test/helper.rb
|
147
|
+
- test/test_micropayment.rb
|
148
|
+
homepage: http://github.com/GeneralScripting/micropayment
|
149
|
+
licenses:
|
150
|
+
- MIT
|
151
|
+
post_install_message:
|
152
|
+
rdoc_options: []
|
153
|
+
|
154
|
+
require_paths:
|
155
|
+
- lib
|
156
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
157
|
+
none: false
|
158
|
+
requirements:
|
159
|
+
- - ">="
|
160
|
+
- !ruby/object:Gem::Version
|
161
|
+
hash: 3
|
162
|
+
segments:
|
163
|
+
- 0
|
164
|
+
version: "0"
|
165
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
166
|
+
none: false
|
167
|
+
requirements:
|
168
|
+
- - ">="
|
169
|
+
- !ruby/object:Gem::Version
|
170
|
+
hash: 3
|
171
|
+
segments:
|
172
|
+
- 0
|
173
|
+
version: "0"
|
174
|
+
requirements: []
|
175
|
+
|
176
|
+
rubyforge_project:
|
177
|
+
rubygems_version: 1.8.23
|
178
|
+
signing_key:
|
179
|
+
specification_version: 3
|
180
|
+
summary: NVP API implementation for micropayment.de
|
181
|
+
test_files: []
|
182
|
+
|