atrium-ruby 2.8.5 → 2.10.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +10 -2
- data/docs/Account.md +3 -0
- data/docs/AccountNumber.md +2 -0
- data/docs/ConnectWidgetRequestBody.md +4 -0
- data/docs/Member.md +1 -0
- data/docs/MemberCreateRequest.md +4 -1
- data/docs/MembersApi.md +44 -0
- data/docs/MerchantLocation.md +17 -0
- data/docs/MerchantLocationResponseBody.md +8 -0
- data/docs/MerchantLocationsResponseBody.md +9 -0
- data/docs/MerchantsApi.md +107 -2
- data/docs/MerchantsResponseBody.md +9 -0
- data/docs/Transaction.md +1 -0
- data/lib/atrium-ruby.rb +4 -0
- data/lib/atrium-ruby/api/members_api.rb +64 -0
- data/lib/atrium-ruby/api/merchants_api.rb +156 -0
- data/lib/atrium-ruby/models/account.rb +28 -1
- data/lib/atrium-ruby/models/account_number.rb +19 -1
- data/lib/atrium-ruby/models/connect_widget_request_body.rb +40 -4
- data/lib/atrium-ruby/models/member.rb +10 -1
- data/lib/atrium-ruby/models/member_create_request.rb +31 -9
- data/lib/atrium-ruby/models/merchant_location.rb +260 -0
- data/lib/atrium-ruby/models/merchant_location_response_body.rb +179 -0
- data/lib/atrium-ruby/models/merchant_locations_response_body.rb +190 -0
- data/lib/atrium-ruby/models/merchants_response_body.rb +190 -0
- data/lib/atrium-ruby/models/transaction.rb +10 -1
- data/lib/atrium-ruby/version.rb +1 -1
- data/spec/api/members_api_spec.rb +15 -0
- data/spec/api/merchants_api_spec.rb +36 -0
- data/spec/models/account_number_spec.rb +12 -0
- data/spec/models/account_spec.rb +18 -0
- data/spec/models/connect_widget_request_body_spec.rb +24 -0
- data/spec/models/member_create_request_spec.rb +18 -0
- data/spec/models/member_spec.rb +6 -0
- data/spec/models/merchant_location_response_body_spec.rb +36 -0
- data/spec/models/merchant_location_spec.rb +90 -0
- data/spec/models/merchant_locations_response_body_spec.rb +42 -0
- data/spec/models/merchants_response_body_spec.rb +42 -0
- data/spec/models/transaction_spec.rb +6 -0
- metadata +52 -37
@@ -0,0 +1,190 @@
|
|
1
|
+
=begin
|
2
|
+
#MX API
|
3
|
+
|
4
|
+
#The MX Atrium API supports over 48,000 data connections to thousands of financial institutions. It provides secure access to your users' accounts and transactions with industry-leading cleansing, categorization, and classification. Atrium is designed according to resource-oriented REST architecture and responds with JSON bodies and HTTP response codes. Use Atrium's development environment, vestibule.mx.com, to quickly get up and running. The development environment limits are 100 users, 25 members per user, and access to the top 15 institutions. Contact MX to purchase production access.
|
5
|
+
|
6
|
+
|
7
|
+
=end
|
8
|
+
|
9
|
+
require 'date'
|
10
|
+
|
11
|
+
module Atrium
|
12
|
+
class MerchantLocationsResponseBody
|
13
|
+
attr_accessor :merchant_locations
|
14
|
+
|
15
|
+
attr_accessor :pagination
|
16
|
+
|
17
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
18
|
+
def self.attribute_map
|
19
|
+
{
|
20
|
+
:'merchant_locations' => :'merchant_locations',
|
21
|
+
:'pagination' => :'pagination'
|
22
|
+
}
|
23
|
+
end
|
24
|
+
|
25
|
+
# Attribute type mapping.
|
26
|
+
def self.mx_types
|
27
|
+
{
|
28
|
+
:'merchant_locations' => :'Array<MerchantLocation>',
|
29
|
+
:'pagination' => :'Pagination'
|
30
|
+
}
|
31
|
+
end
|
32
|
+
|
33
|
+
# Initializes the object
|
34
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
35
|
+
def initialize(attributes = {})
|
36
|
+
return unless attributes.is_a?(Hash)
|
37
|
+
|
38
|
+
# convert string to symbol for hash key
|
39
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
40
|
+
|
41
|
+
if attributes.has_key?(:'merchant_locations')
|
42
|
+
if (value = attributes[:'merchant_locations']).is_a?(Array)
|
43
|
+
self.merchant_locations = value
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
if attributes.has_key?(:'pagination')
|
48
|
+
self.pagination = attributes[:'pagination']
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
53
|
+
# @return Array for valid properties with the reasons
|
54
|
+
def list_invalid_properties
|
55
|
+
invalid_properties = Array.new
|
56
|
+
invalid_properties
|
57
|
+
end
|
58
|
+
|
59
|
+
# Check to see if the all the properties in the model are valid
|
60
|
+
# @return true if the model is valid
|
61
|
+
def valid?
|
62
|
+
true
|
63
|
+
end
|
64
|
+
|
65
|
+
# Checks equality by comparing each attribute.
|
66
|
+
# @param [Object] Object to be compared
|
67
|
+
def ==(o)
|
68
|
+
return true if self.equal?(o)
|
69
|
+
self.class == o.class &&
|
70
|
+
merchant_locations == o.merchant_locations &&
|
71
|
+
pagination == o.pagination
|
72
|
+
end
|
73
|
+
|
74
|
+
# @see the `==` method
|
75
|
+
# @param [Object] Object to be compared
|
76
|
+
def eql?(o)
|
77
|
+
self == o
|
78
|
+
end
|
79
|
+
|
80
|
+
# Calculates hash code according to all attributes.
|
81
|
+
# @return [Fixnum] Hash code
|
82
|
+
def hash
|
83
|
+
[merchant_locations, pagination].hash
|
84
|
+
end
|
85
|
+
|
86
|
+
# Builds the object from hash
|
87
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
88
|
+
# @return [Object] Returns the model itself
|
89
|
+
def build_from_hash(attributes)
|
90
|
+
return nil unless attributes.is_a?(Hash)
|
91
|
+
self.class.mx_types.each_pair do |key, type|
|
92
|
+
if type =~ /\AArray<(.*)>/i
|
93
|
+
# check to ensure the input is an array given that the the attribute
|
94
|
+
# is documented as an array but the input is not
|
95
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
96
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
97
|
+
end
|
98
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
99
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
100
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
101
|
+
end
|
102
|
+
|
103
|
+
self
|
104
|
+
end
|
105
|
+
|
106
|
+
# Deserializes the data based on type
|
107
|
+
# @param string type Data type
|
108
|
+
# @param string value Value to be deserialized
|
109
|
+
# @return [Object] Deserialized data
|
110
|
+
def _deserialize(type, value)
|
111
|
+
case type.to_sym
|
112
|
+
when :DateTime
|
113
|
+
DateTime.parse(value)
|
114
|
+
when :Date
|
115
|
+
Date.parse(value)
|
116
|
+
when :String
|
117
|
+
value.to_s
|
118
|
+
when :Integer
|
119
|
+
value.to_i
|
120
|
+
when :Float
|
121
|
+
value.to_f
|
122
|
+
when :BOOLEAN
|
123
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
124
|
+
true
|
125
|
+
else
|
126
|
+
false
|
127
|
+
end
|
128
|
+
when :Object
|
129
|
+
# generic object (usually a Hash), return directly
|
130
|
+
value
|
131
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
132
|
+
inner_type = Regexp.last_match[:inner_type]
|
133
|
+
value.map { |v| _deserialize(inner_type, v) }
|
134
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
135
|
+
k_type = Regexp.last_match[:k_type]
|
136
|
+
v_type = Regexp.last_match[:v_type]
|
137
|
+
{}.tap do |hash|
|
138
|
+
value.each do |k, v|
|
139
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
140
|
+
end
|
141
|
+
end
|
142
|
+
else # model
|
143
|
+
temp_model = Atrium.const_get(type).new
|
144
|
+
temp_model.build_from_hash(value)
|
145
|
+
end
|
146
|
+
end
|
147
|
+
|
148
|
+
# Returns the string representation of the object
|
149
|
+
# @return [String] String presentation of the object
|
150
|
+
def to_s
|
151
|
+
to_hash.to_s
|
152
|
+
end
|
153
|
+
|
154
|
+
# to_body is an alias to to_hash (backward compatibility)
|
155
|
+
# @return [Hash] Returns the object in the form of hash
|
156
|
+
def to_body
|
157
|
+
to_hash
|
158
|
+
end
|
159
|
+
|
160
|
+
# Returns the object in the form of hash
|
161
|
+
# @return [Hash] Returns the object in the form of hash
|
162
|
+
def to_hash
|
163
|
+
hash = {}
|
164
|
+
self.class.attribute_map.each_pair do |attr, param|
|
165
|
+
value = self.send(attr)
|
166
|
+
next if value.nil?
|
167
|
+
hash[param] = _to_hash(value)
|
168
|
+
end
|
169
|
+
hash
|
170
|
+
end
|
171
|
+
|
172
|
+
# Outputs non-array value in the form of hash
|
173
|
+
# For object, use to_hash. Otherwise, just return the value
|
174
|
+
# @param [Object] value Any valid value
|
175
|
+
# @return [Hash] Returns the value in the form of hash
|
176
|
+
def _to_hash(value)
|
177
|
+
if value.is_a?(Array)
|
178
|
+
value.compact.map { |v| _to_hash(v) }
|
179
|
+
elsif value.is_a?(Hash)
|
180
|
+
{}.tap do |hash|
|
181
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
182
|
+
end
|
183
|
+
elsif value.respond_to? :to_hash
|
184
|
+
value.to_hash
|
185
|
+
else
|
186
|
+
value
|
187
|
+
end
|
188
|
+
end
|
189
|
+
end
|
190
|
+
end
|
@@ -0,0 +1,190 @@
|
|
1
|
+
=begin
|
2
|
+
#MX API
|
3
|
+
|
4
|
+
#The MX Atrium API supports over 48,000 data connections to thousands of financial institutions. It provides secure access to your users' accounts and transactions with industry-leading cleansing, categorization, and classification. Atrium is designed according to resource-oriented REST architecture and responds with JSON bodies and HTTP response codes. Use Atrium's development environment, vestibule.mx.com, to quickly get up and running. The development environment limits are 100 users, 25 members per user, and access to the top 15 institutions. Contact MX to purchase production access.
|
5
|
+
|
6
|
+
|
7
|
+
=end
|
8
|
+
|
9
|
+
require 'date'
|
10
|
+
|
11
|
+
module Atrium
|
12
|
+
class MerchantsResponseBody
|
13
|
+
attr_accessor :merchants
|
14
|
+
|
15
|
+
attr_accessor :pagination
|
16
|
+
|
17
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
18
|
+
def self.attribute_map
|
19
|
+
{
|
20
|
+
:'merchants' => :'merchants',
|
21
|
+
:'pagination' => :'pagination'
|
22
|
+
}
|
23
|
+
end
|
24
|
+
|
25
|
+
# Attribute type mapping.
|
26
|
+
def self.mx_types
|
27
|
+
{
|
28
|
+
:'merchants' => :'Array<Merchant>',
|
29
|
+
:'pagination' => :'Pagination'
|
30
|
+
}
|
31
|
+
end
|
32
|
+
|
33
|
+
# Initializes the object
|
34
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
35
|
+
def initialize(attributes = {})
|
36
|
+
return unless attributes.is_a?(Hash)
|
37
|
+
|
38
|
+
# convert string to symbol for hash key
|
39
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
40
|
+
|
41
|
+
if attributes.has_key?(:'merchants')
|
42
|
+
if (value = attributes[:'merchants']).is_a?(Array)
|
43
|
+
self.merchants = value
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
if attributes.has_key?(:'pagination')
|
48
|
+
self.pagination = attributes[:'pagination']
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
53
|
+
# @return Array for valid properties with the reasons
|
54
|
+
def list_invalid_properties
|
55
|
+
invalid_properties = Array.new
|
56
|
+
invalid_properties
|
57
|
+
end
|
58
|
+
|
59
|
+
# Check to see if the all the properties in the model are valid
|
60
|
+
# @return true if the model is valid
|
61
|
+
def valid?
|
62
|
+
true
|
63
|
+
end
|
64
|
+
|
65
|
+
# Checks equality by comparing each attribute.
|
66
|
+
# @param [Object] Object to be compared
|
67
|
+
def ==(o)
|
68
|
+
return true if self.equal?(o)
|
69
|
+
self.class == o.class &&
|
70
|
+
merchants == o.merchants &&
|
71
|
+
pagination == o.pagination
|
72
|
+
end
|
73
|
+
|
74
|
+
# @see the `==` method
|
75
|
+
# @param [Object] Object to be compared
|
76
|
+
def eql?(o)
|
77
|
+
self == o
|
78
|
+
end
|
79
|
+
|
80
|
+
# Calculates hash code according to all attributes.
|
81
|
+
# @return [Fixnum] Hash code
|
82
|
+
def hash
|
83
|
+
[merchants, pagination].hash
|
84
|
+
end
|
85
|
+
|
86
|
+
# Builds the object from hash
|
87
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
88
|
+
# @return [Object] Returns the model itself
|
89
|
+
def build_from_hash(attributes)
|
90
|
+
return nil unless attributes.is_a?(Hash)
|
91
|
+
self.class.mx_types.each_pair do |key, type|
|
92
|
+
if type =~ /\AArray<(.*)>/i
|
93
|
+
# check to ensure the input is an array given that the the attribute
|
94
|
+
# is documented as an array but the input is not
|
95
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
96
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
97
|
+
end
|
98
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
99
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
100
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
101
|
+
end
|
102
|
+
|
103
|
+
self
|
104
|
+
end
|
105
|
+
|
106
|
+
# Deserializes the data based on type
|
107
|
+
# @param string type Data type
|
108
|
+
# @param string value Value to be deserialized
|
109
|
+
# @return [Object] Deserialized data
|
110
|
+
def _deserialize(type, value)
|
111
|
+
case type.to_sym
|
112
|
+
when :DateTime
|
113
|
+
DateTime.parse(value)
|
114
|
+
when :Date
|
115
|
+
Date.parse(value)
|
116
|
+
when :String
|
117
|
+
value.to_s
|
118
|
+
when :Integer
|
119
|
+
value.to_i
|
120
|
+
when :Float
|
121
|
+
value.to_f
|
122
|
+
when :BOOLEAN
|
123
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
124
|
+
true
|
125
|
+
else
|
126
|
+
false
|
127
|
+
end
|
128
|
+
when :Object
|
129
|
+
# generic object (usually a Hash), return directly
|
130
|
+
value
|
131
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
132
|
+
inner_type = Regexp.last_match[:inner_type]
|
133
|
+
value.map { |v| _deserialize(inner_type, v) }
|
134
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
135
|
+
k_type = Regexp.last_match[:k_type]
|
136
|
+
v_type = Regexp.last_match[:v_type]
|
137
|
+
{}.tap do |hash|
|
138
|
+
value.each do |k, v|
|
139
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
140
|
+
end
|
141
|
+
end
|
142
|
+
else # model
|
143
|
+
temp_model = Atrium.const_get(type).new
|
144
|
+
temp_model.build_from_hash(value)
|
145
|
+
end
|
146
|
+
end
|
147
|
+
|
148
|
+
# Returns the string representation of the object
|
149
|
+
# @return [String] String presentation of the object
|
150
|
+
def to_s
|
151
|
+
to_hash.to_s
|
152
|
+
end
|
153
|
+
|
154
|
+
# to_body is an alias to to_hash (backward compatibility)
|
155
|
+
# @return [Hash] Returns the object in the form of hash
|
156
|
+
def to_body
|
157
|
+
to_hash
|
158
|
+
end
|
159
|
+
|
160
|
+
# Returns the object in the form of hash
|
161
|
+
# @return [Hash] Returns the object in the form of hash
|
162
|
+
def to_hash
|
163
|
+
hash = {}
|
164
|
+
self.class.attribute_map.each_pair do |attr, param|
|
165
|
+
value = self.send(attr)
|
166
|
+
next if value.nil?
|
167
|
+
hash[param] = _to_hash(value)
|
168
|
+
end
|
169
|
+
hash
|
170
|
+
end
|
171
|
+
|
172
|
+
# Outputs non-array value in the form of hash
|
173
|
+
# For object, use to_hash. Otherwise, just return the value
|
174
|
+
# @param [Object] value Any valid value
|
175
|
+
# @return [Hash] Returns the value in the form of hash
|
176
|
+
def _to_hash(value)
|
177
|
+
if value.is_a?(Array)
|
178
|
+
value.compact.map { |v| _to_hash(v) }
|
179
|
+
elsif value.is_a?(Hash)
|
180
|
+
{}.tap do |hash|
|
181
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
182
|
+
end
|
183
|
+
elsif value.respond_to? :to_hash
|
184
|
+
value.to_hash
|
185
|
+
else
|
186
|
+
value
|
187
|
+
end
|
188
|
+
end
|
189
|
+
end
|
190
|
+
end
|
@@ -46,6 +46,8 @@ module Atrium
|
|
46
46
|
|
47
47
|
attr_accessor :is_payroll_advance
|
48
48
|
|
49
|
+
attr_accessor :is_subscription
|
50
|
+
|
49
51
|
attr_accessor :latitude
|
50
52
|
|
51
53
|
attr_accessor :longitude
|
@@ -95,6 +97,7 @@ module Atrium
|
|
95
97
|
:'is_international' => :'is_international',
|
96
98
|
:'is_overdraft_fee' => :'is_overdraft_fee',
|
97
99
|
:'is_payroll_advance' => :'is_payroll_advance',
|
100
|
+
:'is_subscription' => :'is_subscription',
|
98
101
|
:'latitude' => :'latitude',
|
99
102
|
:'longitude' => :'longitude',
|
100
103
|
:'member_guid' => :'member_guid',
|
@@ -133,6 +136,7 @@ module Atrium
|
|
133
136
|
:'is_international' => :'BOOLEAN',
|
134
137
|
:'is_overdraft_fee' => :'BOOLEAN',
|
135
138
|
:'is_payroll_advance' => :'BOOLEAN',
|
139
|
+
:'is_subscription' => :'BOOLEAN',
|
136
140
|
:'latitude' => :'Float',
|
137
141
|
:'longitude' => :'Float',
|
138
142
|
:'member_guid' => :'String',
|
@@ -230,6 +234,10 @@ module Atrium
|
|
230
234
|
self.is_payroll_advance = attributes[:'is_payroll_advance']
|
231
235
|
end
|
232
236
|
|
237
|
+
if attributes.has_key?(:'is_subscription')
|
238
|
+
self.is_subscription = attributes[:'is_subscription']
|
239
|
+
end
|
240
|
+
|
233
241
|
if attributes.has_key?(:'latitude')
|
234
242
|
self.latitude = attributes[:'latitude']
|
235
243
|
end
|
@@ -323,6 +331,7 @@ module Atrium
|
|
323
331
|
is_international == o.is_international &&
|
324
332
|
is_overdraft_fee == o.is_overdraft_fee &&
|
325
333
|
is_payroll_advance == o.is_payroll_advance &&
|
334
|
+
is_subscription == o.is_subscription &&
|
326
335
|
latitude == o.latitude &&
|
327
336
|
longitude == o.longitude &&
|
328
337
|
member_guid == o.member_guid &&
|
@@ -348,7 +357,7 @@ module Atrium
|
|
348
357
|
# Calculates hash code according to all attributes.
|
349
358
|
# @return [Fixnum] Hash code
|
350
359
|
def hash
|
351
|
-
[account_guid, amount, category, check_number, check_number_string, created_at, currency_code, date, description, guid, is_bill_pay, is_direct_deposit, is_expense, is_fee, is_income, is_international, is_overdraft_fee, is_payroll_advance, latitude, longitude, member_guid, memo, merchant_category_code, merchant_guid, original_description, posted_at, status, top_level_category, transacted_at, type, updated_at, user_guid].hash
|
360
|
+
[account_guid, amount, category, check_number, check_number_string, created_at, currency_code, date, description, guid, is_bill_pay, is_direct_deposit, is_expense, is_fee, is_income, is_international, is_overdraft_fee, is_payroll_advance, is_subscription, latitude, longitude, member_guid, memo, merchant_category_code, merchant_guid, original_description, posted_at, status, top_level_category, transacted_at, type, updated_at, user_guid].hash
|
352
361
|
end
|
353
362
|
|
354
363
|
# Builds the object from hash
|
data/lib/atrium-ruby/version.rb
CHANGED
@@ -190,6 +190,21 @@ describe 'MembersApi' do
|
|
190
190
|
end
|
191
191
|
end
|
192
192
|
|
193
|
+
# unit tests for read_o_auth_window_uri
|
194
|
+
# Read OAuth Window URI
|
195
|
+
# This endpoint will generate an `oauth_window_uri` for the specified `member`.
|
196
|
+
# @param member_guid The unique identifier for a `member`.
|
197
|
+
# @param user_guid The unique identifier for a `user`.
|
198
|
+
# @param [Hash] opts the optional parameters
|
199
|
+
# @option opts [String] :referral_source Should be either BROWSER or APP depending on the implementation.
|
200
|
+
# @option opts [String] :ui_message_webview_url_scheme A scheme for routing the user back to the application state they were previously in.
|
201
|
+
# @return [MemberResponseBody]
|
202
|
+
describe 'read_o_auth_window_uri test' do
|
203
|
+
it 'should work' do
|
204
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
205
|
+
end
|
206
|
+
end
|
207
|
+
|
193
208
|
# unit tests for resume_member
|
194
209
|
# Resume aggregation from MFA
|
195
210
|
# This endpoint answers the challenges needed when a member has been challenged by multi-factor authentication.
|