mx-platform-ruby 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +6 -2
- data/Gemfile.lock +84 -0
- data/README.md +236 -33
- data/Rakefile +8 -9
- data/lib/mx-platform-ruby.rb +126 -35
- data/lib/mx-platform-ruby/api/mx_platform_api.rb +4917 -0
- data/lib/mx-platform-ruby/api_client.rb +395 -0
- data/lib/mx-platform-ruby/api_error.rb +57 -0
- data/lib/mx-platform-ruby/configuration.rb +276 -0
- data/lib/mx-platform-ruby/models/account.rb +569 -0
- data/lib/mx-platform-ruby/models/account_number.rb +281 -0
- data/lib/mx-platform-ruby/models/account_numbers_response_body.rb +229 -0
- data/lib/mx-platform-ruby/models/account_owner.rb +317 -0
- data/lib/mx-platform-ruby/models/account_owners_response_body.rb +229 -0
- data/lib/mx-platform-ruby/models/account_response_body.rb +218 -0
- data/lib/mx-platform-ruby/models/account_update_request.rb +218 -0
- data/lib/mx-platform-ruby/models/account_update_request_body.rb +218 -0
- data/lib/mx-platform-ruby/models/accounts_response_body.rb +229 -0
- data/lib/mx-platform-ruby/models/categories_response_body.rb +229 -0
- data/lib/mx-platform-ruby/models/category.rb +281 -0
- data/lib/mx-platform-ruby/models/category_create_request.rb +241 -0
- data/lib/mx-platform-ruby/models/category_create_request_body.rb +218 -0
- data/lib/mx-platform-ruby/models/category_response_body.rb +218 -0
- data/lib/mx-platform-ruby/models/category_update_request.rb +227 -0
- data/lib/mx-platform-ruby/models/category_update_request_body.rb +218 -0
- data/lib/mx-platform-ruby/models/challenge.rb +276 -0
- data/lib/mx-platform-ruby/models/challenge_image_options.rb +236 -0
- data/lib/mx-platform-ruby/models/challenge_options.rb +227 -0
- data/lib/mx-platform-ruby/models/challenges_response_body.rb +229 -0
- data/lib/mx-platform-ruby/models/connect_widget.rb +227 -0
- data/lib/mx-platform-ruby/models/connect_widget_request.rb +308 -0
- data/lib/mx-platform-ruby/models/connect_widget_request_body.rb +218 -0
- data/lib/mx-platform-ruby/models/connect_widget_response_body.rb +218 -0
- data/lib/mx-platform-ruby/models/credential.rb +254 -0
- data/lib/mx-platform-ruby/models/credential_request.rb +227 -0
- data/lib/mx-platform-ruby/models/credentials_response_body.rb +229 -0
- data/lib/mx-platform-ruby/models/enhance_transaction.rb +353 -0
- data/lib/mx-platform-ruby/models/enhance_transactions_request.rb +264 -0
- data/lib/mx-platform-ruby/models/enhance_transactions_request_body.rb +220 -0
- data/lib/mx-platform-ruby/models/enhance_transactions_response_body.rb +220 -0
- data/lib/mx-platform-ruby/models/holding.rb +371 -0
- data/lib/mx-platform-ruby/models/holding_response_body.rb +218 -0
- data/lib/mx-platform-ruby/models/holdings_response_body.rb +229 -0
- data/lib/mx-platform-ruby/models/inline_response200.rb +218 -0
- data/lib/mx-platform-ruby/models/institution.rb +299 -0
- data/lib/mx-platform-ruby/models/institution_response_body.rb +218 -0
- data/lib/mx-platform-ruby/models/institutions_response_body.rb +229 -0
- data/lib/mx-platform-ruby/models/member.rb +317 -0
- data/lib/mx-platform-ruby/models/member_create_request.rb +284 -0
- data/lib/mx-platform-ruby/models/member_create_request_body.rb +236 -0
- data/lib/mx-platform-ruby/models/member_response_body.rb +218 -0
- data/lib/mx-platform-ruby/models/member_resume_request.rb +220 -0
- data/lib/mx-platform-ruby/models/member_resume_request_body.rb +218 -0
- data/lib/mx-platform-ruby/models/member_status.rb +292 -0
- data/lib/mx-platform-ruby/models/member_status_response_body.rb +218 -0
- data/lib/mx-platform-ruby/models/member_update_request.rb +256 -0
- data/lib/mx-platform-ruby/models/member_update_request_body.rb +218 -0
- data/lib/mx-platform-ruby/models/members_response_body.rb +229 -0
- data/lib/mx-platform-ruby/models/merchant.rb +263 -0
- data/lib/mx-platform-ruby/models/merchant_response_body.rb +218 -0
- data/lib/mx-platform-ruby/models/merchants_response_body.rb +229 -0
- data/lib/mx-platform-ruby/models/o_auth_window.rb +227 -0
- data/lib/mx-platform-ruby/models/o_auth_window_response_body.rb +218 -0
- data/lib/mx-platform-ruby/models/pagination.rb +245 -0
- data/lib/mx-platform-ruby/models/statement.rb +281 -0
- data/lib/mx-platform-ruby/models/statement_response_body.rb +218 -0
- data/lib/mx-platform-ruby/models/statements_response_body.rb +229 -0
- data/lib/mx-platform-ruby/models/tag.rb +236 -0
- data/lib/mx-platform-ruby/models/tag_create_request.rb +223 -0
- data/lib/mx-platform-ruby/models/tag_create_request_body.rb +218 -0
- data/lib/mx-platform-ruby/models/tag_response_body.rb +218 -0
- data/lib/mx-platform-ruby/models/tag_update_request.rb +223 -0
- data/lib/mx-platform-ruby/models/tag_update_request_body.rb +218 -0
- data/lib/mx-platform-ruby/models/tagging.rb +254 -0
- data/lib/mx-platform-ruby/models/tagging_create_request.rb +237 -0
- data/lib/mx-platform-ruby/models/tagging_create_request_body.rb +218 -0
- data/lib/mx-platform-ruby/models/tagging_response_body.rb +218 -0
- data/lib/mx-platform-ruby/models/tagging_update_request.rb +223 -0
- data/lib/mx-platform-ruby/models/tagging_update_request_body.rb +218 -0
- data/lib/mx-platform-ruby/models/taggings_response_body.rb +229 -0
- data/lib/mx-platform-ruby/models/tags_response_body.rb +229 -0
- data/lib/mx-platform-ruby/models/transaction.rb +533 -0
- data/lib/mx-platform-ruby/models/transaction_response_body.rb +218 -0
- data/lib/mx-platform-ruby/models/transaction_rule.rb +272 -0
- data/lib/mx-platform-ruby/models/transaction_rule_create_request.rb +246 -0
- data/lib/mx-platform-ruby/models/transaction_rule_create_request_body.rb +218 -0
- data/lib/mx-platform-ruby/models/transaction_rule_response_body.rb +218 -0
- data/lib/mx-platform-ruby/models/transaction_rule_update_request.rb +236 -0
- data/lib/mx-platform-ruby/models/transaction_rule_update_request_body.rb +218 -0
- data/lib/mx-platform-ruby/models/transaction_rules_response_body.rb +229 -0
- data/lib/mx-platform-ruby/models/transaction_update_request.rb +223 -0
- data/lib/mx-platform-ruby/models/transaction_update_request_body.rb +218 -0
- data/lib/mx-platform-ruby/models/transactions_response_body.rb +229 -0
- data/lib/mx-platform-ruby/models/user.rb +254 -0
- data/lib/mx-platform-ruby/models/user_create_request.rb +245 -0
- data/lib/mx-platform-ruby/models/user_create_request_body.rb +218 -0
- data/lib/mx-platform-ruby/models/user_response_body.rb +218 -0
- data/lib/mx-platform-ruby/models/user_update_request.rb +245 -0
- data/lib/mx-platform-ruby/models/user_update_request_body.rb +218 -0
- data/lib/mx-platform-ruby/models/users_response_body.rb +229 -0
- data/lib/mx-platform-ruby/models/widget.rb +236 -0
- data/lib/mx-platform-ruby/models/widget_request.rb +331 -0
- data/lib/mx-platform-ruby/models/widget_request_body.rb +218 -0
- data/lib/mx-platform-ruby/models/widget_response_body.rb +218 -0
- data/lib/mx-platform-ruby/version.rb +13 -3
- data/mx-platform-ruby.gemspec +34 -27
- data/openapi/mx_platform_ruby.yml +11 -0
- data/spec/api/mx_platform_api_spec.rb +979 -0
- data/spec/api_client_spec.rb +188 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/account_number_spec.rb +76 -0
- data/spec/models/account_numbers_response_body_spec.rb +40 -0
- data/spec/models/account_owner_spec.rb +100 -0
- data/spec/models/account_owners_response_body_spec.rb +40 -0
- data/spec/models/account_response_body_spec.rb +34 -0
- data/spec/models/account_spec.rb +268 -0
- data/spec/models/account_update_request_body_spec.rb +34 -0
- data/spec/models/account_update_request_spec.rb +34 -0
- data/spec/models/accounts_response_body_spec.rb +40 -0
- data/spec/models/categories_response_body_spec.rb +40 -0
- data/spec/models/category_create_request_body_spec.rb +34 -0
- data/spec/models/category_create_request_spec.rb +46 -0
- data/spec/models/category_response_body_spec.rb +34 -0
- data/spec/models/category_spec.rb +76 -0
- data/spec/models/category_update_request_body_spec.rb +34 -0
- data/spec/models/category_update_request_spec.rb +40 -0
- data/spec/models/challenge_image_options_spec.rb +46 -0
- data/spec/models/challenge_options_spec.rb +40 -0
- data/spec/models/challenge_spec.rb +70 -0
- data/spec/models/challenges_response_body_spec.rb +40 -0
- data/spec/models/connect_widget_request_body_spec.rb +34 -0
- data/spec/models/connect_widget_request_spec.rb +94 -0
- data/spec/models/connect_widget_response_body_spec.rb +34 -0
- data/spec/models/connect_widget_spec.rb +40 -0
- data/spec/models/credential_request_spec.rb +40 -0
- data/spec/models/credential_spec.rb +58 -0
- data/spec/models/credentials_response_body_spec.rb +40 -0
- data/spec/models/enhance_transaction_spec.rb +124 -0
- data/spec/models/enhance_transactions_request_body_spec.rb +34 -0
- data/spec/models/enhance_transactions_request_spec.rb +58 -0
- data/spec/models/enhance_transactions_response_body_spec.rb +34 -0
- data/spec/models/holding_response_body_spec.rb +34 -0
- data/spec/models/holding_spec.rb +136 -0
- data/spec/models/holdings_response_body_spec.rb +40 -0
- data/spec/models/inline_response200_spec.rb +34 -0
- data/spec/models/institution_response_body_spec.rb +34 -0
- data/spec/models/institution_spec.rb +88 -0
- data/spec/models/institutions_response_body_spec.rb +40 -0
- data/spec/models/member_create_request_body_spec.rb +46 -0
- data/spec/models/member_create_request_spec.rb +70 -0
- data/spec/models/member_response_body_spec.rb +34 -0
- data/spec/models/member_resume_request_body_spec.rb +34 -0
- data/spec/models/member_resume_request_spec.rb +34 -0
- data/spec/models/member_spec.rb +100 -0
- data/spec/models/member_status_response_body_spec.rb +34 -0
- data/spec/models/member_status_spec.rb +82 -0
- data/spec/models/member_update_request_body_spec.rb +34 -0
- data/spec/models/member_update_request_spec.rb +58 -0
- data/spec/models/members_response_body_spec.rb +40 -0
- data/spec/models/merchant_response_body_spec.rb +34 -0
- data/spec/models/merchant_spec.rb +64 -0
- data/spec/models/merchants_response_body_spec.rb +40 -0
- data/spec/models/o_auth_window_response_body_spec.rb +34 -0
- data/spec/models/o_auth_window_spec.rb +40 -0
- data/spec/models/pagination_spec.rb +52 -0
- data/spec/models/statement_response_body_spec.rb +34 -0
- data/spec/models/statement_spec.rb +76 -0
- data/spec/models/statements_response_body_spec.rb +40 -0
- data/spec/models/tag_create_request_body_spec.rb +34 -0
- data/spec/models/tag_create_request_spec.rb +34 -0
- data/spec/models/tag_response_body_spec.rb +34 -0
- data/spec/models/tag_spec.rb +46 -0
- data/spec/models/tag_update_request_body_spec.rb +34 -0
- data/spec/models/tag_update_request_spec.rb +34 -0
- data/spec/models/tagging_create_request_body_spec.rb +34 -0
- data/spec/models/tagging_create_request_spec.rb +40 -0
- data/spec/models/tagging_response_body_spec.rb +34 -0
- data/spec/models/tagging_spec.rb +58 -0
- data/spec/models/tagging_update_request_body_spec.rb +34 -0
- data/spec/models/tagging_update_request_spec.rb +34 -0
- data/spec/models/taggings_response_body_spec.rb +40 -0
- data/spec/models/tags_response_body_spec.rb +40 -0
- data/spec/models/transaction_response_body_spec.rb +34 -0
- data/spec/models/transaction_rule_create_request_body_spec.rb +34 -0
- data/spec/models/transaction_rule_create_request_spec.rb +46 -0
- data/spec/models/transaction_rule_response_body_spec.rb +34 -0
- data/spec/models/transaction_rule_spec.rb +70 -0
- data/spec/models/transaction_rule_update_request_body_spec.rb +34 -0
- data/spec/models/transaction_rule_update_request_spec.rb +46 -0
- data/spec/models/transaction_rules_response_body_spec.rb +40 -0
- data/spec/models/transaction_spec.rb +244 -0
- data/spec/models/transaction_update_request_body_spec.rb +34 -0
- data/spec/models/transaction_update_request_spec.rb +34 -0
- data/spec/models/transactions_response_body_spec.rb +40 -0
- data/spec/models/user_create_request_body_spec.rb +34 -0
- data/spec/models/user_create_request_spec.rb +52 -0
- data/spec/models/user_response_body_spec.rb +34 -0
- data/spec/models/user_spec.rb +58 -0
- data/spec/models/user_update_request_body_spec.rb +34 -0
- data/spec/models/user_update_request_spec.rb +52 -0
- data/spec/models/users_response_body_spec.rb +40 -0
- data/spec/models/widget_request_body_spec.rb +34 -0
- data/spec/models/widget_request_spec.rb +106 -0
- data/spec/models/widget_response_body_spec.rb +34 -0
- data/spec/models/widget_spec.rb +46 -0
- data/spec/spec_helper.rb +100 -13
- metadata +317 -144
- data/.github/workflows/test.yml +0 -20
- data/.gitignore +0 -13
- data/.rubocop.yml +0 -44
- data/lib/mx-platform-ruby/account.rb +0 -107
- data/lib/mx-platform-ruby/account_number.rb +0 -57
- data/lib/mx-platform-ruby/account_owner.rb +0 -42
- data/lib/mx-platform-ruby/category.rb +0 -127
- data/lib/mx-platform-ruby/challenge.rb +0 -37
- data/lib/mx-platform-ruby/client.rb +0 -59
- data/lib/mx-platform-ruby/connect_widget.rb +0 -43
- data/lib/mx-platform-ruby/credential.rb +0 -54
- data/lib/mx-platform-ruby/enhanced_transaction.rb +0 -44
- data/lib/mx-platform-ruby/error.rb +0 -6
- data/lib/mx-platform-ruby/holding.rb +0 -87
- data/lib/mx-platform-ruby/institution.rb +0 -78
- data/lib/mx-platform-ruby/member.rb +0 -242
- data/lib/mx-platform-ruby/member_status.rb +0 -35
- data/lib/mx-platform-ruby/merchant.rb +0 -52
- data/lib/mx-platform-ruby/oauth_window.rb +0 -32
- data/lib/mx-platform-ruby/pageable.rb +0 -29
- data/lib/mx-platform-ruby/statement.rb +0 -70
- data/lib/mx-platform-ruby/tag.rb +0 -104
- data/lib/mx-platform-ruby/tagging.rb +0 -107
- data/lib/mx-platform-ruby/transaction.rb +0 -162
- data/lib/mx-platform-ruby/transaction_rule.rb +0 -112
- data/lib/mx-platform-ruby/user.rb +0 -112
- data/lib/mx-platform-ruby/widget.rb +0 -49
- data/spec/lib/mx-platform-ruby/account_number_spec.rb +0 -100
- data/spec/lib/mx-platform-ruby/account_owner_spec.rb +0 -71
- data/spec/lib/mx-platform-ruby/account_spec.rb +0 -267
- data/spec/lib/mx-platform-ruby/category_spec.rb +0 -244
- data/spec/lib/mx-platform-ruby/challenge_spec.rb +0 -72
- data/spec/lib/mx-platform-ruby/client_spec.rb +0 -101
- data/spec/lib/mx-platform-ruby/connect_widget_spec.rb +0 -66
- data/spec/lib/mx-platform-ruby/credential_spec.rb +0 -90
- data/spec/lib/mx-platform-ruby/enhanced_transaction_spec.rb +0 -89
- data/spec/lib/mx-platform-ruby/holding_spec.rb +0 -178
- data/spec/lib/mx-platform-ruby/institution_spec.rb +0 -141
- data/spec/lib/mx-platform-ruby/member_spec.rb +0 -557
- data/spec/lib/mx-platform-ruby/member_status_spec.rb +0 -76
- data/spec/lib/mx-platform-ruby/merchant_spec.rb +0 -89
- data/spec/lib/mx-platform-ruby/oauth_window_spec.rb +0 -47
- data/spec/lib/mx-platform-ruby/pageable_spec.rb +0 -75
- data/spec/lib/mx-platform-ruby/statement_spec.rb +0 -130
- data/spec/lib/mx-platform-ruby/tag_spec.rb +0 -179
- data/spec/lib/mx-platform-ruby/tagging_spec.rb +0 -191
- data/spec/lib/mx-platform-ruby/transaction_rule_spec.rb +0 -207
- data/spec/lib/mx-platform-ruby/transaction_spec.rb +0 -449
- data/spec/lib/mx-platform-ruby/user_spec.rb +0 -196
- data/spec/lib/mx-platform-ruby/widget_spec.rb +0 -76
- data/spec/lib/mx-platform-ruby_spec.rb +0 -15
- data/spec/sample.pdf +0 -0
@@ -1,35 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module MXPlatformRuby
|
4
|
-
class MemberStatus
|
5
|
-
include ::ActiveAttr::Model
|
6
|
-
|
7
|
-
attribute :aggregated_at
|
8
|
-
attribute :challenges
|
9
|
-
attribute :connection_status
|
10
|
-
attribute :guid
|
11
|
-
attribute :has_processed_accounts
|
12
|
-
attribute :has_processed_transactions
|
13
|
-
attribute :is_authenticated
|
14
|
-
attribute :is_being_aggregated
|
15
|
-
attribute :successfully_aggregated_at
|
16
|
-
|
17
|
-
def self.read_member_status(options = {})
|
18
|
-
read_member_status_options = read_member_status_options(options)
|
19
|
-
response = ::MXPlatformRuby.client.make_request(read_member_status_options)
|
20
|
-
|
21
|
-
member_params = response['member']
|
22
|
-
::MXPlatformRuby::MemberStatus.new(member_params)
|
23
|
-
end
|
24
|
-
|
25
|
-
# Private class methods
|
26
|
-
|
27
|
-
def self.read_member_status_options(options)
|
28
|
-
{
|
29
|
-
endpoint: "/users/#{options[:user_guid]}/members/#{options[:member_guid]}/status",
|
30
|
-
http_method: :get
|
31
|
-
}
|
32
|
-
end
|
33
|
-
private_class_method :read_member_status_options
|
34
|
-
end
|
35
|
-
end
|
@@ -1,52 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module MXPlatformRuby
|
4
|
-
class Merchant
|
5
|
-
extend ::MXPlatformRuby::Pageable
|
6
|
-
include ::ActiveAttr::Model
|
7
|
-
|
8
|
-
attribute :created_at
|
9
|
-
attribute :guid
|
10
|
-
attribute :logo_url
|
11
|
-
attribute :name
|
12
|
-
attribute :updated_at
|
13
|
-
attribute :website_url
|
14
|
-
|
15
|
-
def self.list_merchants(options = {})
|
16
|
-
options = list_merchants_options(options)
|
17
|
-
|
18
|
-
paginate(options)
|
19
|
-
end
|
20
|
-
|
21
|
-
def self.read_merchant(options = {})
|
22
|
-
read_merchant_options = read_merchant_options(options)
|
23
|
-
response = ::MXPlatformRuby.client.make_request(read_merchant_options)
|
24
|
-
|
25
|
-
merchant_params = response['merchant']
|
26
|
-
::MXPlatformRuby::Merchant.new(merchant_params)
|
27
|
-
end
|
28
|
-
|
29
|
-
# Private class methods
|
30
|
-
|
31
|
-
def self.list_merchants_options(options)
|
32
|
-
{
|
33
|
-
endpoint: '/merchants',
|
34
|
-
http_method: :get,
|
35
|
-
query_params: {
|
36
|
-
page: options[:page],
|
37
|
-
records_per_page: options[:records_per_page]
|
38
|
-
}.compact,
|
39
|
-
resource: 'merchants'
|
40
|
-
}
|
41
|
-
end
|
42
|
-
private_class_method :list_merchants_options
|
43
|
-
|
44
|
-
def self.read_merchant_options(options)
|
45
|
-
{
|
46
|
-
endpoint: "/merchants/#{options[:merchant_guid]}",
|
47
|
-
http_method: :get
|
48
|
-
}
|
49
|
-
end
|
50
|
-
private_class_method :read_merchant_options
|
51
|
-
end
|
52
|
-
end
|
@@ -1,32 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module MXPlatformRuby
|
4
|
-
class OAuthWindow
|
5
|
-
include ::ActiveAttr::Model
|
6
|
-
|
7
|
-
attribute :guid
|
8
|
-
attribute :oauth_window_uri
|
9
|
-
|
10
|
-
def self.request_oauth_window(options = {})
|
11
|
-
request_oauth_window_options = request_oauth_window_options(options)
|
12
|
-
response = ::MXPlatformRuby.client.make_request(request_oauth_window_options)
|
13
|
-
|
14
|
-
member_params = response['member']
|
15
|
-
::MXPlatformRuby::OAuthWindow.new(member_params)
|
16
|
-
end
|
17
|
-
|
18
|
-
# Private class methods
|
19
|
-
|
20
|
-
def self.request_oauth_window_options(options)
|
21
|
-
{
|
22
|
-
endpoint: "/users/#{options[:user_guid]}/members/#{options[:member_guid]}/oauth_window_uri",
|
23
|
-
http_method: :get,
|
24
|
-
query_params: {
|
25
|
-
referral_source: options[:referral_source],
|
26
|
-
ui_message_webview_url_scheme: options[:ui_message_webview_url_scheme]
|
27
|
-
}.compact
|
28
|
-
}
|
29
|
-
end
|
30
|
-
private_class_method :request_oauth_window_options
|
31
|
-
end
|
32
|
-
end
|
@@ -1,29 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module MXPlatformRuby
|
4
|
-
class Page < ::Array
|
5
|
-
attr_accessor :current_page, :per_page, :total_entries, :total_pages
|
6
|
-
end
|
7
|
-
|
8
|
-
module Pageable
|
9
|
-
def paginate(options = {})
|
10
|
-
klass = options.fetch(:klass, self)
|
11
|
-
resource = options.fetch(:resource)
|
12
|
-
|
13
|
-
response = ::MXPlatformRuby.client.make_request(options)
|
14
|
-
return nil if response.nil?
|
15
|
-
|
16
|
-
pagination = response['pagination']
|
17
|
-
|
18
|
-
records = response[resource].map { |attributes| klass.new(attributes) }
|
19
|
-
|
20
|
-
page = ::MXPlatformRuby::Page.new(records)
|
21
|
-
page.current_page = pagination['current_page']
|
22
|
-
page.per_page = pagination['per_page']
|
23
|
-
page.total_entries = pagination['total_entries']
|
24
|
-
page.total_pages = pagination['total_pages']
|
25
|
-
|
26
|
-
page
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
@@ -1,70 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module MXPlatformRuby
|
4
|
-
class Statement
|
5
|
-
extend ::MXPlatformRuby::Pageable
|
6
|
-
include ::ActiveAttr::Model
|
7
|
-
|
8
|
-
attribute :account_guid
|
9
|
-
attribute :content_hash
|
10
|
-
attribute :created_at
|
11
|
-
attribute :guid
|
12
|
-
attribute :member_guid
|
13
|
-
attribute :updated_at
|
14
|
-
attribute :uri
|
15
|
-
attribute :user_guid
|
16
|
-
|
17
|
-
def self.download_statement_pdf(options = {})
|
18
|
-
download_statement_pdf_options = download_statement_pdf_options(options)
|
19
|
-
::MXPlatformRuby.client.make_request(download_statement_pdf_options)
|
20
|
-
end
|
21
|
-
|
22
|
-
def self.list_statements_by_member(options = {})
|
23
|
-
options = list_statements_by_member_options(options)
|
24
|
-
|
25
|
-
paginate(options)
|
26
|
-
end
|
27
|
-
|
28
|
-
def self.read_statement_by_member(options = {})
|
29
|
-
read_statement_by_member_options = read_statement_by_member_options(options)
|
30
|
-
response = ::MXPlatformRuby.client.make_request(read_statement_by_member_options)
|
31
|
-
|
32
|
-
statement_params = response['statement']
|
33
|
-
::MXPlatformRuby::Statement.new(statement_params)
|
34
|
-
end
|
35
|
-
|
36
|
-
# Private class methods
|
37
|
-
|
38
|
-
def self.download_statement_pdf_options(options)
|
39
|
-
{
|
40
|
-
endpoint: "/users/#{options[:user_guid]}/members/#{options[:member_guid]}/statements/#{options[:statement_guid]}.pdf",
|
41
|
-
headers: {
|
42
|
-
'Accept': 'application/vnd.mx.api.v1+pdf'
|
43
|
-
},
|
44
|
-
http_method: :get
|
45
|
-
}
|
46
|
-
end
|
47
|
-
private_class_method :download_statement_pdf_options
|
48
|
-
|
49
|
-
def self.list_statements_by_member_options(options)
|
50
|
-
{
|
51
|
-
endpoint: "/users/#{options[:user_guid]}/members/#{options[:member_guid]}/statements",
|
52
|
-
http_method: :get,
|
53
|
-
query_params: {
|
54
|
-
page: options[:page],
|
55
|
-
records_per_page: options[:records_per_page]
|
56
|
-
}.compact,
|
57
|
-
resource: 'statements'
|
58
|
-
}
|
59
|
-
end
|
60
|
-
private_class_method :list_statements_by_member_options
|
61
|
-
|
62
|
-
def self.read_statement_by_member_options(options)
|
63
|
-
{
|
64
|
-
endpoint: "/users/#{options[:user_guid]}/members/#{options[:member_guid]}/statements/#{options[:statement_guid]}",
|
65
|
-
http_method: :get
|
66
|
-
}
|
67
|
-
end
|
68
|
-
private_class_method :read_statement_by_member_options
|
69
|
-
end
|
70
|
-
end
|
data/lib/mx-platform-ruby/tag.rb
DELETED
@@ -1,104 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module MXPlatformRuby
|
4
|
-
class Tag
|
5
|
-
extend ::MXPlatformRuby::Pageable
|
6
|
-
include ::ActiveAttr::Model
|
7
|
-
|
8
|
-
attribute :guid
|
9
|
-
attribute :name
|
10
|
-
attribute :user_guid
|
11
|
-
|
12
|
-
def self.create_tag(options = {})
|
13
|
-
create_tag_options = create_tag_options(options)
|
14
|
-
response = ::MXPlatformRuby.client.make_request(create_tag_options)
|
15
|
-
|
16
|
-
tag_params = response['tag']
|
17
|
-
::MXPlatformRuby::Tag.new(tag_params)
|
18
|
-
end
|
19
|
-
|
20
|
-
def self.delete_tag(options = {})
|
21
|
-
delete_tag_options = delete_tag_options(options)
|
22
|
-
::MXPlatformRuby.client.make_request(delete_tag_options)
|
23
|
-
end
|
24
|
-
|
25
|
-
def self.list_tags(options = {})
|
26
|
-
options = list_tags_options(options)
|
27
|
-
|
28
|
-
paginate(options)
|
29
|
-
end
|
30
|
-
|
31
|
-
def self.read_tag(options = {})
|
32
|
-
read_tag_options = read_tag_options(options)
|
33
|
-
response = ::MXPlatformRuby.client.make_request(read_tag_options)
|
34
|
-
|
35
|
-
tag_params = response['tag']
|
36
|
-
::MXPlatformRuby::Tag.new(tag_params)
|
37
|
-
end
|
38
|
-
|
39
|
-
def self.update_tag(options = {})
|
40
|
-
update_tag_options = update_tag_options(options)
|
41
|
-
response = ::MXPlatformRuby.client.make_request(update_tag_options)
|
42
|
-
|
43
|
-
tag_params = response['tag']
|
44
|
-
::MXPlatformRuby::Tag.new(tag_params)
|
45
|
-
end
|
46
|
-
|
47
|
-
# Private class methods
|
48
|
-
|
49
|
-
def self.create_tag_options(options)
|
50
|
-
{
|
51
|
-
endpoint: "/users/#{options[:user_guid]}/tags",
|
52
|
-
http_method: :post,
|
53
|
-
request_body: {
|
54
|
-
tag: {
|
55
|
-
name: options[:name]
|
56
|
-
}.compact
|
57
|
-
}
|
58
|
-
}
|
59
|
-
end
|
60
|
-
private_class_method :create_tag_options
|
61
|
-
|
62
|
-
def self.delete_tag_options(options)
|
63
|
-
{
|
64
|
-
endpoint: "/users/#{options[:user_guid]}/tags/#{options[:tag_guid]}",
|
65
|
-
http_method: :delete
|
66
|
-
}
|
67
|
-
end
|
68
|
-
private_class_method :delete_tag_options
|
69
|
-
|
70
|
-
def self.list_tags_options(options)
|
71
|
-
{
|
72
|
-
endpoint: "/users/#{options[:user_guid]}/tags",
|
73
|
-
http_method: :get,
|
74
|
-
query_params: {
|
75
|
-
page: options[:page],
|
76
|
-
records_per_page: options[:records_per_page]
|
77
|
-
}.compact,
|
78
|
-
resource: 'tags'
|
79
|
-
}
|
80
|
-
end
|
81
|
-
private_class_method :list_tags_options
|
82
|
-
|
83
|
-
def self.read_tag_options(options)
|
84
|
-
{
|
85
|
-
endpoint: "/users/#{options[:user_guid]}/tags/#{options[:tag_guid]}",
|
86
|
-
http_method: :get
|
87
|
-
}
|
88
|
-
end
|
89
|
-
private_class_method :read_tag_options
|
90
|
-
|
91
|
-
def self.update_tag_options(options)
|
92
|
-
{
|
93
|
-
endpoint: "/users/#{options[:user_guid]}/tags/#{options[:tag_guid]}",
|
94
|
-
http_method: :put,
|
95
|
-
request_body: {
|
96
|
-
tag: {
|
97
|
-
name: options[:name]
|
98
|
-
}.compact
|
99
|
-
}
|
100
|
-
}
|
101
|
-
end
|
102
|
-
private_class_method :update_tag_options
|
103
|
-
end
|
104
|
-
end
|
@@ -1,107 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module MXPlatformRuby
|
4
|
-
class Tagging
|
5
|
-
extend ::MXPlatformRuby::Pageable
|
6
|
-
include ::ActiveAttr::Model
|
7
|
-
|
8
|
-
attribute :guid
|
9
|
-
attribute :member_is_managed_by_user
|
10
|
-
attribute :tag_guid
|
11
|
-
attribute :transaction_guid
|
12
|
-
attribute :user_guid
|
13
|
-
|
14
|
-
def self.create_tagging(options = {})
|
15
|
-
create_tagging_options = create_tagging_options(options)
|
16
|
-
response = ::MXPlatformRuby.client.make_request(create_tagging_options)
|
17
|
-
|
18
|
-
tagging_params = response['tagging']
|
19
|
-
::MXPlatformRuby::Tagging.new(tagging_params)
|
20
|
-
end
|
21
|
-
|
22
|
-
def self.delete_tagging(options = {})
|
23
|
-
delete_tagging_options = delete_tagging_options(options)
|
24
|
-
::MXPlatformRuby.client.make_request(delete_tagging_options)
|
25
|
-
end
|
26
|
-
|
27
|
-
def self.list_taggings(options = {})
|
28
|
-
options = list_taggings_options(options)
|
29
|
-
|
30
|
-
paginate(options)
|
31
|
-
end
|
32
|
-
|
33
|
-
def self.read_tagging(options = {})
|
34
|
-
read_tagging_options = read_tagging_options(options)
|
35
|
-
response = ::MXPlatformRuby.client.make_request(read_tagging_options)
|
36
|
-
|
37
|
-
tagging_params = response['tagging']
|
38
|
-
::MXPlatformRuby::Tagging.new(tagging_params)
|
39
|
-
end
|
40
|
-
|
41
|
-
def self.update_tagging(options = {})
|
42
|
-
update_tagging_options = update_tagging_options(options)
|
43
|
-
response = ::MXPlatformRuby.client.make_request(update_tagging_options)
|
44
|
-
|
45
|
-
tagging_params = response['tagging']
|
46
|
-
::MXPlatformRuby::Tagging.new(tagging_params)
|
47
|
-
end
|
48
|
-
|
49
|
-
# Private class methods
|
50
|
-
|
51
|
-
def self.create_tagging_options(options)
|
52
|
-
{
|
53
|
-
endpoint: "/users/#{options[:user_guid]}/taggings",
|
54
|
-
http_method: :post,
|
55
|
-
request_body: {
|
56
|
-
tagging: {
|
57
|
-
tag_guid: options[:tag_guid],
|
58
|
-
transaction_guid: options[:transaction_guid]
|
59
|
-
}.compact
|
60
|
-
}
|
61
|
-
}
|
62
|
-
end
|
63
|
-
private_class_method :create_tagging_options
|
64
|
-
|
65
|
-
def self.delete_tagging_options(options)
|
66
|
-
{
|
67
|
-
endpoint: "/users/#{options[:user_guid]}/taggings/#{options[:tagging_guid]}",
|
68
|
-
http_method: :delete
|
69
|
-
}
|
70
|
-
end
|
71
|
-
private_class_method :delete_tagging_options
|
72
|
-
|
73
|
-
def self.list_taggings_options(options)
|
74
|
-
{
|
75
|
-
endpoint: "/users/#{options[:user_guid]}/taggings",
|
76
|
-
http_method: :get,
|
77
|
-
query_params: {
|
78
|
-
page: options[:page],
|
79
|
-
records_per_page: options[:records_per_page]
|
80
|
-
}.compact,
|
81
|
-
resource: 'taggings'
|
82
|
-
}
|
83
|
-
end
|
84
|
-
private_class_method :list_taggings_options
|
85
|
-
|
86
|
-
def self.read_tagging_options(options)
|
87
|
-
{
|
88
|
-
endpoint: "/users/#{options[:user_guid]}/taggings/#{options[:tagging_guid]}",
|
89
|
-
http_method: :get
|
90
|
-
}
|
91
|
-
end
|
92
|
-
private_class_method :read_tagging_options
|
93
|
-
|
94
|
-
def self.update_tagging_options(options)
|
95
|
-
{
|
96
|
-
endpoint: "/users/#{options[:user_guid]}/taggings/#{options[:tagging_guid]}",
|
97
|
-
http_method: :put,
|
98
|
-
request_body: {
|
99
|
-
tagging: {
|
100
|
-
tag_guid: options[:tag_guid]
|
101
|
-
}.compact
|
102
|
-
}
|
103
|
-
}
|
104
|
-
end
|
105
|
-
private_class_method :update_tagging_options
|
106
|
-
end
|
107
|
-
end
|
@@ -1,162 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module MXPlatformRuby
|
4
|
-
class Transaction
|
5
|
-
extend ::MXPlatformRuby::Pageable
|
6
|
-
include ::ActiveAttr::Model
|
7
|
-
|
8
|
-
attribute :account_guid
|
9
|
-
attribute :amount
|
10
|
-
attribute :category
|
11
|
-
attribute :check_number_string
|
12
|
-
attribute :created_at
|
13
|
-
attribute :currency_code
|
14
|
-
attribute :date
|
15
|
-
attribute :description
|
16
|
-
attribute :guid
|
17
|
-
attribute :id
|
18
|
-
attribute :is_bill_pay
|
19
|
-
attribute :is_direct_deposit
|
20
|
-
attribute :is_expense
|
21
|
-
attribute :is_fee
|
22
|
-
attribute :is_income
|
23
|
-
attribute :is_international
|
24
|
-
attribute :is_overdraft_fee
|
25
|
-
attribute :is_payroll_advance
|
26
|
-
attribute :is_recurring
|
27
|
-
attribute :is_subscription
|
28
|
-
attribute :latitude
|
29
|
-
attribute :localized_description
|
30
|
-
attribute :localized_memo
|
31
|
-
attribute :longitude
|
32
|
-
attribute :member_guid
|
33
|
-
attribute :memo
|
34
|
-
attribute :merchant_category_code
|
35
|
-
attribute :merchant_guid
|
36
|
-
attribute :original_description
|
37
|
-
attribute :posted_at
|
38
|
-
attribute :status
|
39
|
-
attribute :top_level_category
|
40
|
-
attribute :transacted_at
|
41
|
-
attribute :type
|
42
|
-
attribute :updated_at
|
43
|
-
attribute :user_guid
|
44
|
-
|
45
|
-
def self.list_transactions_by_account(options = {})
|
46
|
-
options = list_transactions_by_account_options(options)
|
47
|
-
|
48
|
-
paginate(options)
|
49
|
-
end
|
50
|
-
|
51
|
-
def self.list_transactions_by_member(options = {})
|
52
|
-
options = list_transactions_by_member_options(options)
|
53
|
-
|
54
|
-
paginate(options)
|
55
|
-
end
|
56
|
-
|
57
|
-
def self.list_transactions_by_tag(options = {})
|
58
|
-
options = list_transactions_by_tag_options(options)
|
59
|
-
|
60
|
-
paginate(options)
|
61
|
-
end
|
62
|
-
|
63
|
-
def self.list_transactions_by_user(options = {})
|
64
|
-
options = list_transactions_by_user_options(options)
|
65
|
-
|
66
|
-
paginate(options)
|
67
|
-
end
|
68
|
-
|
69
|
-
def self.read_transaction(options = {})
|
70
|
-
read_transaction_options = read_transaction_options(options)
|
71
|
-
response = ::MXPlatformRuby.client.make_request(read_transaction_options)
|
72
|
-
|
73
|
-
transaction_params = response['transaction']
|
74
|
-
::MXPlatformRuby::Transaction.new(transaction_params)
|
75
|
-
end
|
76
|
-
|
77
|
-
def self.update_transaction(options = {})
|
78
|
-
update_transaction_options = update_transaction_options(options)
|
79
|
-
response = ::MXPlatformRuby.client.make_request(update_transaction_options)
|
80
|
-
|
81
|
-
transaction_params = response['transaction']
|
82
|
-
::MXPlatformRuby::Transaction.new(transaction_params)
|
83
|
-
end
|
84
|
-
|
85
|
-
# Private class methods
|
86
|
-
|
87
|
-
def self.list_transactions_by_account_options(options)
|
88
|
-
{
|
89
|
-
endpoint: "/users/#{options[:user_guid]}/accounts/#{options[:account_guid]}/transactions",
|
90
|
-
http_method: :get,
|
91
|
-
query_params: {
|
92
|
-
from_date: options[:from_date],
|
93
|
-
page: options[:page],
|
94
|
-
records_per_page: options[:records_per_page],
|
95
|
-
to_date: options[:to_date]
|
96
|
-
}.compact,
|
97
|
-
resource: 'transactions'
|
98
|
-
}
|
99
|
-
end
|
100
|
-
private_class_method :list_transactions_by_account_options
|
101
|
-
|
102
|
-
def self.list_transactions_by_member_options(options)
|
103
|
-
{
|
104
|
-
endpoint: "/users/#{options[:user_guid]}/members/#{options[:member_guid]}/transactions",
|
105
|
-
http_method: :get,
|
106
|
-
query_params: {
|
107
|
-
from_date: options[:from_date],
|
108
|
-
page: options[:page],
|
109
|
-
records_per_page: options[:records_per_page],
|
110
|
-
to_date: options[:to_date]
|
111
|
-
}.compact,
|
112
|
-
resource: 'transactions'
|
113
|
-
}
|
114
|
-
end
|
115
|
-
private_class_method :list_transactions_by_member_options
|
116
|
-
|
117
|
-
def self.list_transactions_by_tag_options(options)
|
118
|
-
{
|
119
|
-
endpoint: "/users/#{options[:user_guid]}/tags/#{options[:tag_guid]}/transactions",
|
120
|
-
http_method: :get,
|
121
|
-
resource: 'transactions'
|
122
|
-
}
|
123
|
-
end
|
124
|
-
private_class_method :list_transactions_by_tag_options
|
125
|
-
|
126
|
-
def self.list_transactions_by_user_options(options)
|
127
|
-
{
|
128
|
-
endpoint: "/users/#{options[:user_guid]}/transactions",
|
129
|
-
http_method: :get,
|
130
|
-
query_params: {
|
131
|
-
from_date: options[:from_date],
|
132
|
-
page: options[:page],
|
133
|
-
records_per_page: options[:records_per_page],
|
134
|
-
to_date: options[:to_date]
|
135
|
-
}.compact,
|
136
|
-
resource: 'transactions'
|
137
|
-
}
|
138
|
-
end
|
139
|
-
private_class_method :list_transactions_by_user_options
|
140
|
-
|
141
|
-
def self.read_transaction_options(options)
|
142
|
-
{
|
143
|
-
endpoint: "/users/#{options[:user_guid]}/transactions/#{options[:transaction_guid]}",
|
144
|
-
http_method: :get
|
145
|
-
}
|
146
|
-
end
|
147
|
-
private_class_method :read_transaction_options
|
148
|
-
|
149
|
-
def self.update_transaction_options(options)
|
150
|
-
{
|
151
|
-
endpoint: "/users/#{options[:user_guid]}/transactions/#{options[:transaction_guid]}",
|
152
|
-
http_method: :put,
|
153
|
-
request_body: {
|
154
|
-
transaction: {
|
155
|
-
description: options[:description]
|
156
|
-
}.compact
|
157
|
-
}
|
158
|
-
}
|
159
|
-
end
|
160
|
-
private_class_method :update_transaction_options
|
161
|
-
end
|
162
|
-
end
|