hbci4jruby-web 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: b3162101d969561f79756ba34d0861bd1a5cbec6
4
+ data.tar.gz: f3b2562ea689890732dfc3d4e6bf5a3f9775e1df
5
+ SHA512:
6
+ metadata.gz: c20ffed253267a005f16625d6fdce5b3c3e0da475ae34272def3e2fae1c2181431c687951fc85d274aa699a04b4454e7c2abda5392d9850b491ff5b3c8c81037
7
+ data.tar.gz: fdb39c40b46a8b14d5843f5a3eab5d5f08314347698565700551ac32dad4cf62d9b335dfd1b5e8f9efe98bcbe338948a61fd62a74b9b4782a5c53042498d4c9a
data/.gitignore ADDED
@@ -0,0 +1,15 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ *.bundle
11
+ *.so
12
+ *.o
13
+ *.a
14
+ mkmf.log
15
+ pintan.dat
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ jruby
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in hbci4jruby-web.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2015 Jens Bissinger
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,31 @@
1
+ # Hbci4jruby::Web
2
+
3
+ TODO: Write a gem description
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'hbci4jruby-web'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install hbci4jruby-web
20
+
21
+ ## Usage
22
+
23
+ TODO: Write usage instructions here
24
+
25
+ ## Contributing
26
+
27
+ 1. Fork it ( https://github.com/[my-github-username]/hbci4jruby-web/fork )
28
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
29
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
30
+ 4. Push to the branch (`git push origin my-new-feature`)
31
+ 5. Create a new Pull Request
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+
@@ -0,0 +1,23 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'httparty'
4
+ response = HTTParty.get('http://localhost:4567/turnover', {
5
+ :body => {
6
+ "start_date" => 2013,
7
+ "end_date" => 2015,
8
+ "banking_passport" => {
9
+ "hbci_version" => "300",
10
+ "host" => "fints.comdirect.de/fints",
11
+ "port" => "443",
12
+ "filter" => "Base64",
13
+ "country_code" => "DE",
14
+ "bank_number" => "xx",
15
+ "customer_id" => "xx",
16
+ "user_id" => "xx",
17
+ "account_number" => "xx",
18
+ "pin" => "xx"
19
+ }
20
+ }.to_json,
21
+ :headers => { 'Content-Type' => 'application/json' }
22
+ })
23
+ puts response.body
@@ -0,0 +1,27 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'hbci4jruby/web/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "hbci4jruby-web"
8
+ spec.version = Hbci4jruby::Web::VERSION
9
+ spec.authors = ["Jens Bissinger"]
10
+ spec.email = ["mail@jens-bissinger.de"]
11
+ spec.summary = %q{HBCI4JRuby-Web provides a HTTP API to do HBCI/FinTS requests.}
12
+ spec.description = %q{HBCI4JRuby-Web provides a HTTP API to do HBCI/FinTS requests.}
13
+ spec.homepage = ""
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files -z`.split("\x0")
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_development_dependency "bundler", "~> 1.7"
22
+ spec.add_development_dependency "rake", "~> 10.0"
23
+ spec.add_development_dependency "httparty", "~> 0.13"
24
+
25
+ spec.add_dependency "sinatra", "~> 1.4"
26
+ spec.add_dependency "hbci4jruby", "~> 0.1"
27
+ end
@@ -0,0 +1,11 @@
1
+ require File.join(File.dirname(__FILE__), '..', 'web')
2
+
3
+ module Hbci4jruby
4
+ module Web
5
+ class App < ::Sinatra::Base
6
+ use Hbci4jruby::Web::Turnover
7
+
8
+ run! if app_file == $0
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,2 @@
1
+ require File.join(File.dirname(__FILE__), 'app')
2
+ run Hbci4jruby::Web::App
@@ -0,0 +1,28 @@
1
+ module Hbci4jruby
2
+ module Web
3
+ class Turnover < ::Sinatra::Base
4
+ get('/turnover') do
5
+ begin
6
+ data = ::JSON.parse request.body.read
7
+ halt 'Please provide banking_passport' unless data["banking_passport"]
8
+ halt 'Please provide start_date' unless data["start_date"]
9
+ halt 'Please provide end_date' unless data["end_date"]
10
+ banking_passport = Hbci4jruby::BankingPassport.new
11
+ banking_passport.attributes = data["banking_passport"]
12
+ turnover = Hbci4jruby::Turnover.new
13
+ result = turnover.list(banking_passport, {
14
+ 'start_date' => Time.new(data["start_date"]),
15
+ 'end_date' => Time.new(data["end_date"])
16
+ })
17
+ JSON.dump(result)
18
+ rescue => e
19
+ error = {
20
+ :message => e.message,
21
+ :inspect => e.inspect
22
+ }
23
+ halt error.to_json
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,5 @@
1
+ module Hbci4jruby
2
+ module Web
3
+ VERSION = "0.0.2"
4
+ end
5
+ end
@@ -0,0 +1,6 @@
1
+ require 'hbci4jruby'
2
+ require 'sinatra/base'
3
+ require 'json'
4
+
5
+ require File.join(File.dirname(__FILE__), 'web', 'version')
6
+ require File.join(File.dirname(__FILE__), 'web', 'turnover')
metadata ADDED
@@ -0,0 +1,127 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: hbci4jruby-web
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.2
5
+ platform: ruby
6
+ authors:
7
+ - Jens Bissinger
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-01-06 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - ~>
17
+ - !ruby/object:Gem::Version
18
+ version: '1.7'
19
+ name: bundler
20
+ prerelease: false
21
+ type: :development
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '1.7'
27
+ - !ruby/object:Gem::Dependency
28
+ requirement: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - ~>
31
+ - !ruby/object:Gem::Version
32
+ version: '10.0'
33
+ name: rake
34
+ prerelease: false
35
+ type: :development
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ~>
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ requirement: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - ~>
45
+ - !ruby/object:Gem::Version
46
+ version: '0.13'
47
+ name: httparty
48
+ prerelease: false
49
+ type: :development
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ~>
53
+ - !ruby/object:Gem::Version
54
+ version: '0.13'
55
+ - !ruby/object:Gem::Dependency
56
+ requirement: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - ~>
59
+ - !ruby/object:Gem::Version
60
+ version: '1.4'
61
+ name: sinatra
62
+ prerelease: false
63
+ type: :runtime
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ~>
67
+ - !ruby/object:Gem::Version
68
+ version: '1.4'
69
+ - !ruby/object:Gem::Dependency
70
+ requirement: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - ~>
73
+ - !ruby/object:Gem::Version
74
+ version: '0.1'
75
+ name: hbci4jruby
76
+ prerelease: false
77
+ type: :runtime
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ~>
81
+ - !ruby/object:Gem::Version
82
+ version: '0.1'
83
+ description: HBCI4JRuby-Web provides a HTTP API to do HBCI/FinTS requests.
84
+ email:
85
+ - mail@jens-bissinger.de
86
+ executables: []
87
+ extensions: []
88
+ extra_rdoc_files: []
89
+ files:
90
+ - .gitignore
91
+ - .ruby-version
92
+ - Gemfile
93
+ - LICENSE.txt
94
+ - README.md
95
+ - Rakefile
96
+ - examples/turnover.rb
97
+ - hbci4jruby-web.gemspec
98
+ - lib/hbci4jruby/web.rb
99
+ - lib/hbci4jruby/web/app.rb
100
+ - lib/hbci4jruby/web/config.ru
101
+ - lib/hbci4jruby/web/turnover.rb
102
+ - lib/hbci4jruby/web/version.rb
103
+ homepage: ''
104
+ licenses:
105
+ - MIT
106
+ metadata: {}
107
+ post_install_message:
108
+ rdoc_options: []
109
+ require_paths:
110
+ - lib
111
+ required_ruby_version: !ruby/object:Gem::Requirement
112
+ requirements:
113
+ - - '>='
114
+ - !ruby/object:Gem::Version
115
+ version: '0'
116
+ required_rubygems_version: !ruby/object:Gem::Requirement
117
+ requirements:
118
+ - - '>='
119
+ - !ruby/object:Gem::Version
120
+ version: '0'
121
+ requirements: []
122
+ rubyforge_project:
123
+ rubygems_version: 2.1.9
124
+ signing_key:
125
+ specification_version: 4
126
+ summary: HBCI4JRuby-Web provides a HTTP API to do HBCI/FinTS requests.
127
+ test_files: []