burglar 0.2.0 → 0.3.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 25e844e95a2d468f0bcc283db3f4b1e8f5c229d7416d9ce6c801864b50a13674
4
- data.tar.gz: 1767116723d58b400f42f80da9929003c22b050a0ddb5959579c0ac6cf3e2fb1
3
+ metadata.gz: c280fb2c64ad674715877d9429f1c84ddb7dfb9e9578cc0d7d58b5251eb575b2
4
+ data.tar.gz: 68fa5caf9698c083008b530a53e81908c1cf099c08abb887889549cfd5cf363d
5
5
  SHA512:
6
- metadata.gz: a50c49a22f97a600ff75ebf80473a497aeb52c66257526ee5b68cd5cfa9e78fc7ebb45bc23bbdf7eda6d22607cb099e9ccc9fdd8c8ac3a8ab1177ad4ee1f83e4
7
- data.tar.gz: 032d386ed122727eb197e25efe77d4ef256967e7e2f18e8a2e27940847ab739c689ecc596c8d09dc3baac7a1575dd584126446dffb7b171c09656cd6c7e60dcd
6
+ metadata.gz: 3f36f39c7b1b2bac802b112e02dc7c7b3300fa36e81481c7527397d69e9106d79d926514f985dc718b5d0e599dcbfb010794bbf158acdac846beac0339c44f79
7
+ data.tar.gz: a4fa85124c0430f97238c4bfa3c5e3455187816a8acbb6d9ac36fd6794538c3a8aa5d6dee85ed5860d8dc75ccab113aa160ee5aa40c6eebc4bbeb0e21700e998
@@ -32,22 +32,33 @@ module LogCabin
32
32
 
33
33
  private
34
34
 
35
+ def api_configuration
36
+ @api_configuration ||= ::Plaid::Configuration.new do |c|
37
+ c.server_index = ::Plaid::Configuration::Environment['development']
38
+ c.api_key['PLAID-CLIENT-ID'] = client_id
39
+ c.api_key['PLAID-SECRET'] = secret_key
40
+ c.api_key['Plaid-Version'] = '2020-09-14'
41
+ end
42
+ end
43
+
35
44
  def api_client
36
- @api_client ||= ::Plaid::Client.new(
37
- env: 'development',
38
- client_id: client_id,
39
- secret: secret_key
40
- )
45
+ @api_client ||= ::Plaid::ApiClient.new api_configuration
46
+ end
47
+
48
+ def client
49
+ @client ||= ::Plaid::PlaidApi.new(api_client)
41
50
  end
42
51
 
43
52
  def get_transactions_page(offset)
44
- resp = api_client.transactions.get(
45
- access_token,
46
- begin_date_str,
47
- end_date_str,
48
- account_ids: [account_id],
49
- offset: offset
50
- )
53
+ resp = client.transactions_get(::Plaid::TransactionsGetRequest.new(
54
+ access_token: access_token,
55
+ start_date: begin_date_str,
56
+ end_date: end_date_str,
57
+ options: ::Plaid::TransactionsGetRequestOptions.new(
58
+ account_ids: [account_id],
59
+ offset: offset
60
+ )
61
+ ))
51
62
  [resp.transactions, resp.total_transactions]
52
63
  end
53
64
 
@@ -75,16 +86,16 @@ module LogCabin
75
86
  end
76
87
 
77
88
  def accounts
78
- @accounts ||= api_client.accounts.get(access_token)['accounts']
89
+ @accounts || client.accounts_get(::Plaid::AccountsGetRequest.new(access_token: access_token)).accounts
79
90
  end
80
91
 
81
92
  def account
82
93
  @account ||= accounts.first if accounts.size == 1
83
- @account ||= accounts.find { |x| x['name'] == account_clean_name }
94
+ @account ||= accounts.find { |x| x.name == account_clean_name }
84
95
  end
85
96
 
86
97
  def account_id
87
- @account_id ||= account['account_id']
98
+ @account_id ||= account.account_id
88
99
  end
89
100
 
90
101
  def account_clean_name
@@ -1,5 +1,5 @@
1
1
  ##
2
2
  # Set the version (needed for Mercenary -v)
3
3
  module Burglar
4
- VERSION = '0.2.0'.freeze
4
+ VERSION = '0.3.0'.freeze
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: burglar
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Les Aker
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-06 00:00:00.000000000 Z
11
+ date: 2022-04-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cymbal
@@ -170,7 +170,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
170
170
  - !ruby/object:Gem::Version
171
171
  version: '0'
172
172
  requirements: []
173
- rubygems_version: 3.1.2
173
+ rubygems_version: 3.2.33
174
174
  signing_key:
175
175
  specification_version: 4
176
176
  summary: Tool for parsing data from bank websites