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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 101e8f4abba2333433ef11b248261b913c5c7296
4
- data.tar.gz: d9bcee0923e00b89c3622117d96807fed0e02a0e
3
+ metadata.gz: 17fa2ca63499cb62225239a70a905c55b81e7a47
4
+ data.tar.gz: 2637811bfe6b88fa99f83000e78f5225c4d38232
5
5
  SHA512:
6
- metadata.gz: 44e5c38d1c9be109185c6c9d1f3450449fe5820f3d9afefbda25179a53180005e52e85f3030dd200a39870e38449ffdcdc3a682b9a366773a891bfc0c0817903
7
- data.tar.gz: 29c307eb6fabb07ad1ccaf7745bcabe5226fb2ce7914ecfd957b214b6056c36826ef89b6d9f869695287ca94c36c108b72386baba3dd5c8cfe2188d3ed2be745
6
+ metadata.gz: e330e9318ce1cde9a5752074d4efcee789b4b29736bd7a78455d5d0656b4b18eb911e9398da6a717115d9759f65d55b6ec6e79a1c2e51ce26dbb4eeee52a1e69
7
+ data.tar.gz: 4b30923c2e3a17995fe78acf1f9fb02392ee1d3392fceed50b0bbb18fdd1733538c288afbdc0098310ea48a0ad786d93af5f62add87df9ca35510dea04d5cd51
data/.gitignore CHANGED
@@ -7,3 +7,4 @@
7
7
  /pkg/
8
8
  /spec/reports/
9
9
  /tmp/
10
+ *.gem
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
- transactions = Bankster::Client.new(bank_credentials, api_key).transactions('my_account_number', Date.new(2016,5,1), Date.new(2016,5,11))
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
 
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "bankster-client"
7
- spec.version = '0.0.2'
7
+ spec.version = '0.0.3'
8
8
  spec.authors = ["Roman Lehnert"]
9
9
  spec.email = ["roman.lehnert@googlemail.com"]
10
10
 
@@ -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) if response.ok?
24
+ JSON.parse(response.body)
26
25
  else
27
26
  raise(response.body)
28
27
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bankster-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roman Lehnert