aq_banking 0.2.4 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/.travis.yml +0 -1
- data/Dockerfile +4 -1
- data/README.md +7 -25
- data/aq_banking.gemspec +1 -0
- data/lib/aq_banking.rb +1 -0
- data/lib/aq_banking/cli.rb +9 -1
- data/lib/aq_banking/commander.rb +2 -2
- data/lib/aq_banking/parsed/account.rb +5 -1
- data/lib/aq_banking/parsed/transaction.rb +7 -1
- data/lib/aq_banking/version.rb +1 -1
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 609175a7c3cc48f8fd363bef763738f608c8cb94
|
4
|
+
data.tar.gz: 5a77dc9be4047aeecdb885a7336eba78619f963c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1a3c37599be9fc428c46d7c0914c47d8b4f45d0d8f60fe85ba115ce1f75656061a75f59f3df4c1011ae57bfc5c3ceea6cdeee0b47f21a173be083b09a43e336f
|
7
|
+
data.tar.gz: d3af01a507153d2e26417d66706fbc00ea054a187a836a4aa750a73d03ade9e78cfa511c32f2be808d23d6b517ff154ab4dafaf504371dd524124ad064765fc7
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
ruby-2.3
|
1
|
+
ruby-2.3.1
|
data/.travis.yml
CHANGED
data/Dockerfile
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
FROM ruby:2.3.
|
1
|
+
FROM ruby:2.3.1
|
2
2
|
MAINTAINER Robin Wenglewski, robin@wenglewski.de
|
3
3
|
|
4
4
|
RUN apt-get update -qq && apt-get install -y \
|
@@ -6,6 +6,9 @@ RUN apt-get update -qq && apt-get install -y \
|
|
6
6
|
aqbanking-tools \
|
7
7
|
ktoblzcheck
|
8
8
|
|
9
|
+
WORKDIR /gem
|
10
|
+
|
11
|
+
COPY ./pkg /gem
|
9
12
|
RUN gem install aq_banking
|
10
13
|
|
11
14
|
ENTRYPOINT ["aq_banking"]
|
data/README.md
CHANGED
@@ -9,31 +9,10 @@ Sample:
|
|
9
9
|
|
10
10
|
```bash
|
11
11
|
$ aq_banking request --bank=diba BLZ ACCCOUNT_NUMBER LOGIN_ID PASSWORD --from=2016-04-18
|
12
|
-
{
|
13
|
-
"iban": "...",
|
14
|
-
"bic": "...",
|
15
|
-
"owner": "WENGLEWSKI, ROBIN",
|
16
|
-
"currency": "EUR",
|
17
|
-
"bank_code": "...",
|
18
|
-
"bank_name": "ING-DiBa",
|
19
|
-
"booked_balance": 123.45,
|
20
|
-
"noted_balance": 123.45,
|
21
|
-
"number": "...",
|
22
|
-
"name": "Girokonto",
|
23
|
-
"transactions": [
|
24
|
-
{
|
25
|
-
"amount": -22.0,
|
26
|
-
"currency": "EUR",
|
27
|
-
"date": "2016-04-18 12:00:00 UTC",
|
28
|
-
"valuta_date": "2016-04-18 12:00:00 UTC"
|
29
|
-
...
|
30
|
-
},
|
31
|
-
...
|
32
|
-
],
|
33
|
-
...
|
34
|
-
}
|
35
12
|
```
|
36
13
|
|
14
|
+
See (transaction.txt.json)[./spec/fixtures/transaction.txt.json] for a sample response.
|
15
|
+
|
37
16
|
It still requires the aq_banking command line tools (aqhbci-tool4, aqbanking-cli) to be present.
|
38
17
|
To my experience, these tools are very unstable and full of bugs.
|
39
18
|
This tool is developed using a specific version which ships with the docker image.
|
@@ -75,8 +54,11 @@ And then execute:
|
|
75
54
|
|
76
55
|
## Release
|
77
56
|
|
78
|
-
# publish gem
|
79
|
-
rake release
|
57
|
+
# publish gem
|
58
|
+
rake release
|
59
|
+
|
60
|
+
# publish docker
|
61
|
+
rake build && docker-compose build gem && docker push rweng/aq_banking
|
80
62
|
|
81
63
|
|
82
64
|
# Contributing
|
data/aq_banking.gemspec
CHANGED
@@ -21,6 +21,7 @@ Gem::Specification.new do |spec|
|
|
21
21
|
spec.add_dependency "treetop"
|
22
22
|
spec.add_dependency "activesupport"
|
23
23
|
spec.add_dependency "highline", "~> 1.7.8"
|
24
|
+
spec.add_dependency 'awrence'
|
24
25
|
|
25
26
|
spec.add_development_dependency "bundler", "~> 1.10"
|
26
27
|
spec.add_development_dependency "rake", "~> 10.0"
|
data/lib/aq_banking.rb
CHANGED
data/lib/aq_banking/cli.rb
CHANGED
@@ -15,6 +15,7 @@ module AqBanking
|
|
15
15
|
option :hbci_version
|
16
16
|
option :from, banner: 'FROM - e.g. 2016-01-01'
|
17
17
|
option :to, banner: 'TO - e.g. 2016-01-01'
|
18
|
+
option :format, default: 'json', banner: 'choose from: raw | json'
|
18
19
|
desc 'request BANK_CODE ACCOUNT_NUMBER USER_ID PASSWORD', 'requests balance and transactions for an account. you must either specify --bank= or (--server-url and maybe --hbci-version)'
|
19
20
|
def request(bank_code, account_number, user_id, password)
|
20
21
|
request_options = {
|
@@ -33,7 +34,14 @@ module AqBanking
|
|
33
34
|
response = commander.send_request!(request_options)
|
34
35
|
account = parser.parse_account_list(response).first
|
35
36
|
|
36
|
-
|
37
|
+
case options[:format]
|
38
|
+
when 'json'
|
39
|
+
puts account.to_json
|
40
|
+
when 'raw'
|
41
|
+
puts account.to_raw
|
42
|
+
else
|
43
|
+
puts 'unknown format'
|
44
|
+
end
|
37
45
|
end
|
38
46
|
|
39
47
|
desc 'list_banks', 'shows valid values for the --bank flag'
|
data/lib/aq_banking/commander.rb
CHANGED
@@ -98,7 +98,7 @@ module AqBanking
|
|
98
98
|
loop do
|
99
99
|
count = count + 1
|
100
100
|
result = run "aqhbci-tool4 deluser --with-accounts -u %p -b %p" % [user_id, bank_code]
|
101
|
-
break if result.stderr.include? 'ERROR: No matching users'
|
101
|
+
break if result.success? or result.stderr.include? 'ERROR: No matching users'
|
102
102
|
|
103
103
|
raise 'could not delete user' if count >= max_trials
|
104
104
|
end
|
@@ -122,7 +122,7 @@ module AqBanking
|
|
122
122
|
|
123
123
|
cmd = "#{aq_hbci} -P #{pin_file} getsysid -u #{user_id} -b #{bank_code}"
|
124
124
|
|
125
|
-
run_or_raise(cmd, 'Could not get sysid. This might be because the userId or password is wrong
|
125
|
+
run_or_raise(cmd, 'Could not get sysid. This might be because the bank_code, userId or password is wrong, or internet banking is not active. Check if you can log into your internet banking w/ these credentials.')
|
126
126
|
end
|
127
127
|
|
128
128
|
private
|
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'digest'
|
2
|
+
|
1
3
|
module AqBanking::Parsed
|
2
4
|
class Transaction
|
3
5
|
extend DefineField
|
@@ -15,8 +17,12 @@ module AqBanking::Parsed
|
|
15
17
|
@tree = transaction_block
|
16
18
|
end
|
17
19
|
|
20
|
+
def uid
|
21
|
+
Digest::SHA256.hexdigest self.tree.text_value
|
22
|
+
end
|
23
|
+
|
18
24
|
def to_h
|
19
|
-
%i(local_bank_code local_account_number local_name remote_bank_code remote_account_number remote_name
|
25
|
+
%i(uid purpose local_bank_code local_account_number local_name remote_bank_code remote_account_number remote_name
|
20
26
|
currency amount date valuta_date).reduce({}) do |result, field|
|
21
27
|
result[field] = send(field)
|
22
28
|
result
|
data/lib/aq_banking/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aq_banking
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robin Wenglewski
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-09-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -66,6 +66,20 @@ dependencies:
|
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: 1.7.8
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: awrence
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
69
83
|
- !ruby/object:Gem::Dependency
|
70
84
|
name: bundler
|
71
85
|
requirement: !ruby/object:Gem::Requirement
|