aq_banking 0.2.3 → 0.2.4
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.
- checksums.yaml +4 -4
- data/README.md +4 -2
- data/lib/aq_banking/commander.rb +16 -5
- data/lib/aq_banking/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 70d0bb8ab7a557647a25a06b7a73765cab0270ad
|
4
|
+
data.tar.gz: 378949a71c9fe792ce46a6211f263abc5d97b1b9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c70c690ba8abaaf78102c6f8d60f7007d8d02ac0fa7adb3b84f76bd2b0445850b9fa50cbfb5e665ef3ef2f1067740a5329edbf16be9f4d7a65fde00491bd474c
|
7
|
+
data.tar.gz: 39ece253a7a92c3aaca0800e28a738204ac745e0a1df9fea4ad894b14b7cd54e433505251e7b61a044f791be9dd612f2ceeadf60f0e4d745c7384ff642aaf485
|
data/README.md
CHANGED
@@ -34,8 +34,10 @@ $ aq_banking request --bank=diba BLZ ACCCOUNT_NUMBER LOGIN_ID PASSWORD --from=20
|
|
34
34
|
}
|
35
35
|
```
|
36
36
|
|
37
|
-
It still requires the aq_banking command line tools to be present.
|
38
|
-
To
|
37
|
+
It still requires the aq_banking command line tools (aqhbci-tool4, aqbanking-cli) to be present.
|
38
|
+
To my experience, these tools are very unstable and full of bugs.
|
39
|
+
This tool is developed using a specific version which ships with the docker image.
|
40
|
+
To avoid errors with different versions, I recommend using the docker image:
|
39
41
|
|
40
42
|
docker run -it --rm rweng/aq_banking --help
|
41
43
|
docker run -it --rm rweng/aq_banking request --bank=diba BLZ ACCCOUNT_NUMBER LOGIN_ID PASSWORD --from=2016-04-18
|
data/lib/aq_banking/commander.rb
CHANGED
@@ -56,8 +56,8 @@ module AqBanking
|
|
56
56
|
# ensure that no old password is in cache
|
57
57
|
remove_user bank_code: bank_code, user_id: user_id
|
58
58
|
|
59
|
-
|
60
|
-
|
59
|
+
add_user(server_url: server_url, hbci_version: hbci_version,
|
60
|
+
bank_code: bank_code, user_id: user_id, user_name: user_name)
|
61
61
|
|
62
62
|
call_getsysid pin_file: pin_file_path, user_id: user_id, bank_code: bank_code
|
63
63
|
|
@@ -77,7 +77,7 @@ module AqBanking
|
|
77
77
|
# @param [String] bank_code
|
78
78
|
# @param [String] user_id
|
79
79
|
# @return [Boolean]
|
80
|
-
def
|
80
|
+
def user_exists?(bank_code:, user_id:)
|
81
81
|
result = run "aqhbci-tool4 listusers"
|
82
82
|
result.stdout.include?("Bank: de/#{bank_code} User Id: #{user_id}")
|
83
83
|
end
|
@@ -90,10 +90,21 @@ module AqBanking
|
|
90
90
|
def remove_user(bank_code:, user_id:)
|
91
91
|
logger.debug 'removing user %p' % {bank_code: bank_code, user_id: user_id}
|
92
92
|
|
93
|
-
|
93
|
+
# we must do this due to frickin aqhbci: the option --with-acccounts removes one account and if there are more
|
94
|
+
# an error is raised. on the other hand, aqhbci-tool4 listaccounts only shows bank_code and account number, but not
|
95
|
+
# user id. Refactorings to improve this are very welcome
|
96
|
+
count = 0
|
97
|
+
max_trials = 10
|
98
|
+
loop do
|
99
|
+
count = count + 1
|
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' or result.stdout.match /User %d+ deleted\./
|
102
|
+
|
103
|
+
raise 'could not delete user' if count >= max_trials
|
104
|
+
end
|
94
105
|
end
|
95
106
|
|
96
|
-
def
|
107
|
+
def add_user(server_url:, hbci_version:, bank_code:, user_id:, user_name: '')
|
97
108
|
logger.debug 'adding account %p' % {server_url: server_url, hbci_version: hbci_version, bank_code: bank_code, user_id: user_id, user_name: user_name}
|
98
109
|
|
99
110
|
cmd = ""
|
data/lib/aq_banking/version.rb
CHANGED