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 +4 -4
- data/lib/burglar/modules/plaid.rb +26 -15
- data/lib/burglar/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c280fb2c64ad674715877d9429f1c84ddb7dfb9e9578cc0d7d58b5251eb575b2
|
4
|
+
data.tar.gz: 68fa5caf9698c083008b530a53e81908c1cf099c08abb887889549cfd5cf363d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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::
|
37
|
-
|
38
|
-
|
39
|
-
|
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 =
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
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
|
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
|
94
|
+
@account ||= accounts.find { |x| x.name == account_clean_name }
|
84
95
|
end
|
85
96
|
|
86
97
|
def account_id
|
87
|
-
@account_id ||= account
|
98
|
+
@account_id ||= account.account_id
|
88
99
|
end
|
89
100
|
|
90
101
|
def account_clean_name
|
data/lib/burglar/version.rb
CHANGED
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.
|
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:
|
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.
|
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
|