atrium-ruby 1.3.0 → 1.3.2
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/examples/all_endpoints.rb +27 -0
- data/lib/atrium.rb +1 -0
- data/lib/atrium/client.rb +8 -3
- data/lib/atrium/transaction.rb +11 -0
- data/lib/atrium/version.rb +1 -1
- metadata +27 -27
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 279c66eac36024e6ab3cfacdd9243dd784f1676ad87e0d0175d84cc147b7d5d6
|
4
|
+
data.tar.gz: cdb8839bcf632ee70df7899d3873e92cad318558dfa0350dbf8ccce90ed8261b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ddc08d12886e56bbb2dfd2f2fe3bbcf19c618f9376b518037ec723fce28c236669cbac653885cbd6af55fbb0d33b5b0e4076091cac3833e90c083cd61a1e9d66
|
7
|
+
data.tar.gz: 4dab84a369eeaf288c6829d077c0965bfff26c9f33dc61416cb4bcc824f413b175ff28588c79632e3bece261b772f7c6944b68deefcab044d141606896bad4e0
|
data/examples/all_endpoints.rb
CHANGED
@@ -186,6 +186,33 @@ transactions.each do |a_transaction|
|
|
186
186
|
puts a_transaction.attributes
|
187
187
|
end
|
188
188
|
|
189
|
+
puts "\n*********************** Categorize Transactions ***********************"
|
190
|
+
transactions_to_categorize = ::JSON.parse('[
|
191
|
+
{
|
192
|
+
"amount": 11.22,
|
193
|
+
"description": "BEER BAR 65000000764SALT LAKE C",
|
194
|
+
"id": "12",
|
195
|
+
"type": "DEBIT"
|
196
|
+
},
|
197
|
+
{
|
198
|
+
"amount": 21.33,
|
199
|
+
"description": "IN-N-OUT BURGER #239AMERICAN FO",
|
200
|
+
"id": "13",
|
201
|
+
"type": "DEBIT"
|
202
|
+
},
|
203
|
+
{
|
204
|
+
"amount": 1595.33,
|
205
|
+
"description": "ONLINE PAYMENT - THANK YOU",
|
206
|
+
"id": "14",
|
207
|
+
"type": "CREDIT"
|
208
|
+
}
|
209
|
+
]')
|
210
|
+
|
211
|
+
transactions = ::Atrium::Transaction.categorize_and_describe transactions_to_categorize
|
212
|
+
transactions.each do |a_transaction|
|
213
|
+
puts a_transaction.attributes
|
214
|
+
end
|
215
|
+
|
189
216
|
puts "\n************************** Connect Widget **************************"
|
190
217
|
widget = ::Atrium::Connect.create :user_guid => user_guid
|
191
218
|
puts widget.attributes
|
data/lib/atrium.rb
CHANGED
@@ -26,6 +26,7 @@ module Atrium
|
|
26
26
|
# config.mx_api_key = generated_api_key
|
27
27
|
# config.mx_client_id = generated_client_id
|
28
28
|
# config.base_url = "https://atrium.mx.com" # for production URL. this will default to vestibule
|
29
|
+
# config.verify_ssl = false # Defaults to true
|
29
30
|
# end
|
30
31
|
#
|
31
32
|
class << self
|
data/lib/atrium/client.rb
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
module Atrium
|
2
2
|
class Client
|
3
3
|
DEVELOPMENT_URL = "https://vestibule.mx.com".freeze
|
4
|
-
attr_accessor :mx_api_key, :mx_client_id, :base_url
|
4
|
+
attr_accessor :mx_api_key, :mx_client_id, :base_url, :verify_ssl
|
5
5
|
|
6
|
-
def initialize(api_key = nil, client_id = nil, base_url = DEVELOPMENT_URL)
|
6
|
+
def initialize(api_key = nil, client_id = nil, base_url = DEVELOPMENT_URL, verify_ssl = true)
|
7
7
|
@mx_api_key = api_key
|
8
8
|
@mx_client_id = client_id
|
9
9
|
@base_url = base_url
|
10
|
+
@verify_ssl = verify_ssl
|
10
11
|
end
|
11
12
|
|
12
13
|
def make_request(method, endpoint, body = nil, headers = {})
|
@@ -20,7 +21,11 @@ module Atrium
|
|
20
21
|
end
|
21
22
|
|
22
23
|
def http_client
|
23
|
-
@http_client ||=
|
24
|
+
@http_client ||= begin
|
25
|
+
client = ::HTTPClient.new
|
26
|
+
client.ssl_config.verify_mode = OpenSSL::SSL::VERIFY_NONE unless @verify_ssl
|
27
|
+
client
|
28
|
+
end
|
24
29
|
end
|
25
30
|
|
26
31
|
private
|
data/lib/atrium/transaction.rb
CHANGED
@@ -12,6 +12,7 @@ module Atrium
|
|
12
12
|
attribute :date
|
13
13
|
attribute :description
|
14
14
|
attribute :guid
|
15
|
+
attribute :id
|
15
16
|
attribute :is_bill_pay
|
16
17
|
attribute :is_direct_deposit
|
17
18
|
attribute :is_expense
|
@@ -33,6 +34,16 @@ module Atrium
|
|
33
34
|
attribute :updated_at
|
34
35
|
attribute :user_guid
|
35
36
|
|
37
|
+
def self.categorize_and_describe(transaction_hash = {})
|
38
|
+
endpoint = "/categorize_and_describe"
|
39
|
+
body = { :transactions => transaction_hash }
|
40
|
+
transaction_response = ::Atrium.client.make_request(:post, endpoint, body)
|
41
|
+
|
42
|
+
transaction_response["transactions"].map do |transaction|
|
43
|
+
::Atrium::Transaction.new(transaction)
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
36
47
|
def self.list(options = {})
|
37
48
|
options = _transaction_pagination_options(options)
|
38
49
|
paginate(options)
|
data/lib/atrium/version.rb
CHANGED
metadata
CHANGED
@@ -1,150 +1,150 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: atrium-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jon Carstens, Dan Jones, Zach Toolson
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-12-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name: active_attr
|
15
14
|
requirement: !ruby/object:Gem::Requirement
|
16
15
|
requirements:
|
17
16
|
- - ">="
|
18
17
|
- !ruby/object:Gem::Version
|
19
18
|
version: '0'
|
20
|
-
|
19
|
+
name: active_attr
|
21
20
|
prerelease: false
|
21
|
+
type: :runtime
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name: httpclient
|
29
28
|
requirement: !ruby/object:Gem::Requirement
|
30
29
|
requirements:
|
31
30
|
- - ">="
|
32
31
|
- !ruby/object:Gem::Version
|
33
32
|
version: '0'
|
34
|
-
|
33
|
+
name: httpclient
|
35
34
|
prerelease: false
|
35
|
+
type: :runtime
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name: bundler
|
43
42
|
requirement: !ruby/object:Gem::Requirement
|
44
43
|
requirements:
|
45
44
|
- - "~>"
|
46
45
|
- !ruby/object:Gem::Version
|
47
46
|
version: '1.12'
|
48
|
-
|
47
|
+
name: bundler
|
49
48
|
prerelease: false
|
49
|
+
type: :development
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '1.12'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name: pry
|
57
56
|
requirement: !ruby/object:Gem::Requirement
|
58
57
|
requirements:
|
59
58
|
- - ">="
|
60
59
|
- !ruby/object:Gem::Version
|
61
60
|
version: '0'
|
62
|
-
|
61
|
+
name: pry
|
63
62
|
prerelease: false
|
63
|
+
type: :development
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
-
name: rake
|
71
70
|
requirement: !ruby/object:Gem::Requirement
|
72
71
|
requirements:
|
73
72
|
- - "~>"
|
74
73
|
- !ruby/object:Gem::Version
|
75
74
|
version: '10.0'
|
76
|
-
|
75
|
+
name: rake
|
77
76
|
prerelease: false
|
77
|
+
type: :development
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '10.0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
|
-
name: rspec
|
85
84
|
requirement: !ruby/object:Gem::Requirement
|
86
85
|
requirements:
|
87
86
|
- - ">="
|
88
87
|
- !ruby/object:Gem::Version
|
89
88
|
version: '0'
|
90
|
-
|
89
|
+
name: rspec
|
91
90
|
prerelease: false
|
91
|
+
type: :development
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
|
-
name: simplecov
|
99
98
|
requirement: !ruby/object:Gem::Requirement
|
100
99
|
requirements:
|
101
100
|
- - ">="
|
102
101
|
- !ruby/object:Gem::Version
|
103
102
|
version: '0'
|
104
|
-
|
103
|
+
name: simplecov
|
105
104
|
prerelease: false
|
105
|
+
type: :development
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0'
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
|
-
name: vcr
|
113
112
|
requirement: !ruby/object:Gem::Requirement
|
114
113
|
requirements:
|
115
114
|
- - ">="
|
116
115
|
- !ruby/object:Gem::Version
|
117
116
|
version: '0'
|
118
|
-
|
117
|
+
name: vcr
|
119
118
|
prerelease: false
|
119
|
+
type: :development
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
122
|
- - ">="
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '0'
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
|
-
name: webmock
|
127
126
|
requirement: !ruby/object:Gem::Requirement
|
128
127
|
requirements:
|
129
128
|
- - ">="
|
130
129
|
- !ruby/object:Gem::Version
|
131
130
|
version: '0'
|
132
|
-
|
131
|
+
name: webmock
|
133
132
|
prerelease: false
|
133
|
+
type: :development
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
136
|
- - ">="
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: '0'
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
|
-
name: mad_rubocop
|
141
140
|
requirement: !ruby/object:Gem::Requirement
|
142
141
|
requirements:
|
143
142
|
- - ">="
|
144
143
|
- !ruby/object:Gem::Version
|
145
144
|
version: '0'
|
146
|
-
|
145
|
+
name: mad_rubocop
|
147
146
|
prerelease: false
|
147
|
+
type: :development
|
148
148
|
version_requirements: !ruby/object:Gem::Requirement
|
149
149
|
requirements:
|
150
150
|
- - ">="
|
@@ -194,7 +194,7 @@ homepage: http://github.com/mxenabled/atrium-ruby
|
|
194
194
|
licenses:
|
195
195
|
- MIT
|
196
196
|
metadata: {}
|
197
|
-
post_install_message:
|
197
|
+
post_install_message:
|
198
198
|
rdoc_options: []
|
199
199
|
require_paths:
|
200
200
|
- lib
|
@@ -209,9 +209,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
209
209
|
- !ruby/object:Gem::Version
|
210
210
|
version: '0'
|
211
211
|
requirements: []
|
212
|
-
rubyforge_project:
|
213
|
-
rubygems_version: 2.
|
214
|
-
signing_key:
|
212
|
+
rubyforge_project:
|
213
|
+
rubygems_version: 2.6.11
|
214
|
+
signing_key:
|
215
215
|
specification_version: 4
|
216
216
|
summary: Ruby wrapper for the Atrium API by MX
|
217
217
|
test_files: []
|