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
data/.github/workflows/test.yml
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
name: Test
|
2
|
-
|
3
|
-
on: [push]
|
4
|
-
|
5
|
-
jobs:
|
6
|
-
Test:
|
7
|
-
|
8
|
-
runs-on: ubuntu-latest
|
9
|
-
|
10
|
-
steps:
|
11
|
-
- uses: actions/checkout@v2
|
12
|
-
- name: Set up Ruby
|
13
|
-
uses: ruby/setup-ruby@v1
|
14
|
-
with:
|
15
|
-
bundler-cache: true
|
16
|
-
ruby-version: 2.6
|
17
|
-
- name: Install dependencies
|
18
|
-
run: bundle install
|
19
|
-
- name: Run RuboCop and RSpec
|
20
|
-
run: bundle exec rake
|
data/.gitignore
DELETED
data/.rubocop.yml
DELETED
@@ -1,44 +0,0 @@
|
|
1
|
-
AllCops:
|
2
|
-
NewCops: disable # Disabling pending cops
|
3
|
-
SuggestExtensions: false # Disabling extension suggestions
|
4
|
-
TargetRubyVersion: 2.6
|
5
|
-
|
6
|
-
Layout/LineLength:
|
7
|
-
Description: Checks the length of lines in the source code
|
8
|
-
Exclude:
|
9
|
-
- 'spec/lib/**/*.rb' # Excluding to avoid multiline expect statements
|
10
|
-
IgnoredPatterns: ['^ endpoint: ".*'] # Excluding since the endpoints may require longer lines
|
11
|
-
Max: 120
|
12
|
-
|
13
|
-
Metrics/AbcSize:
|
14
|
-
Description: Checks that the ABC size of methods is not higher than the configured maximum
|
15
|
-
Exclude:
|
16
|
-
- 'lib/mx-platform-ruby/pageable.rb' # Disabling because clarity > brevity
|
17
|
-
|
18
|
-
Metrics/BlockLength:
|
19
|
-
Description: Checks if the length of a block exceeds some maximum value
|
20
|
-
Exclude:
|
21
|
-
- 'spec/**/*' # Excluding to allow rspec tests to grow with number of attributes
|
22
|
-
|
23
|
-
Metrics/ClassLength:
|
24
|
-
Description: Checks if the length a class exceeds some maximum value
|
25
|
-
Enabled: false # Disabling because clarity > brevity
|
26
|
-
|
27
|
-
Metrics/MethodLength:
|
28
|
-
Description: Checks if the length a method exceeds some maximum value
|
29
|
-
Enabled: false # Disabling to allow class methods to grow with number of attributes
|
30
|
-
|
31
|
-
Naming/FileName:
|
32
|
-
Description: Checks that Ruby source files have snake_case names
|
33
|
-
Exclude:
|
34
|
-
- 'spec/lib/mx-platform-ruby_spec.rb' # Excluding since gems may have `-` in their name
|
35
|
-
- 'lib/mx-platform-ruby.rb' # Excluding since gems may have `-` in their name
|
36
|
-
|
37
|
-
Style/Documentation:
|
38
|
-
Description: Checks for missing top-level documentation of classes and modules
|
39
|
-
Enabled: false # Disabling because Rails models should be self-explanatory
|
40
|
-
|
41
|
-
Style/SignalException:
|
42
|
-
Description: Checks for uses of fail and raise
|
43
|
-
Exclude:
|
44
|
-
- 'lib/mx-platform-ruby/pageable.rb' # Allow fail if block isn't provided
|
@@ -1,107 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module MXPlatformRuby
|
4
|
-
class Account
|
5
|
-
extend ::MXPlatformRuby::Pageable
|
6
|
-
include ::ActiveAttr::Model
|
7
|
-
|
8
|
-
attribute :account_number
|
9
|
-
attribute :apr
|
10
|
-
attribute :apy
|
11
|
-
attribute :available_balance
|
12
|
-
attribute :available_credit
|
13
|
-
attribute :balance
|
14
|
-
attribute :cash_balance
|
15
|
-
attribute :cash_surrender_value
|
16
|
-
attribute :created_at
|
17
|
-
attribute :credit_limit
|
18
|
-
attribute :currency_code
|
19
|
-
attribute :day_payment_is_due
|
20
|
-
attribute :death_benefit
|
21
|
-
attribute :guid
|
22
|
-
attribute :holdings_value
|
23
|
-
attribute :id
|
24
|
-
attribute :institution_code
|
25
|
-
attribute :insured_name
|
26
|
-
attribute :interest_rate
|
27
|
-
attribute :is_closed
|
28
|
-
attribute :is_hidden
|
29
|
-
attribute :last_payment
|
30
|
-
attribute :last_payment_at
|
31
|
-
attribute :loan_amount
|
32
|
-
attribute :matures_on
|
33
|
-
attribute :member_guid
|
34
|
-
attribute :minimum_balance
|
35
|
-
attribute :minimum_payment
|
36
|
-
attribute :name
|
37
|
-
attribute :original_balance
|
38
|
-
attribute :pay_out_amount
|
39
|
-
attribute :payment_due_at
|
40
|
-
attribute :payoff_balance
|
41
|
-
attribute :premium_amount
|
42
|
-
attribute :started_on
|
43
|
-
attribute :subtype
|
44
|
-
attribute :total_account_value
|
45
|
-
attribute :type
|
46
|
-
attribute :updated_at
|
47
|
-
attribute :user_guid
|
48
|
-
|
49
|
-
def self.list_user_accounts(options = {})
|
50
|
-
options = list_user_accounts_options(options)
|
51
|
-
|
52
|
-
paginate(options)
|
53
|
-
end
|
54
|
-
|
55
|
-
def self.read_account(options = {})
|
56
|
-
read_account_options = read_account_options(options)
|
57
|
-
response = ::MXPlatformRuby.client.make_request(read_account_options)
|
58
|
-
|
59
|
-
account_params = response['account']
|
60
|
-
::MXPlatformRuby::Account.new(account_params)
|
61
|
-
end
|
62
|
-
|
63
|
-
def self.update_account(options = {})
|
64
|
-
update_account_options = update_account_options(options)
|
65
|
-
response = ::MXPlatformRuby.client.make_request(update_account_options)
|
66
|
-
|
67
|
-
account_params = response['account']
|
68
|
-
::MXPlatformRuby::Account.new(account_params)
|
69
|
-
end
|
70
|
-
|
71
|
-
# Private class methods
|
72
|
-
|
73
|
-
def self.list_user_accounts_options(options)
|
74
|
-
{
|
75
|
-
endpoint: "/users/#{options[:user_guid]}/accounts",
|
76
|
-
http_method: :get,
|
77
|
-
query_params: {
|
78
|
-
page: options[:page],
|
79
|
-
records_per_page: options[:records_per_page]
|
80
|
-
}.compact,
|
81
|
-
resource: 'accounts'
|
82
|
-
}
|
83
|
-
end
|
84
|
-
private_class_method :list_user_accounts_options
|
85
|
-
|
86
|
-
def self.read_account_options(options)
|
87
|
-
{
|
88
|
-
endpoint: "/users/#{options[:user_guid]}/accounts/#{options[:account_guid]}",
|
89
|
-
http_method: :get
|
90
|
-
}
|
91
|
-
end
|
92
|
-
private_class_method :read_account_options
|
93
|
-
|
94
|
-
def self.update_account_options(options)
|
95
|
-
{
|
96
|
-
endpoint: "/users/#{options[:user_guid]}/members/#{options[:member_guid]}/accounts/#{options[:account_guid]}",
|
97
|
-
http_method: :put,
|
98
|
-
request_body: {
|
99
|
-
account: {
|
100
|
-
is_hidden: options[:is_hidden]
|
101
|
-
}.compact
|
102
|
-
}
|
103
|
-
}
|
104
|
-
end
|
105
|
-
private_class_method :update_account_options
|
106
|
-
end
|
107
|
-
end
|
@@ -1,57 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module MXPlatformRuby
|
4
|
-
class AccountNumber
|
5
|
-
extend ::MXPlatformRuby::Pageable
|
6
|
-
include ::ActiveAttr::Model
|
7
|
-
|
8
|
-
attribute :account_guid
|
9
|
-
attribute :account_number
|
10
|
-
attribute :guid
|
11
|
-
attribute :institution_number
|
12
|
-
attribute :member_guid
|
13
|
-
attribute :routing_number
|
14
|
-
attribute :transit_number
|
15
|
-
attribute :user_guid
|
16
|
-
|
17
|
-
def self.list_account_numbers_by_account(options = {})
|
18
|
-
options = list_account_numbers_by_account_options(options)
|
19
|
-
|
20
|
-
paginate(options)
|
21
|
-
end
|
22
|
-
|
23
|
-
def self.list_account_numbers_by_member(options = {})
|
24
|
-
options = list_account_numbers_by_member_options(options)
|
25
|
-
|
26
|
-
paginate(options)
|
27
|
-
end
|
28
|
-
|
29
|
-
# Private class methods
|
30
|
-
|
31
|
-
def self.list_account_numbers_by_account_options(options)
|
32
|
-
{
|
33
|
-
endpoint: "/users/#{options[:user_guid]}/accounts/#{options[:account_guid]}/account_numbers",
|
34
|
-
http_method: :get,
|
35
|
-
query_params: {
|
36
|
-
page: options[:page],
|
37
|
-
records_per_page: options[:records_per_page]
|
38
|
-
}.compact,
|
39
|
-
resource: 'account_numbers'
|
40
|
-
}
|
41
|
-
end
|
42
|
-
private_class_method :list_account_numbers_by_account_options
|
43
|
-
|
44
|
-
def self.list_account_numbers_by_member_options(options)
|
45
|
-
{
|
46
|
-
endpoint: "/users/#{options[:user_guid]}/members/#{options[:member_guid]}/account_numbers",
|
47
|
-
http_method: :get,
|
48
|
-
query_params: {
|
49
|
-
page: options[:page],
|
50
|
-
records_per_page: options[:records_per_page]
|
51
|
-
}.compact,
|
52
|
-
resource: 'account_numbers'
|
53
|
-
}
|
54
|
-
end
|
55
|
-
private_class_method :list_account_numbers_by_member_options
|
56
|
-
end
|
57
|
-
end
|
@@ -1,42 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module MXPlatformRuby
|
4
|
-
class AccountOwner
|
5
|
-
extend ::MXPlatformRuby::Pageable
|
6
|
-
include ::ActiveAttr::Model
|
7
|
-
|
8
|
-
attribute :account_guid
|
9
|
-
attribute :address
|
10
|
-
attribute :city
|
11
|
-
attribute :country
|
12
|
-
attribute :email
|
13
|
-
attribute :guid
|
14
|
-
attribute :member_guid
|
15
|
-
attribute :owner_name
|
16
|
-
attribute :phone
|
17
|
-
attribute :postal_code
|
18
|
-
attribute :state
|
19
|
-
attribute :user_guid
|
20
|
-
|
21
|
-
def self.list_account_owners(options = {})
|
22
|
-
options = list_account_owners_options(options)
|
23
|
-
|
24
|
-
paginate(options)
|
25
|
-
end
|
26
|
-
|
27
|
-
# Private class methods
|
28
|
-
|
29
|
-
def self.list_account_owners_options(options)
|
30
|
-
{
|
31
|
-
endpoint: "/users/#{options[:user_guid]}/members/#{options[:member_guid]}/account_owners",
|
32
|
-
http_method: :get,
|
33
|
-
query_params: {
|
34
|
-
page: options[:page],
|
35
|
-
records_per_page: options[:records_per_page]
|
36
|
-
}.compact,
|
37
|
-
resource: 'account_owners'
|
38
|
-
}
|
39
|
-
end
|
40
|
-
private_class_method :list_account_owners_options
|
41
|
-
end
|
42
|
-
end
|
@@ -1,127 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module MXPlatformRuby
|
4
|
-
class Category
|
5
|
-
extend ::MXPlatformRuby::Pageable
|
6
|
-
include ::ActiveAttr::Model
|
7
|
-
|
8
|
-
attribute :created_at
|
9
|
-
attribute :guid
|
10
|
-
attribute :is_default
|
11
|
-
attribute :is_income
|
12
|
-
attribute :metadata
|
13
|
-
attribute :name
|
14
|
-
attribute :parent_guid
|
15
|
-
attribute :updated_at
|
16
|
-
|
17
|
-
def self.create_category(options = {})
|
18
|
-
create_category_options = create_category_options(options)
|
19
|
-
response = ::MXPlatformRuby.client.make_request(create_category_options)
|
20
|
-
|
21
|
-
category_params = response['category']
|
22
|
-
::MXPlatformRuby::Category.new(category_params)
|
23
|
-
end
|
24
|
-
|
25
|
-
def self.delete_category(options = {})
|
26
|
-
delete_category_options = delete_category_options(options)
|
27
|
-
::MXPlatformRuby.client.make_request(delete_category_options)
|
28
|
-
end
|
29
|
-
|
30
|
-
def self.list_categories(options = {})
|
31
|
-
options = list_categories_options(options)
|
32
|
-
|
33
|
-
paginate(options)
|
34
|
-
end
|
35
|
-
|
36
|
-
def self.list_default_categories(options = {})
|
37
|
-
options = list_default_categories_options(options)
|
38
|
-
|
39
|
-
paginate(options)
|
40
|
-
end
|
41
|
-
|
42
|
-
def self.read_category(options = {})
|
43
|
-
read_category_options = read_category_options(options)
|
44
|
-
response = ::MXPlatformRuby.client.make_request(read_category_options)
|
45
|
-
|
46
|
-
category_params = response['category']
|
47
|
-
::MXPlatformRuby::Category.new(category_params)
|
48
|
-
end
|
49
|
-
|
50
|
-
def self.update_category(options = {})
|
51
|
-
update_category_options = update_category_options(options)
|
52
|
-
response = ::MXPlatformRuby.client.make_request(update_category_options)
|
53
|
-
|
54
|
-
category_params = response['category']
|
55
|
-
::MXPlatformRuby::Category.new(category_params)
|
56
|
-
end
|
57
|
-
|
58
|
-
# Private class methods
|
59
|
-
|
60
|
-
def self.create_category_options(options)
|
61
|
-
{
|
62
|
-
endpoint: "/users/#{options[:user_guid]}/categories",
|
63
|
-
http_method: :post,
|
64
|
-
request_body: {
|
65
|
-
category: {
|
66
|
-
metadata: options[:metadata],
|
67
|
-
name: options[:name],
|
68
|
-
parent_guid: options[:parent_guid]
|
69
|
-
}.compact
|
70
|
-
}
|
71
|
-
}
|
72
|
-
end
|
73
|
-
private_class_method :create_category_options
|
74
|
-
|
75
|
-
def self.delete_category_options(options)
|
76
|
-
{
|
77
|
-
endpoint: "/users/#{options[:user_guid]}/categories/#{options[:category_guid]}",
|
78
|
-
http_method: :delete
|
79
|
-
}
|
80
|
-
end
|
81
|
-
private_class_method :delete_category_options
|
82
|
-
|
83
|
-
def self.list_categories_options(options)
|
84
|
-
{
|
85
|
-
endpoint: "/users/#{options[:user_guid]}/categories",
|
86
|
-
http_method: :get,
|
87
|
-
query_params: {
|
88
|
-
page: options[:page],
|
89
|
-
records_per_page: options[:records_per_page]
|
90
|
-
}.compact,
|
91
|
-
resource: 'categories'
|
92
|
-
}
|
93
|
-
end
|
94
|
-
private_class_method :list_categories_options
|
95
|
-
|
96
|
-
def self.list_default_categories_options(options)
|
97
|
-
{
|
98
|
-
endpoint: "/users/#{options[:user_guid]}/categories/default",
|
99
|
-
http_method: :get,
|
100
|
-
resource: 'categories'
|
101
|
-
}
|
102
|
-
end
|
103
|
-
private_class_method :list_default_categories_options
|
104
|
-
|
105
|
-
def self.read_category_options(options)
|
106
|
-
{
|
107
|
-
endpoint: "/users/#{options[:user_guid]}/categories/#{options[:category_guid]}",
|
108
|
-
http_method: :get
|
109
|
-
}
|
110
|
-
end
|
111
|
-
private_class_method :read_category_options
|
112
|
-
|
113
|
-
def self.update_category_options(options)
|
114
|
-
{
|
115
|
-
endpoint: "/users/#{options[:user_guid]}/categories/#{options[:category_guid]}",
|
116
|
-
http_method: :put,
|
117
|
-
request_body: {
|
118
|
-
category: {
|
119
|
-
metadata: options[:metadata],
|
120
|
-
name: options[:name]
|
121
|
-
}.compact
|
122
|
-
}
|
123
|
-
}
|
124
|
-
end
|
125
|
-
private_class_method :update_category_options
|
126
|
-
end
|
127
|
-
end
|
@@ -1,37 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module MXPlatformRuby
|
4
|
-
class Challenge
|
5
|
-
extend ::MXPlatformRuby::Pageable
|
6
|
-
include ::ActiveAttr::Model
|
7
|
-
|
8
|
-
attribute :field_name
|
9
|
-
attribute :guid
|
10
|
-
attribute :image_data
|
11
|
-
attribute :image_options
|
12
|
-
attribute :label
|
13
|
-
attribute :options
|
14
|
-
attribute :type
|
15
|
-
|
16
|
-
def self.list_member_challenges(options = {})
|
17
|
-
options = list_member_challenges_options(options)
|
18
|
-
|
19
|
-
paginate(options)
|
20
|
-
end
|
21
|
-
|
22
|
-
# Private class methods
|
23
|
-
|
24
|
-
def self.list_member_challenges_options(options)
|
25
|
-
{
|
26
|
-
endpoint: "/users/#{options[:user_guid]}/members/#{options[:member_guid]}/challenges",
|
27
|
-
http_method: :get,
|
28
|
-
query_params: {
|
29
|
-
page: options[:page],
|
30
|
-
records_per_page: options[:records_per_page]
|
31
|
-
}.compact,
|
32
|
-
resource: 'challenges'
|
33
|
-
}
|
34
|
-
end
|
35
|
-
private_class_method :list_member_challenges_options
|
36
|
-
end
|
37
|
-
end
|