finapps 0.1.16.pre → 0.1.17.pre
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/finapps.gemspec +1 -0
- data/lib/finapps/rest/accounts.rb +9 -4
- data/lib/finapps/rest/client.rb +16 -13
- data/lib/finapps/version.rb +1 -1
- metadata +22 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: edbcabb394047440c61ac3d07428cfa6419e6116
|
4
|
+
data.tar.gz: e0466c732b7030103382f934bef46b212ebb567e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e69b5f639bddeda0516a38c4b28f8952fabebd1ad5a16a34fd4224f58d10d352f7a09147d607e810c25a4cd913291038a8e330007788045237028ca1f9585600
|
7
|
+
data.tar.gz: 694ad0795837db45b194f8bd4a5bcca949c9fdb8461b41a6b726b33275e2efb0fbbdbcac9a5d40de8a37e3207fb83bc605f70d4045674ef4e5586824c440f596
|
data/finapps.gemspec
CHANGED
@@ -29,6 +29,7 @@ Gem::Specification.new do |spec|
|
|
29
29
|
spec.add_development_dependency 'bundler', '~> 1.6', '>= 1.6.2'
|
30
30
|
spec.add_development_dependency 'rake', '~> 0.9', '>= 0.9.6'
|
31
31
|
spec.add_development_dependency 'rspec', '~> 3.0', '>= 3.0.0'
|
32
|
+
spec.add_development_dependency 'webmock', '~> 1.18', '>= 1.18.0'
|
32
33
|
|
33
34
|
spec.extra_rdoc_files = %w(README.md LICENSE.txt)
|
34
35
|
spec.rdoc_options = %w(--line-numbers --inline-source --title finapps-ruby --main README.md)
|
@@ -30,7 +30,7 @@ module FinApps
|
|
30
30
|
path = end_point.sub ':account_id', ERB::Util.url_encode(account_id)
|
31
31
|
logger.debug "##{__method__.to_s} => path: #{path}"
|
32
32
|
|
33
|
-
account, error_messages = @client.send(path, :get
|
33
|
+
account, error_messages = @client.send(path, :get) do |r|
|
34
34
|
Account.new(r.body)
|
35
35
|
end
|
36
36
|
|
@@ -41,8 +41,8 @@ module FinApps
|
|
41
41
|
end
|
42
42
|
|
43
43
|
class Account < FinApps::REST::Resource
|
44
|
-
attr_accessor :_id, :
|
45
|
-
:details
|
44
|
+
attr_accessor :_id, :user_institution_id, :user_institution_name, :account_id, :account_type,
|
45
|
+
:account_name, :account_holder, :account_display_name, :details
|
46
46
|
|
47
47
|
def initialize(hash)
|
48
48
|
super
|
@@ -51,7 +51,12 @@ module FinApps
|
|
51
51
|
end
|
52
52
|
|
53
53
|
class AccountDetails < FinApps::REST::Resource
|
54
|
-
attr_accessor :available_balance, :current_balance, :routing_number
|
54
|
+
attr_accessor :available_balance, :current_balance, :routing_number,
|
55
|
+
:min_payment, :account_close_date, :account_number, :account_open_date,
|
56
|
+
:account_type, :amount_due, :apr, :as_of_date,
|
57
|
+
:available_credit, :available_cash, :card_type, :cash_apr,
|
58
|
+
:due_date, :last_payment, :last_payment_date, :new_charges, :payments, :pending_charges,
|
59
|
+
:running_balance, :total_cash_limit, :total_credit_line
|
55
60
|
end
|
56
61
|
|
57
62
|
end
|
data/lib/finapps/rest/client.rb
CHANGED
@@ -35,9 +35,8 @@ module FinApps
|
|
35
35
|
end
|
36
36
|
|
37
37
|
# Performs HTTP GET, POST, UPDATE and DELETE requests.
|
38
|
-
# You shouldn't need to use this method directly,
|
39
|
-
#
|
40
|
-
# the JSON object in the response body.
|
38
|
+
# You shouldn't need to use this method directly, but it can be useful for debugging.
|
39
|
+
# Returns a hash obtained from parsing the JSON object in the response body.
|
41
40
|
#
|
42
41
|
# @param [String] path
|
43
42
|
# @param [String] method
|
@@ -63,9 +62,13 @@ module FinApps
|
|
63
62
|
raise StandardError "Method not supported: #{method}."
|
64
63
|
end
|
65
64
|
|
66
|
-
if
|
67
|
-
|
68
|
-
|
65
|
+
if block_given?
|
66
|
+
if response.present?
|
67
|
+
result = proc.call(response)
|
68
|
+
logger.debug "##{__method__.to_s} => parsed result: #{result.pretty_inspect}"
|
69
|
+
else
|
70
|
+
logger.error "##{__method__.to_s} => Null response found. Unable to process it."
|
71
|
+
end
|
69
72
|
end
|
70
73
|
|
71
74
|
rescue FinApps::REST::Error => error
|
@@ -75,7 +78,7 @@ module FinApps
|
|
75
78
|
logger.debug "##{__method__.to_s} => Faraday::ParsingError, #{error.to_s}"
|
76
79
|
rescue Exception => error
|
77
80
|
error_messages = ['Unexpected error.']
|
78
|
-
logger.
|
81
|
+
logger.error "##{__method__.to_s} => Exception, #{error.to_s}"
|
79
82
|
ensure
|
80
83
|
logger.debug "##{__method__.to_s} => Failed, error_messages: #{error_messages.pretty_inspect}" if error_messages.present?
|
81
84
|
end
|
@@ -102,8 +105,8 @@ module FinApps
|
|
102
105
|
|
103
106
|
private
|
104
107
|
|
105
|
-
# Performs an HTTP GET request.
|
106
|
-
#
|
108
|
+
# Performs an HTTP GET request.
|
109
|
+
# Returns a hash obtained from parsing
|
107
110
|
# the JSON object in the response body.
|
108
111
|
#
|
109
112
|
# @param [String] path
|
@@ -121,8 +124,8 @@ module FinApps
|
|
121
124
|
response
|
122
125
|
end
|
123
126
|
|
124
|
-
# Performs an HTTP POST request.
|
125
|
-
#
|
127
|
+
# Performs an HTTP POST request.
|
128
|
+
# Returns a hash obtained from parsing
|
126
129
|
# the JSON object in the response body.
|
127
130
|
#
|
128
131
|
# @param [String] path
|
@@ -142,8 +145,8 @@ module FinApps
|
|
142
145
|
response
|
143
146
|
end
|
144
147
|
|
145
|
-
# Performs an HTTP DELETE request.
|
146
|
-
#
|
148
|
+
# Performs an HTTP DELETE request.
|
149
|
+
# Returns a hash obtained from parsing
|
147
150
|
# the JSON object in the response body.
|
148
151
|
#
|
149
152
|
# @param [String] path
|
data/lib/finapps/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: finapps
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.17.pre
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Erich Quintero
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-07-
|
11
|
+
date: 2014-07-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -170,6 +170,26 @@ dependencies:
|
|
170
170
|
- - '>='
|
171
171
|
- !ruby/object:Gem::Version
|
172
172
|
version: 3.0.0
|
173
|
+
- !ruby/object:Gem::Dependency
|
174
|
+
name: webmock
|
175
|
+
requirement: !ruby/object:Gem::Requirement
|
176
|
+
requirements:
|
177
|
+
- - ~>
|
178
|
+
- !ruby/object:Gem::Version
|
179
|
+
version: '1.18'
|
180
|
+
- - '>='
|
181
|
+
- !ruby/object:Gem::Version
|
182
|
+
version: 1.18.0
|
183
|
+
type: :development
|
184
|
+
prerelease: false
|
185
|
+
version_requirements: !ruby/object:Gem::Requirement
|
186
|
+
requirements:
|
187
|
+
- - ~>
|
188
|
+
- !ruby/object:Gem::Version
|
189
|
+
version: '1.18'
|
190
|
+
- - '>='
|
191
|
+
- !ruby/object:Gem::Version
|
192
|
+
version: 1.18.0
|
173
193
|
description: A simple library for communicating with the FinApps REST API.
|
174
194
|
email:
|
175
195
|
- erich@financialapps.com
|