bankster-client 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/README.md +9 -2
- data/bankster-client.gemspec +1 -1
- data/lib/bankster/client.rb +2 -3
- 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: 17fa2ca63499cb62225239a70a905c55b81e7a47
|
4
|
+
data.tar.gz: 2637811bfe6b88fa99f83000e78f5225c4d38232
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e330e9318ce1cde9a5752074d4efcee789b4b29736bd7a78455d5d0656b4b18eb911e9398da6a717115d9759f65d55b6ec6e79a1c2e51ce26dbb4eeee52a1e69
|
7
|
+
data.tar.gz: 4b30923c2e3a17995fe78acf1f9fb02392ee1d3392fceed50b0bbb18fdd1733538c288afbdc0098310ea48a0ad786d93af5f62add87df9ca35510dea04d5cd51
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -27,10 +27,17 @@ bank_credentials = Bankster::BankCredentials::Hbci.new({
|
|
27
27
|
user_id: 'my_hbci_user_id',
|
28
28
|
pin: 'my_hbci_pin'
|
29
29
|
})
|
30
|
-
|
31
30
|
api_key = '9daad1ea407b91745d99e78ec1602110'
|
32
31
|
|
33
|
-
|
32
|
+
bankster_client = Bankster::Client.new(bank_credentials, api_key)
|
33
|
+
|
34
|
+
transactions = bankster_client.transactions('my_account_number', Date.new(2016,5,1), Date.new(2016,5,11))
|
35
|
+
```
|
36
|
+
|
37
|
+
To override the hostname where the bankster-proxy resides, define
|
38
|
+
|
39
|
+
```ruby
|
40
|
+
BANSTER_BASE_URI = 'http://localhost:9292'
|
34
41
|
```
|
35
42
|
|
36
43
|
|
data/bankster-client.gemspec
CHANGED
data/lib/bankster/client.rb
CHANGED
@@ -6,12 +6,11 @@ module Bankster
|
|
6
6
|
include HTTParty
|
7
7
|
attr_reader :credentials
|
8
8
|
|
9
|
-
base_uri "localhost:9292"
|
10
|
-
|
11
9
|
def initialize(credentials, api_key)
|
12
10
|
@credentials = credentials
|
13
11
|
@api_key = api_key
|
14
12
|
@options = {
|
13
|
+
base_uri: BANKSTER_BASE_URI || 'https://api.bankster.io',
|
15
14
|
headers: {
|
16
15
|
'Api-Key' => api_key,
|
17
16
|
'Bank-Credentials' => Base64.encode64(credentials.to_json)
|
@@ -22,7 +21,7 @@ module Bankster
|
|
22
21
|
def transactions(account, from, to)
|
23
22
|
response = self.class.get("/transactions", @options.merge(query: {account: account, start: from, end: to}))
|
24
23
|
if response.ok?
|
25
|
-
JSON.parse(response.body)
|
24
|
+
JSON.parse(response.body)
|
26
25
|
else
|
27
26
|
raise(response.body)
|
28
27
|
end
|