finapps 0.18.4.pre → 0.19.0.pre
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/finapps/cli/institutions.rb +25 -0
- data/lib/finapps/rest/defaults.rb +2 -0
- data/lib/finapps/rest/user_institutions.rb +43 -12
- data/lib/finapps/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 91bf1aa687fb21a7e8a31a1dfc646e9657a4a729
|
4
|
+
data.tar.gz: e7dbfe7a6d9955faca0dcd49bd7928386ed06e7d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ed0b9462e03cf0a3a469c03aee0e49557aab0aca150cd1bb5f177d54b05101b86e57f6cb20e36dbb3ced69f9ab5d06d13ef3444b90bb0eec7a339f5b1bacfbd9
|
7
|
+
data.tar.gz: d199bc18fe8acabc1dcb49968075367d531ee171e183f82ad36f6ccd69d762c1662c69108bedc7b75de58345bfd46928a432d6c4c1ccefef389c2c37738f99fb
|
@@ -30,5 +30,30 @@ module FinApps
|
|
30
30
|
|
31
31
|
end
|
32
32
|
|
33
|
+
|
34
|
+
desc 'institutions_refresh', 'refresh institutions'
|
35
|
+
|
36
|
+
def institutions_refresh(user_identifier, user_token = '4JZmhcHVf3ODRJ9TMKF7N/1sHDY3M5Q49A9ToAy+TDE=', term=nil)
|
37
|
+
|
38
|
+
begin
|
39
|
+
client.user_credentials!(user_identifier, user_token)
|
40
|
+
results, error_messages = client.user_institutions.refresh
|
41
|
+
if results.present?
|
42
|
+
puts
|
43
|
+
puts 'refresh results:'
|
44
|
+
pp results
|
45
|
+
else
|
46
|
+
puts
|
47
|
+
puts 'unable to refresh institutions'
|
48
|
+
error_messages.each { |m| puts m } if error_messages.present?
|
49
|
+
end
|
50
|
+
puts
|
51
|
+
|
52
|
+
rescue StandardError => error
|
53
|
+
rescue_standard_error(error)
|
54
|
+
end
|
55
|
+
|
56
|
+
end
|
57
|
+
|
33
58
|
end
|
34
59
|
end
|
@@ -37,7 +37,9 @@ module FinApps
|
|
37
37
|
:user_institutions_list => 'institutions/user',
|
38
38
|
:user_institutions_add => 'institutions/:site_id/add',
|
39
39
|
:user_institutions_show => 'institutions/user/:user_institution_id',
|
40
|
+
:user_institutions_update => 'institutions/user/:user_institution_id/credentials',
|
40
41
|
:user_institutions_status => 'institutions/user/:user_institution_id/status',
|
42
|
+
:user_institutions_mfa => 'institutions/user/:user_institution_id/mfa',
|
41
43
|
:user_institutions_refresh => 'institutions/user/refresh',
|
42
44
|
|
43
45
|
:transactions_show => 'transaction/:transaction_id',
|
@@ -33,9 +33,7 @@ module FinApps
|
|
33
33
|
path = end_point.sub ':site_id', ERB::Util.url_encode(site_id)
|
34
34
|
logger.debug "##{__method__.to_s} => path: #{path}"
|
35
35
|
|
36
|
-
user_institution, error_messages = @client.send(path, :post, :parameters => parameters)
|
37
|
-
UserInstitution.new(r.body)
|
38
|
-
end
|
36
|
+
user_institution, error_messages = @client.send(path, :post, :parameters => parameters)
|
39
37
|
|
40
38
|
logger.debug "##{__method__.to_s} => Completed"
|
41
39
|
return user_institution, error_messages
|
@@ -71,9 +69,46 @@ module FinApps
|
|
71
69
|
path = end_point.sub ':user_institution_id', ERB::Util.url_encode(user_institution_id)
|
72
70
|
logger.debug "##{__method__.to_s} => path: #{path}"
|
73
71
|
|
74
|
-
user_institution, error_messages = @client.send(path, :get)
|
75
|
-
|
76
|
-
|
72
|
+
user_institution, error_messages = @client.send(path, :get)
|
73
|
+
|
74
|
+
logger.debug "##{__method__.to_s} => Completed"
|
75
|
+
return user_institution, error_messages
|
76
|
+
end
|
77
|
+
|
78
|
+
def mfa(user_institution_id)
|
79
|
+
logger.debug "##{__method__.to_s} => Started"
|
80
|
+
|
81
|
+
raise MissingArgumentsError.new 'Missing argument: user_institution_id.' if user_institution_id.blank?
|
82
|
+
logger.debug "##{__method__.to_s} => user_institution_id: #{user_institution_id}"
|
83
|
+
|
84
|
+
end_point = Defaults::END_POINTS[:user_institutions_mfa]
|
85
|
+
logger.debug "##{__method__.to_s} => end_point: #{end_point}"
|
86
|
+
|
87
|
+
path = end_point.sub ':user_institution_id', ERB::Util.url_encode(user_institution_id)
|
88
|
+
logger.debug "##{__method__.to_s} => path: #{path}"
|
89
|
+
|
90
|
+
user_institution, error_messages = @client.send(path, :put)
|
91
|
+
|
92
|
+
logger.debug "##{__method__.to_s} => Completed"
|
93
|
+
return user_institution, error_messages
|
94
|
+
end
|
95
|
+
|
96
|
+
def update(user_institution_id, parameters)
|
97
|
+
logger.debug "##{__method__.to_s} => Started"
|
98
|
+
|
99
|
+
raise MissingArgumentsError.new 'Missing argument: user_institution_id.' if user_institution_id.blank?
|
100
|
+
logger.debug "##{__method__.to_s} => user_institution_id: #{user_institution_id}"
|
101
|
+
|
102
|
+
raise MissingArgumentsError.new 'Missing argument: parameters.' if parameters.blank?
|
103
|
+
logger.debug "##{__method__.to_s} => parameters: #{parameters.inspect}"
|
104
|
+
|
105
|
+
end_point = Defaults::END_POINTS[:user_institutions_update]
|
106
|
+
logger.debug "##{__method__.to_s} => end_point: #{end_point}"
|
107
|
+
|
108
|
+
path = end_point.sub ':user_institution_id', ERB::Util.url_encode(user_institution_id)
|
109
|
+
logger.debug "##{__method__.to_s} => path: #{path}"
|
110
|
+
|
111
|
+
user_institution, error_messages = @client.send(path, :put, :parameters => parameters)
|
77
112
|
|
78
113
|
logger.debug "##{__method__.to_s} => Completed"
|
79
114
|
return user_institution, error_messages
|
@@ -85,16 +120,12 @@ module FinApps
|
|
85
120
|
path = Defaults::END_POINTS[:user_institutions_refresh]
|
86
121
|
logger.debug "##{__method__.to_s} => path: #{path}"
|
87
122
|
|
88
|
-
|
123
|
+
user_institutions, error_messages = @client.send(path, :get)
|
89
124
|
|
90
125
|
logger.debug "##{__method__.to_s} => Completed"
|
91
|
-
error_messages
|
126
|
+
return user_institutions, error_messages
|
92
127
|
end
|
93
128
|
end
|
94
129
|
|
95
|
-
class UserInstitution < FinApps::REST::Resource
|
96
|
-
attr_accessor :_id, :account_id, :institution_name, :status, :status_message, :last_refreshed, :accounts
|
97
|
-
end
|
98
|
-
|
99
130
|
end
|
100
131
|
end
|
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.
|
4
|
+
version: 0.19.0.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: 2015-03
|
11
|
+
date: 2015-04-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|