hbci4jruby-web 0.0.2 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b3162101d969561f79756ba34d0861bd1a5cbec6
4
- data.tar.gz: f3b2562ea689890732dfc3d4e6bf5a3f9775e1df
3
+ metadata.gz: bd2148d352c9dd6342722350bee271f495862e5c
4
+ data.tar.gz: 4ea42e6923dd952d8e7d9504a134a6431748b2bb
5
5
  SHA512:
6
- metadata.gz: c20ffed253267a005f16625d6fdce5b3c3e0da475ae34272def3e2fae1c2181431c687951fc85d274aa699a04b4454e7c2abda5392d9850b491ff5b3c8c81037
7
- data.tar.gz: fdb39c40b46a8b14d5843f5a3eab5d5f08314347698565700551ac32dad4cf62d9b335dfd1b5e8f9efe98bcbe338948a61fd62a74b9b4782a5c53042498d4c9a
6
+ metadata.gz: 02fa38ba17f6c1068b5e012a2d0e0d7b5ee0c749157c141e24fb6d373f301ae7c7e4f4f8c0ed9bb3761d4f04ac3026b245ba73d6c3d6b4c8f66a3b8967bfb772
7
+ data.tar.gz: 95df93c7c8b1e14f31a1d8ae84b13976b69b82eead391f91e4474987569e5f06fc021d2e008eebfaad1eb91eb31388f23c0e9d150afa4d4a7b1f33edeb9e9e3e
@@ -3,7 +3,13 @@ require File.join(File.dirname(__FILE__), '..', 'web')
3
3
  module Hbci4jruby
4
4
  module Web
5
5
  class App < ::Sinatra::Base
6
- use Hbci4jruby::Web::Turnover
6
+ use Hbci4jruby::Web::Turnovers
7
+
8
+ set :public_folder, File.join(File.dirname(__FILE__), '..', '..', '..', 'public')
9
+
10
+ get '/' do
11
+ send_file File.join(settings.public_folder, 'index.html')
12
+ end
7
13
 
8
14
  run! if app_file == $0
9
15
  end
@@ -1,7 +1,7 @@
1
1
  module Hbci4jruby
2
2
  module Web
3
- class Turnover < ::Sinatra::Base
4
- get('/turnover') do
3
+ class Turnovers < ::Sinatra::Base
4
+ post('/turnovers') do
5
5
  begin
6
6
  data = ::JSON.parse request.body.read
7
7
  halt 'Please provide banking_passport' unless data["banking_passport"]
@@ -1,5 +1,5 @@
1
1
  module Hbci4jruby
2
2
  module Web
3
- VERSION = "0.0.2"
3
+ VERSION = "0.1.0"
4
4
  end
5
5
  end
@@ -3,4 +3,4 @@ require 'sinatra/base'
3
3
  require 'json'
4
4
 
5
5
  require File.join(File.dirname(__FILE__), 'web', 'version')
6
- require File.join(File.dirname(__FILE__), 'web', 'turnover')
6
+ require File.join(File.dirname(__FILE__), 'web', 'turnovers')
data/public/index.html ADDED
@@ -0,0 +1,111 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>HBCI Verify</title>
5
+ <style type="text/css">
6
+ * {
7
+ line-height: 1.5em;
8
+ font-family: Courier, Arial;
9
+ }
10
+ label {
11
+ width: 300px;
12
+ display: inline-block;
13
+ }
14
+ input {
15
+ width: 300px;
16
+ display: inline-block;
17
+ }
18
+ li {
19
+ font-size: 0.8em;
20
+ color: #666;
21
+ }
22
+ </style>
23
+ <script src="https://code.jquery.com/jquery-2.1.3.min.js"></script>
24
+ <script>
25
+ $(document).ready(function(){
26
+ $('form').submit(function(ev){
27
+ var values = $(this).serializeArray(),
28
+ data = {};
29
+ values.forEach(function(obj){
30
+ data[obj.name] = obj.value;
31
+ });
32
+ $.ajax({
33
+ method: 'post',
34
+ url: location.origin+'/turnovers',
35
+ data: JSON.stringify({
36
+ start_date: (new Date()).getFullYear()-1,
37
+ end_date: (new Date()).getFullYear(),
38
+ banking_passport: data
39
+ }),
40
+ dataType: 'json',
41
+ contentType: 'application/json; charset=utf-8',
42
+ complete: function(res){
43
+ renderTurnovers(res.responseJSON)
44
+ }
45
+ });
46
+ ev.preventDefault();
47
+ });
48
+ });
49
+
50
+ function renderTurnovers(turnoversRaw, error) {
51
+ var rows = [];
52
+ if (turnoversRaw) {
53
+ turnoversRaw.forEach(function(turnoverRaw){
54
+ rows.push('<li>'+turnoverRaw+'</li>');
55
+ });
56
+ $('ul').html(rows.join("\n"));
57
+ } else {
58
+ $('ul').html('<li>Error</li>')
59
+ }
60
+ }
61
+ </script>
62
+ </head>
63
+ <body>
64
+ <form>
65
+ <label>hbci_version</label>
66
+ <input type="text" name="hbci_version" value="300" />
67
+ <br/>
68
+
69
+ <label>host</label>
70
+ <input type="text" name="host" value="fints.comdirect.de/fint" />
71
+ <br/>
72
+
73
+ <label>port</label>
74
+ <input type="text" name="port" value="443" />
75
+ <br/>
76
+
77
+ <label>filter</label>
78
+ <input type="text" name="filter" value="Base64" />
79
+ <br/>
80
+
81
+ <label>country_code</label>
82
+ <input type="text" name="country_code" value="DE" />
83
+ <br/>
84
+
85
+ <label>bank_number (BLZ)</label>
86
+ <input type="text" name="bank_number" value="" />
87
+ <br/>
88
+
89
+ <label>customer_id (Login)</label>
90
+ <input type="text" name="customer_id" value="" />
91
+ <br/>
92
+
93
+ <label>user_id (Login)</label>
94
+ <input type="text" name="user_id" value="" />
95
+ <br/>
96
+
97
+ <label>account_number (Konto)</label>
98
+ <input type="text" name="account_number" value="" />
99
+ <br/>
100
+
101
+ <label>pin</label>
102
+ <input type="text" name="pin" value="" />
103
+ <br/>
104
+
105
+ <label></label>
106
+ <input type="submit" value="Verify" />
107
+ <br/>
108
+ </form>
109
+ <ul><ul>
110
+ </body>
111
+ </html>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hbci4jruby-web
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jens Bissinger
@@ -98,8 +98,9 @@ files:
98
98
  - lib/hbci4jruby/web.rb
99
99
  - lib/hbci4jruby/web/app.rb
100
100
  - lib/hbci4jruby/web/config.ru
101
- - lib/hbci4jruby/web/turnover.rb
101
+ - lib/hbci4jruby/web/turnovers.rb
102
102
  - lib/hbci4jruby/web/version.rb
103
+ - public/index.html
103
104
  homepage: ''
104
105
  licenses:
105
106
  - MIT